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::Buildable;
7 use crate::Container;
8 use crate::DirectionType;
9 use crate::NotebookTab;
10 use crate::PackType;
11 use crate::PositionType;
12 use crate::ResizeMode;
13 use crate::Widget;
14 use glib::object::Cast;
15 use glib::object::IsA;
16 use glib::object::ObjectExt;
17 use glib::signal::connect_raw;
18 use glib::signal::SignalHandlerId;
19 use glib::translate::*;
20 use glib::StaticType;
21 use glib::ToValue;
22 use std::boxed::Box as Box_;
23 use std::fmt;
24 use std::mem::transmute;
25 
26 glib::wrapper! {
27     #[doc(alias = "GtkNotebook")]
28     pub struct Notebook(Object<ffi::GtkNotebook, ffi::GtkNotebookClass>) @extends Container, Widget, @implements Buildable;
29 
30     match fn {
31         type_ => || ffi::gtk_notebook_get_type(),
32     }
33 }
34 
35 impl Notebook {
36     #[doc(alias = "gtk_notebook_new")]
new() -> Notebook37     pub fn new() -> Notebook {
38         assert_initialized_main_thread!();
39         unsafe { Widget::from_glib_none(ffi::gtk_notebook_new()).unsafe_cast() }
40     }
41 
42     // rustdoc-stripper-ignore-next
43     /// Creates a new builder-pattern struct instance to construct [`Notebook`] objects.
44     ///
45     /// This method returns an instance of [`NotebookBuilder`] which can be used to create [`Notebook`] objects.
builder() -> NotebookBuilder46     pub fn builder() -> NotebookBuilder {
47         NotebookBuilder::default()
48     }
49 }
50 
51 impl Default for Notebook {
default() -> Self52     fn default() -> Self {
53         Self::new()
54     }
55 }
56 
57 #[derive(Clone, Default)]
58 // rustdoc-stripper-ignore-next
59 /// A [builder-pattern] type to construct [`Notebook`] objects.
60 ///
61 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
62 pub struct NotebookBuilder {
63     enable_popup: Option<bool>,
64     group_name: Option<String>,
65     page: Option<i32>,
66     scrollable: Option<bool>,
67     show_border: Option<bool>,
68     show_tabs: Option<bool>,
69     tab_pos: Option<PositionType>,
70     border_width: Option<u32>,
71     child: Option<Widget>,
72     resize_mode: Option<ResizeMode>,
73     app_paintable: Option<bool>,
74     can_default: Option<bool>,
75     can_focus: Option<bool>,
76     events: Option<gdk::EventMask>,
77     expand: Option<bool>,
78     #[cfg(any(feature = "v3_20", feature = "dox"))]
79     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
80     focus_on_click: Option<bool>,
81     halign: Option<Align>,
82     has_default: Option<bool>,
83     has_focus: Option<bool>,
84     has_tooltip: Option<bool>,
85     height_request: Option<i32>,
86     hexpand: Option<bool>,
87     hexpand_set: Option<bool>,
88     is_focus: Option<bool>,
89     margin: Option<i32>,
90     margin_bottom: Option<i32>,
91     margin_end: Option<i32>,
92     margin_start: Option<i32>,
93     margin_top: Option<i32>,
94     name: Option<String>,
95     no_show_all: Option<bool>,
96     opacity: Option<f64>,
97     parent: Option<Container>,
98     receives_default: Option<bool>,
99     sensitive: Option<bool>,
100     tooltip_markup: Option<String>,
101     tooltip_text: Option<String>,
102     valign: Option<Align>,
103     vexpand: Option<bool>,
104     vexpand_set: Option<bool>,
105     visible: Option<bool>,
106     width_request: Option<i32>,
107 }
108 
109 impl NotebookBuilder {
110     // rustdoc-stripper-ignore-next
111     /// Create a new [`NotebookBuilder`].
new() -> Self112     pub fn new() -> Self {
113         Self::default()
114     }
115 
116     // rustdoc-stripper-ignore-next
117     /// Build the [`Notebook`].
build(self) -> Notebook118     pub fn build(self) -> Notebook {
119         let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
120         if let Some(ref enable_popup) = self.enable_popup {
121             properties.push(("enable-popup", enable_popup));
122         }
123         if let Some(ref group_name) = self.group_name {
124             properties.push(("group-name", group_name));
125         }
126         if let Some(ref page) = self.page {
127             properties.push(("page", page));
128         }
129         if let Some(ref scrollable) = self.scrollable {
130             properties.push(("scrollable", scrollable));
131         }
132         if let Some(ref show_border) = self.show_border {
133             properties.push(("show-border", show_border));
134         }
135         if let Some(ref show_tabs) = self.show_tabs {
136             properties.push(("show-tabs", show_tabs));
137         }
138         if let Some(ref tab_pos) = self.tab_pos {
139             properties.push(("tab-pos", tab_pos));
140         }
141         if let Some(ref border_width) = self.border_width {
142             properties.push(("border-width", border_width));
143         }
144         if let Some(ref child) = self.child {
145             properties.push(("child", child));
146         }
147         if let Some(ref resize_mode) = self.resize_mode {
148             properties.push(("resize-mode", resize_mode));
149         }
150         if let Some(ref app_paintable) = self.app_paintable {
151             properties.push(("app-paintable", app_paintable));
152         }
153         if let Some(ref can_default) = self.can_default {
154             properties.push(("can-default", can_default));
155         }
156         if let Some(ref can_focus) = self.can_focus {
157             properties.push(("can-focus", can_focus));
158         }
159         if let Some(ref events) = self.events {
160             properties.push(("events", events));
161         }
162         if let Some(ref expand) = self.expand {
163             properties.push(("expand", expand));
164         }
165         #[cfg(any(feature = "v3_20", feature = "dox"))]
166         if let Some(ref focus_on_click) = self.focus_on_click {
167             properties.push(("focus-on-click", focus_on_click));
168         }
169         if let Some(ref halign) = self.halign {
170             properties.push(("halign", halign));
171         }
172         if let Some(ref has_default) = self.has_default {
173             properties.push(("has-default", has_default));
174         }
175         if let Some(ref has_focus) = self.has_focus {
176             properties.push(("has-focus", has_focus));
177         }
178         if let Some(ref has_tooltip) = self.has_tooltip {
179             properties.push(("has-tooltip", has_tooltip));
180         }
181         if let Some(ref height_request) = self.height_request {
182             properties.push(("height-request", height_request));
183         }
184         if let Some(ref hexpand) = self.hexpand {
185             properties.push(("hexpand", hexpand));
186         }
187         if let Some(ref hexpand_set) = self.hexpand_set {
188             properties.push(("hexpand-set", hexpand_set));
189         }
190         if let Some(ref is_focus) = self.is_focus {
191             properties.push(("is-focus", is_focus));
192         }
193         if let Some(ref margin) = self.margin {
194             properties.push(("margin", margin));
195         }
196         if let Some(ref margin_bottom) = self.margin_bottom {
197             properties.push(("margin-bottom", margin_bottom));
198         }
199         if let Some(ref margin_end) = self.margin_end {
200             properties.push(("margin-end", margin_end));
201         }
202         if let Some(ref margin_start) = self.margin_start {
203             properties.push(("margin-start", margin_start));
204         }
205         if let Some(ref margin_top) = self.margin_top {
206             properties.push(("margin-top", margin_top));
207         }
208         if let Some(ref name) = self.name {
209             properties.push(("name", name));
210         }
211         if let Some(ref no_show_all) = self.no_show_all {
212             properties.push(("no-show-all", no_show_all));
213         }
214         if let Some(ref opacity) = self.opacity {
215             properties.push(("opacity", opacity));
216         }
217         if let Some(ref parent) = self.parent {
218             properties.push(("parent", parent));
219         }
220         if let Some(ref receives_default) = self.receives_default {
221             properties.push(("receives-default", receives_default));
222         }
223         if let Some(ref sensitive) = self.sensitive {
224             properties.push(("sensitive", sensitive));
225         }
226         if let Some(ref tooltip_markup) = self.tooltip_markup {
227             properties.push(("tooltip-markup", tooltip_markup));
228         }
229         if let Some(ref tooltip_text) = self.tooltip_text {
230             properties.push(("tooltip-text", tooltip_text));
231         }
232         if let Some(ref valign) = self.valign {
233             properties.push(("valign", valign));
234         }
235         if let Some(ref vexpand) = self.vexpand {
236             properties.push(("vexpand", vexpand));
237         }
238         if let Some(ref vexpand_set) = self.vexpand_set {
239             properties.push(("vexpand-set", vexpand_set));
240         }
241         if let Some(ref visible) = self.visible {
242             properties.push(("visible", visible));
243         }
244         if let Some(ref width_request) = self.width_request {
245             properties.push(("width-request", width_request));
246         }
247         glib::Object::new::<Notebook>(&properties)
248             .expect("Failed to create an instance of Notebook")
249     }
250 
enable_popup(mut self, enable_popup: bool) -> Self251     pub fn enable_popup(mut self, enable_popup: bool) -> Self {
252         self.enable_popup = Some(enable_popup);
253         self
254     }
255 
group_name(mut self, group_name: &str) -> Self256     pub fn group_name(mut self, group_name: &str) -> Self {
257         self.group_name = Some(group_name.to_string());
258         self
259     }
260 
page(mut self, page: i32) -> Self261     pub fn page(mut self, page: i32) -> Self {
262         self.page = Some(page);
263         self
264     }
265 
scrollable(mut self, scrollable: bool) -> Self266     pub fn scrollable(mut self, scrollable: bool) -> Self {
267         self.scrollable = Some(scrollable);
268         self
269     }
270 
show_border(mut self, show_border: bool) -> Self271     pub fn show_border(mut self, show_border: bool) -> Self {
272         self.show_border = Some(show_border);
273         self
274     }
275 
show_tabs(mut self, show_tabs: bool) -> Self276     pub fn show_tabs(mut self, show_tabs: bool) -> Self {
277         self.show_tabs = Some(show_tabs);
278         self
279     }
280 
tab_pos(mut self, tab_pos: PositionType) -> Self281     pub fn tab_pos(mut self, tab_pos: PositionType) -> Self {
282         self.tab_pos = Some(tab_pos);
283         self
284     }
285 
border_width(mut self, border_width: u32) -> Self286     pub fn border_width(mut self, border_width: u32) -> Self {
287         self.border_width = Some(border_width);
288         self
289     }
290 
child<P: IsA<Widget>>(mut self, child: &P) -> Self291     pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self {
292         self.child = Some(child.clone().upcast());
293         self
294     }
295 
resize_mode(mut self, resize_mode: ResizeMode) -> Self296     pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
297         self.resize_mode = Some(resize_mode);
298         self
299     }
300 
app_paintable(mut self, app_paintable: bool) -> Self301     pub fn app_paintable(mut self, app_paintable: bool) -> Self {
302         self.app_paintable = Some(app_paintable);
303         self
304     }
305 
can_default(mut self, can_default: bool) -> Self306     pub fn can_default(mut self, can_default: bool) -> Self {
307         self.can_default = Some(can_default);
308         self
309     }
310 
can_focus(mut self, can_focus: bool) -> Self311     pub fn can_focus(mut self, can_focus: bool) -> Self {
312         self.can_focus = Some(can_focus);
313         self
314     }
315 
events(mut self, events: gdk::EventMask) -> Self316     pub fn events(mut self, events: gdk::EventMask) -> Self {
317         self.events = Some(events);
318         self
319     }
320 
expand(mut self, expand: bool) -> Self321     pub fn expand(mut self, expand: bool) -> Self {
322         self.expand = Some(expand);
323         self
324     }
325 
326     #[cfg(any(feature = "v3_20", feature = "dox"))]
327     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
focus_on_click(mut self, focus_on_click: bool) -> Self328     pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
329         self.focus_on_click = Some(focus_on_click);
330         self
331     }
332 
halign(mut self, halign: Align) -> Self333     pub fn halign(mut self, halign: Align) -> Self {
334         self.halign = Some(halign);
335         self
336     }
337 
has_default(mut self, has_default: bool) -> Self338     pub fn has_default(mut self, has_default: bool) -> Self {
339         self.has_default = Some(has_default);
340         self
341     }
342 
has_focus(mut self, has_focus: bool) -> Self343     pub fn has_focus(mut self, has_focus: bool) -> Self {
344         self.has_focus = Some(has_focus);
345         self
346     }
347 
has_tooltip(mut self, has_tooltip: bool) -> Self348     pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
349         self.has_tooltip = Some(has_tooltip);
350         self
351     }
352 
height_request(mut self, height_request: i32) -> Self353     pub fn height_request(mut self, height_request: i32) -> Self {
354         self.height_request = Some(height_request);
355         self
356     }
357 
hexpand(mut self, hexpand: bool) -> Self358     pub fn hexpand(mut self, hexpand: bool) -> Self {
359         self.hexpand = Some(hexpand);
360         self
361     }
362 
hexpand_set(mut self, hexpand_set: bool) -> Self363     pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
364         self.hexpand_set = Some(hexpand_set);
365         self
366     }
367 
is_focus(mut self, is_focus: bool) -> Self368     pub fn is_focus(mut self, is_focus: bool) -> Self {
369         self.is_focus = Some(is_focus);
370         self
371     }
372 
margin(mut self, margin: i32) -> Self373     pub fn margin(mut self, margin: i32) -> Self {
374         self.margin = Some(margin);
375         self
376     }
377 
margin_bottom(mut self, margin_bottom: i32) -> Self378     pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
379         self.margin_bottom = Some(margin_bottom);
380         self
381     }
382 
margin_end(mut self, margin_end: i32) -> Self383     pub fn margin_end(mut self, margin_end: i32) -> Self {
384         self.margin_end = Some(margin_end);
385         self
386     }
387 
margin_start(mut self, margin_start: i32) -> Self388     pub fn margin_start(mut self, margin_start: i32) -> Self {
389         self.margin_start = Some(margin_start);
390         self
391     }
392 
margin_top(mut self, margin_top: i32) -> Self393     pub fn margin_top(mut self, margin_top: i32) -> Self {
394         self.margin_top = Some(margin_top);
395         self
396     }
397 
name(mut self, name: &str) -> Self398     pub fn name(mut self, name: &str) -> Self {
399         self.name = Some(name.to_string());
400         self
401     }
402 
no_show_all(mut self, no_show_all: bool) -> Self403     pub fn no_show_all(mut self, no_show_all: bool) -> Self {
404         self.no_show_all = Some(no_show_all);
405         self
406     }
407 
opacity(mut self, opacity: f64) -> Self408     pub fn opacity(mut self, opacity: f64) -> Self {
409         self.opacity = Some(opacity);
410         self
411     }
412 
parent<P: IsA<Container>>(mut self, parent: &P) -> Self413     pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self {
414         self.parent = Some(parent.clone().upcast());
415         self
416     }
417 
receives_default(mut self, receives_default: bool) -> Self418     pub fn receives_default(mut self, receives_default: bool) -> Self {
419         self.receives_default = Some(receives_default);
420         self
421     }
422 
sensitive(mut self, sensitive: bool) -> Self423     pub fn sensitive(mut self, sensitive: bool) -> Self {
424         self.sensitive = Some(sensitive);
425         self
426     }
427 
tooltip_markup(mut self, tooltip_markup: &str) -> Self428     pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
429         self.tooltip_markup = Some(tooltip_markup.to_string());
430         self
431     }
432 
tooltip_text(mut self, tooltip_text: &str) -> Self433     pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
434         self.tooltip_text = Some(tooltip_text.to_string());
435         self
436     }
437 
valign(mut self, valign: Align) -> Self438     pub fn valign(mut self, valign: Align) -> Self {
439         self.valign = Some(valign);
440         self
441     }
442 
vexpand(mut self, vexpand: bool) -> Self443     pub fn vexpand(mut self, vexpand: bool) -> Self {
444         self.vexpand = Some(vexpand);
445         self
446     }
447 
vexpand_set(mut self, vexpand_set: bool) -> Self448     pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
449         self.vexpand_set = Some(vexpand_set);
450         self
451     }
452 
visible(mut self, visible: bool) -> Self453     pub fn visible(mut self, visible: bool) -> Self {
454         self.visible = Some(visible);
455         self
456     }
457 
width_request(mut self, width_request: i32) -> Self458     pub fn width_request(mut self, width_request: i32) -> Self {
459         self.width_request = Some(width_request);
460         self
461     }
462 }
463 
464 pub const NONE_NOTEBOOK: Option<&Notebook> = None;
465 
466 pub trait NotebookExt: 'static {
467     #[doc(alias = "gtk_notebook_detach_tab")]
detach_tab<P: IsA<Widget>>(&self, child: &P)468     fn detach_tab<P: IsA<Widget>>(&self, child: &P);
469 
470     #[doc(alias = "gtk_notebook_get_action_widget")]
471     #[doc(alias = "get_action_widget")]
action_widget(&self, pack_type: PackType) -> Option<Widget>472     fn action_widget(&self, pack_type: PackType) -> Option<Widget>;
473 
474     #[doc(alias = "gtk_notebook_get_group_name")]
475     #[doc(alias = "get_group_name")]
group_name(&self) -> Option<glib::GString>476     fn group_name(&self) -> Option<glib::GString>;
477 
478     #[doc(alias = "gtk_notebook_get_menu_label")]
479     #[doc(alias = "get_menu_label")]
menu_label<P: IsA<Widget>>(&self, child: &P) -> Option<Widget>480     fn menu_label<P: IsA<Widget>>(&self, child: &P) -> Option<Widget>;
481 
482     #[doc(alias = "gtk_notebook_get_menu_label_text")]
483     #[doc(alias = "get_menu_label_text")]
menu_label_text<P: IsA<Widget>>(&self, child: &P) -> Option<glib::GString>484     fn menu_label_text<P: IsA<Widget>>(&self, child: &P) -> Option<glib::GString>;
485 
486     #[doc(alias = "gtk_notebook_get_scrollable")]
487     #[doc(alias = "get_scrollable")]
is_scrollable(&self) -> bool488     fn is_scrollable(&self) -> bool;
489 
490     #[doc(alias = "gtk_notebook_get_show_border")]
491     #[doc(alias = "get_show_border")]
shows_border(&self) -> bool492     fn shows_border(&self) -> bool;
493 
494     #[doc(alias = "gtk_notebook_get_show_tabs")]
495     #[doc(alias = "get_show_tabs")]
shows_tabs(&self) -> bool496     fn shows_tabs(&self) -> bool;
497 
498     #[doc(alias = "gtk_notebook_get_tab_detachable")]
499     #[doc(alias = "get_tab_detachable")]
tab_is_detachable<P: IsA<Widget>>(&self, child: &P) -> bool500     fn tab_is_detachable<P: IsA<Widget>>(&self, child: &P) -> bool;
501 
502     #[doc(alias = "gtk_notebook_get_tab_label")]
503     #[doc(alias = "get_tab_label")]
tab_label<P: IsA<Widget>>(&self, child: &P) -> Option<Widget>504     fn tab_label<P: IsA<Widget>>(&self, child: &P) -> Option<Widget>;
505 
506     #[doc(alias = "gtk_notebook_get_tab_label_text")]
507     #[doc(alias = "get_tab_label_text")]
tab_label_text<P: IsA<Widget>>(&self, child: &P) -> Option<glib::GString>508     fn tab_label_text<P: IsA<Widget>>(&self, child: &P) -> Option<glib::GString>;
509 
510     #[doc(alias = "gtk_notebook_get_tab_pos")]
511     #[doc(alias = "get_tab_pos")]
tab_pos(&self) -> PositionType512     fn tab_pos(&self) -> PositionType;
513 
514     #[doc(alias = "gtk_notebook_get_tab_reorderable")]
515     #[doc(alias = "get_tab_reorderable")]
tab_is_reorderable<P: IsA<Widget>>(&self, child: &P) -> bool516     fn tab_is_reorderable<P: IsA<Widget>>(&self, child: &P) -> bool;
517 
518     #[doc(alias = "gtk_notebook_next_page")]
next_page(&self)519     fn next_page(&self);
520 
521     #[doc(alias = "gtk_notebook_popup_disable")]
popup_disable(&self)522     fn popup_disable(&self);
523 
524     #[doc(alias = "gtk_notebook_popup_enable")]
popup_enable(&self)525     fn popup_enable(&self);
526 
527     #[doc(alias = "gtk_notebook_prev_page")]
prev_page(&self)528     fn prev_page(&self);
529 
530     #[doc(alias = "gtk_notebook_set_action_widget")]
set_action_widget<P: IsA<Widget>>(&self, widget: &P, pack_type: PackType)531     fn set_action_widget<P: IsA<Widget>>(&self, widget: &P, pack_type: PackType);
532 
533     #[doc(alias = "gtk_notebook_set_group_name")]
set_group_name(&self, group_name: Option<&str>)534     fn set_group_name(&self, group_name: Option<&str>);
535 
536     #[doc(alias = "gtk_notebook_set_menu_label")]
set_menu_label<P: IsA<Widget>, Q: IsA<Widget>>(&self, child: &P, menu_label: Option<&Q>)537     fn set_menu_label<P: IsA<Widget>, Q: IsA<Widget>>(&self, child: &P, menu_label: Option<&Q>);
538 
539     #[doc(alias = "gtk_notebook_set_menu_label_text")]
set_menu_label_text<P: IsA<Widget>>(&self, child: &P, menu_text: &str)540     fn set_menu_label_text<P: IsA<Widget>>(&self, child: &P, menu_text: &str);
541 
542     #[doc(alias = "gtk_notebook_set_scrollable")]
set_scrollable(&self, scrollable: bool)543     fn set_scrollable(&self, scrollable: bool);
544 
545     #[doc(alias = "gtk_notebook_set_show_border")]
set_show_border(&self, show_border: bool)546     fn set_show_border(&self, show_border: bool);
547 
548     #[doc(alias = "gtk_notebook_set_show_tabs")]
set_show_tabs(&self, show_tabs: bool)549     fn set_show_tabs(&self, show_tabs: bool);
550 
551     #[doc(alias = "gtk_notebook_set_tab_detachable")]
set_tab_detachable<P: IsA<Widget>>(&self, child: &P, detachable: bool)552     fn set_tab_detachable<P: IsA<Widget>>(&self, child: &P, detachable: bool);
553 
554     #[doc(alias = "gtk_notebook_set_tab_label")]
set_tab_label<P: IsA<Widget>, Q: IsA<Widget>>(&self, child: &P, tab_label: Option<&Q>)555     fn set_tab_label<P: IsA<Widget>, Q: IsA<Widget>>(&self, child: &P, tab_label: Option<&Q>);
556 
557     #[doc(alias = "gtk_notebook_set_tab_label_text")]
set_tab_label_text<P: IsA<Widget>>(&self, child: &P, tab_text: &str)558     fn set_tab_label_text<P: IsA<Widget>>(&self, child: &P, tab_text: &str);
559 
560     #[doc(alias = "gtk_notebook_set_tab_pos")]
set_tab_pos(&self, pos: PositionType)561     fn set_tab_pos(&self, pos: PositionType);
562 
563     #[doc(alias = "gtk_notebook_set_tab_reorderable")]
set_tab_reorderable<P: IsA<Widget>>(&self, child: &P, reorderable: bool)564     fn set_tab_reorderable<P: IsA<Widget>>(&self, child: &P, reorderable: bool);
565 
566     #[doc(alias = "enable-popup")]
enables_popup(&self) -> bool567     fn enables_popup(&self) -> bool;
568 
569     #[doc(alias = "enable-popup")]
set_enable_popup(&self, enable_popup: bool)570     fn set_enable_popup(&self, enable_popup: bool);
571 
page(&self) -> i32572     fn page(&self) -> i32;
573 
set_page(&self, page: i32)574     fn set_page(&self, page: i32);
575 
576     #[doc(hidden)]
child_is_detachable<T: IsA<Widget>>(&self, item: &T) -> bool577     fn child_is_detachable<T: IsA<Widget>>(&self, item: &T) -> bool;
578 
579     #[doc(hidden)]
set_child_detachable<T: IsA<Widget>>(&self, item: &T, detachable: bool)580     fn set_child_detachable<T: IsA<Widget>>(&self, item: &T, detachable: bool);
581 
582     #[doc(hidden)]
583     #[doc(alias = "child.menu-label")]
child_menu_label<T: IsA<Widget>>(&self, item: &T) -> Option<glib::GString>584     fn child_menu_label<T: IsA<Widget>>(&self, item: &T) -> Option<glib::GString>;
585 
586     #[doc(hidden)]
587     #[doc(alias = "child.menu-label")]
set_child_menu_label<T: IsA<Widget>>(&self, item: &T, menu_label: Option<&str>)588     fn set_child_menu_label<T: IsA<Widget>>(&self, item: &T, menu_label: Option<&str>);
589 
590     #[doc(hidden)]
child_position<T: IsA<Widget>>(&self, item: &T) -> i32591     fn child_position<T: IsA<Widget>>(&self, item: &T) -> i32;
592 
593     #[doc(hidden)]
set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32)594     fn set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32);
595 
596     #[doc(hidden)]
child_is_reorderable<T: IsA<Widget>>(&self, item: &T) -> bool597     fn child_is_reorderable<T: IsA<Widget>>(&self, item: &T) -> bool;
598 
599     #[doc(hidden)]
set_child_reorderable<T: IsA<Widget>>(&self, item: &T, reorderable: bool)600     fn set_child_reorderable<T: IsA<Widget>>(&self, item: &T, reorderable: bool);
601 
602     #[doc(hidden)]
603     #[doc(alias = "child.tab-expand")]
child_tab_expands<T: IsA<Widget>>(&self, item: &T) -> bool604     fn child_tab_expands<T: IsA<Widget>>(&self, item: &T) -> bool;
605 
606     #[doc(hidden)]
607     #[doc(alias = "child.tab-expand")]
set_child_tab_expand<T: IsA<Widget>>(&self, item: &T, tab_expand: bool)608     fn set_child_tab_expand<T: IsA<Widget>>(&self, item: &T, tab_expand: bool);
609 
610     #[doc(hidden)]
611     #[doc(alias = "child.tab-fill")]
child_tab_fills<T: IsA<Widget>>(&self, item: &T) -> bool612     fn child_tab_fills<T: IsA<Widget>>(&self, item: &T) -> bool;
613 
614     #[doc(hidden)]
615     #[doc(alias = "child.tab-fill")]
set_child_tab_fill<T: IsA<Widget>>(&self, item: &T, tab_fill: bool)616     fn set_child_tab_fill<T: IsA<Widget>>(&self, item: &T, tab_fill: bool);
617 
618     #[doc(hidden)]
619     #[doc(alias = "child.tab-label")]
child_tab_label<T: IsA<Widget>>(&self, item: &T) -> Option<glib::GString>620     fn child_tab_label<T: IsA<Widget>>(&self, item: &T) -> Option<glib::GString>;
621 
622     #[doc(hidden)]
623     #[doc(alias = "child.tab-label")]
set_child_tab_label<T: IsA<Widget>>(&self, item: &T, tab_label: Option<&str>)624     fn set_child_tab_label<T: IsA<Widget>>(&self, item: &T, tab_label: Option<&str>);
625 
626     #[doc(alias = "change-current-page")]
connect_change_current_page<F: Fn(&Self, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId627     fn connect_change_current_page<F: Fn(&Self, i32) -> bool + 'static>(
628         &self,
629         f: F,
630     ) -> SignalHandlerId;
631 
emit_change_current_page(&self, object: i32) -> bool632     fn emit_change_current_page(&self, object: i32) -> bool;
633 
634     #[doc(alias = "create-window")]
connect_create_window<F: Fn(&Self, &Widget, i32, i32) -> Notebook + 'static>( &self, f: F, ) -> SignalHandlerId635     fn connect_create_window<F: Fn(&Self, &Widget, i32, i32) -> Notebook + 'static>(
636         &self,
637         f: F,
638     ) -> SignalHandlerId;
639 
640     #[doc(alias = "focus-tab")]
connect_focus_tab<F: Fn(&Self, NotebookTab) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId641     fn connect_focus_tab<F: Fn(&Self, NotebookTab) -> bool + 'static>(
642         &self,
643         f: F,
644     ) -> SignalHandlerId;
645 
emit_focus_tab(&self, object: NotebookTab) -> bool646     fn emit_focus_tab(&self, object: NotebookTab) -> bool;
647 
648     #[doc(alias = "move-focus-out")]
connect_move_focus_out<F: Fn(&Self, DirectionType) + 'static>( &self, f: F, ) -> SignalHandlerId649     fn connect_move_focus_out<F: Fn(&Self, DirectionType) + 'static>(
650         &self,
651         f: F,
652     ) -> SignalHandlerId;
653 
emit_move_focus_out(&self, object: DirectionType)654     fn emit_move_focus_out(&self, object: DirectionType);
655 
656     #[doc(alias = "page-added")]
connect_page_added<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F) -> SignalHandlerId657     fn connect_page_added<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F) -> SignalHandlerId;
658 
659     #[doc(alias = "page-removed")]
connect_page_removed<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F) -> SignalHandlerId660     fn connect_page_removed<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F) -> SignalHandlerId;
661 
662     #[doc(alias = "page-reordered")]
connect_page_reordered<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F) -> SignalHandlerId663     fn connect_page_reordered<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F)
664         -> SignalHandlerId;
665 
666     #[doc(alias = "reorder-tab")]
connect_reorder_tab<F: Fn(&Self, DirectionType, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId667     fn connect_reorder_tab<F: Fn(&Self, DirectionType, bool) -> bool + 'static>(
668         &self,
669         f: F,
670     ) -> SignalHandlerId;
671 
emit_reorder_tab(&self, object: DirectionType, p0: bool) -> bool672     fn emit_reorder_tab(&self, object: DirectionType, p0: bool) -> bool;
673 
674     #[doc(alias = "select-page")]
connect_select_page<F: Fn(&Self, bool) -> bool + 'static>(&self, f: F) -> SignalHandlerId675     fn connect_select_page<F: Fn(&Self, bool) -> bool + 'static>(&self, f: F) -> SignalHandlerId;
676 
emit_select_page(&self, object: bool) -> bool677     fn emit_select_page(&self, object: bool) -> bool;
678 
679     #[doc(alias = "switch-page")]
connect_switch_page<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F) -> SignalHandlerId680     fn connect_switch_page<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F) -> SignalHandlerId;
681 
682     #[doc(alias = "enable-popup")]
connect_enable_popup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId683     fn connect_enable_popup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
684 
685     #[doc(alias = "group-name")]
connect_group_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId686     fn connect_group_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
687 
688     #[doc(alias = "page")]
connect_page_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId689     fn connect_page_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
690 
691     #[doc(alias = "scrollable")]
connect_scrollable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId692     fn connect_scrollable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
693 
694     #[doc(alias = "show-border")]
connect_show_border_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId695     fn connect_show_border_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
696 
697     #[doc(alias = "show-tabs")]
connect_show_tabs_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId698     fn connect_show_tabs_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
699 
700     #[doc(alias = "tab-pos")]
connect_tab_pos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId701     fn connect_tab_pos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
702 }
703 
704 impl<O: IsA<Notebook>> NotebookExt for O {
detach_tab<P: IsA<Widget>>(&self, child: &P)705     fn detach_tab<P: IsA<Widget>>(&self, child: &P) {
706         unsafe {
707             ffi::gtk_notebook_detach_tab(
708                 self.as_ref().to_glib_none().0,
709                 child.as_ref().to_glib_none().0,
710             );
711         }
712     }
713 
action_widget(&self, pack_type: PackType) -> Option<Widget>714     fn action_widget(&self, pack_type: PackType) -> Option<Widget> {
715         unsafe {
716             from_glib_none(ffi::gtk_notebook_get_action_widget(
717                 self.as_ref().to_glib_none().0,
718                 pack_type.into_glib(),
719             ))
720         }
721     }
722 
group_name(&self) -> Option<glib::GString>723     fn group_name(&self) -> Option<glib::GString> {
724         unsafe {
725             from_glib_none(ffi::gtk_notebook_get_group_name(
726                 self.as_ref().to_glib_none().0,
727             ))
728         }
729     }
730 
menu_label<P: IsA<Widget>>(&self, child: &P) -> Option<Widget>731     fn menu_label<P: IsA<Widget>>(&self, child: &P) -> Option<Widget> {
732         unsafe {
733             from_glib_none(ffi::gtk_notebook_get_menu_label(
734                 self.as_ref().to_glib_none().0,
735                 child.as_ref().to_glib_none().0,
736             ))
737         }
738     }
739 
menu_label_text<P: IsA<Widget>>(&self, child: &P) -> Option<glib::GString>740     fn menu_label_text<P: IsA<Widget>>(&self, child: &P) -> Option<glib::GString> {
741         unsafe {
742             from_glib_none(ffi::gtk_notebook_get_menu_label_text(
743                 self.as_ref().to_glib_none().0,
744                 child.as_ref().to_glib_none().0,
745             ))
746         }
747     }
748 
is_scrollable(&self) -> bool749     fn is_scrollable(&self) -> bool {
750         unsafe {
751             from_glib(ffi::gtk_notebook_get_scrollable(
752                 self.as_ref().to_glib_none().0,
753             ))
754         }
755     }
756 
shows_border(&self) -> bool757     fn shows_border(&self) -> bool {
758         unsafe {
759             from_glib(ffi::gtk_notebook_get_show_border(
760                 self.as_ref().to_glib_none().0,
761             ))
762         }
763     }
764 
shows_tabs(&self) -> bool765     fn shows_tabs(&self) -> bool {
766         unsafe {
767             from_glib(ffi::gtk_notebook_get_show_tabs(
768                 self.as_ref().to_glib_none().0,
769             ))
770         }
771     }
772 
tab_is_detachable<P: IsA<Widget>>(&self, child: &P) -> bool773     fn tab_is_detachable<P: IsA<Widget>>(&self, child: &P) -> bool {
774         unsafe {
775             from_glib(ffi::gtk_notebook_get_tab_detachable(
776                 self.as_ref().to_glib_none().0,
777                 child.as_ref().to_glib_none().0,
778             ))
779         }
780     }
781 
tab_label<P: IsA<Widget>>(&self, child: &P) -> Option<Widget>782     fn tab_label<P: IsA<Widget>>(&self, child: &P) -> Option<Widget> {
783         unsafe {
784             from_glib_none(ffi::gtk_notebook_get_tab_label(
785                 self.as_ref().to_glib_none().0,
786                 child.as_ref().to_glib_none().0,
787             ))
788         }
789     }
790 
tab_label_text<P: IsA<Widget>>(&self, child: &P) -> Option<glib::GString>791     fn tab_label_text<P: IsA<Widget>>(&self, child: &P) -> Option<glib::GString> {
792         unsafe {
793             from_glib_none(ffi::gtk_notebook_get_tab_label_text(
794                 self.as_ref().to_glib_none().0,
795                 child.as_ref().to_glib_none().0,
796             ))
797         }
798     }
799 
tab_pos(&self) -> PositionType800     fn tab_pos(&self) -> PositionType {
801         unsafe {
802             from_glib(ffi::gtk_notebook_get_tab_pos(
803                 self.as_ref().to_glib_none().0,
804             ))
805         }
806     }
807 
tab_is_reorderable<P: IsA<Widget>>(&self, child: &P) -> bool808     fn tab_is_reorderable<P: IsA<Widget>>(&self, child: &P) -> bool {
809         unsafe {
810             from_glib(ffi::gtk_notebook_get_tab_reorderable(
811                 self.as_ref().to_glib_none().0,
812                 child.as_ref().to_glib_none().0,
813             ))
814         }
815     }
816 
next_page(&self)817     fn next_page(&self) {
818         unsafe {
819             ffi::gtk_notebook_next_page(self.as_ref().to_glib_none().0);
820         }
821     }
822 
popup_disable(&self)823     fn popup_disable(&self) {
824         unsafe {
825             ffi::gtk_notebook_popup_disable(self.as_ref().to_glib_none().0);
826         }
827     }
828 
popup_enable(&self)829     fn popup_enable(&self) {
830         unsafe {
831             ffi::gtk_notebook_popup_enable(self.as_ref().to_glib_none().0);
832         }
833     }
834 
prev_page(&self)835     fn prev_page(&self) {
836         unsafe {
837             ffi::gtk_notebook_prev_page(self.as_ref().to_glib_none().0);
838         }
839     }
840 
set_action_widget<P: IsA<Widget>>(&self, widget: &P, pack_type: PackType)841     fn set_action_widget<P: IsA<Widget>>(&self, widget: &P, pack_type: PackType) {
842         unsafe {
843             ffi::gtk_notebook_set_action_widget(
844                 self.as_ref().to_glib_none().0,
845                 widget.as_ref().to_glib_none().0,
846                 pack_type.into_glib(),
847             );
848         }
849     }
850 
set_group_name(&self, group_name: Option<&str>)851     fn set_group_name(&self, group_name: Option<&str>) {
852         unsafe {
853             ffi::gtk_notebook_set_group_name(
854                 self.as_ref().to_glib_none().0,
855                 group_name.to_glib_none().0,
856             );
857         }
858     }
859 
set_menu_label<P: IsA<Widget>, Q: IsA<Widget>>(&self, child: &P, menu_label: Option<&Q>)860     fn set_menu_label<P: IsA<Widget>, Q: IsA<Widget>>(&self, child: &P, menu_label: Option<&Q>) {
861         unsafe {
862             ffi::gtk_notebook_set_menu_label(
863                 self.as_ref().to_glib_none().0,
864                 child.as_ref().to_glib_none().0,
865                 menu_label.map(|p| p.as_ref()).to_glib_none().0,
866             );
867         }
868     }
869 
set_menu_label_text<P: IsA<Widget>>(&self, child: &P, menu_text: &str)870     fn set_menu_label_text<P: IsA<Widget>>(&self, child: &P, menu_text: &str) {
871         unsafe {
872             ffi::gtk_notebook_set_menu_label_text(
873                 self.as_ref().to_glib_none().0,
874                 child.as_ref().to_glib_none().0,
875                 menu_text.to_glib_none().0,
876             );
877         }
878     }
879 
set_scrollable(&self, scrollable: bool)880     fn set_scrollable(&self, scrollable: bool) {
881         unsafe {
882             ffi::gtk_notebook_set_scrollable(
883                 self.as_ref().to_glib_none().0,
884                 scrollable.into_glib(),
885             );
886         }
887     }
888 
set_show_border(&self, show_border: bool)889     fn set_show_border(&self, show_border: bool) {
890         unsafe {
891             ffi::gtk_notebook_set_show_border(
892                 self.as_ref().to_glib_none().0,
893                 show_border.into_glib(),
894             );
895         }
896     }
897 
set_show_tabs(&self, show_tabs: bool)898     fn set_show_tabs(&self, show_tabs: bool) {
899         unsafe {
900             ffi::gtk_notebook_set_show_tabs(self.as_ref().to_glib_none().0, show_tabs.into_glib());
901         }
902     }
903 
set_tab_detachable<P: IsA<Widget>>(&self, child: &P, detachable: bool)904     fn set_tab_detachable<P: IsA<Widget>>(&self, child: &P, detachable: bool) {
905         unsafe {
906             ffi::gtk_notebook_set_tab_detachable(
907                 self.as_ref().to_glib_none().0,
908                 child.as_ref().to_glib_none().0,
909                 detachable.into_glib(),
910             );
911         }
912     }
913 
set_tab_label<P: IsA<Widget>, Q: IsA<Widget>>(&self, child: &P, tab_label: Option<&Q>)914     fn set_tab_label<P: IsA<Widget>, Q: IsA<Widget>>(&self, child: &P, tab_label: Option<&Q>) {
915         unsafe {
916             ffi::gtk_notebook_set_tab_label(
917                 self.as_ref().to_glib_none().0,
918                 child.as_ref().to_glib_none().0,
919                 tab_label.map(|p| p.as_ref()).to_glib_none().0,
920             );
921         }
922     }
923 
set_tab_label_text<P: IsA<Widget>>(&self, child: &P, tab_text: &str)924     fn set_tab_label_text<P: IsA<Widget>>(&self, child: &P, tab_text: &str) {
925         unsafe {
926             ffi::gtk_notebook_set_tab_label_text(
927                 self.as_ref().to_glib_none().0,
928                 child.as_ref().to_glib_none().0,
929                 tab_text.to_glib_none().0,
930             );
931         }
932     }
933 
set_tab_pos(&self, pos: PositionType)934     fn set_tab_pos(&self, pos: PositionType) {
935         unsafe {
936             ffi::gtk_notebook_set_tab_pos(self.as_ref().to_glib_none().0, pos.into_glib());
937         }
938     }
939 
set_tab_reorderable<P: IsA<Widget>>(&self, child: &P, reorderable: bool)940     fn set_tab_reorderable<P: IsA<Widget>>(&self, child: &P, reorderable: bool) {
941         unsafe {
942             ffi::gtk_notebook_set_tab_reorderable(
943                 self.as_ref().to_glib_none().0,
944                 child.as_ref().to_glib_none().0,
945                 reorderable.into_glib(),
946             );
947         }
948     }
949 
enables_popup(&self) -> bool950     fn enables_popup(&self) -> bool {
951         unsafe {
952             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
953             glib::gobject_ffi::g_object_get_property(
954                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
955                 b"enable-popup\0".as_ptr() as *const _,
956                 value.to_glib_none_mut().0,
957             );
958             value
959                 .get()
960                 .expect("Return Value for property `enable-popup` getter")
961         }
962     }
963 
set_enable_popup(&self, enable_popup: bool)964     fn set_enable_popup(&self, enable_popup: bool) {
965         unsafe {
966             glib::gobject_ffi::g_object_set_property(
967                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
968                 b"enable-popup\0".as_ptr() as *const _,
969                 enable_popup.to_value().to_glib_none().0,
970             );
971         }
972     }
973 
page(&self) -> i32974     fn page(&self) -> i32 {
975         unsafe {
976             let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
977             glib::gobject_ffi::g_object_get_property(
978                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
979                 b"page\0".as_ptr() as *const _,
980                 value.to_glib_none_mut().0,
981             );
982             value
983                 .get()
984                 .expect("Return Value for property `page` getter")
985         }
986     }
987 
set_page(&self, page: i32)988     fn set_page(&self, page: i32) {
989         unsafe {
990             glib::gobject_ffi::g_object_set_property(
991                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
992                 b"page\0".as_ptr() as *const _,
993                 page.to_value().to_glib_none().0,
994             );
995         }
996     }
997 
998     #[doc(hidden)]
child_is_detachable<T: IsA<Widget>>(&self, item: &T) -> bool999     fn child_is_detachable<T: IsA<Widget>>(&self, item: &T) -> bool {
1000         unsafe {
1001             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
1002             crate::ffi::gtk_container_child_get_property(
1003                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1004                 item.to_glib_none().0 as *mut _,
1005                 b"detachable\0".as_ptr() as *const _,
1006                 value.to_glib_none_mut().0,
1007             );
1008             value
1009                 .get()
1010                 .expect("Return Value for property `detachable` getter")
1011         }
1012     }
1013 
1014     #[doc(hidden)]
set_child_detachable<T: IsA<Widget>>(&self, item: &T, detachable: bool)1015     fn set_child_detachable<T: IsA<Widget>>(&self, item: &T, detachable: bool) {
1016         unsafe {
1017             crate::ffi::gtk_container_child_set_property(
1018                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1019                 item.to_glib_none().0 as *mut _,
1020                 b"detachable\0".as_ptr() as *const _,
1021                 detachable.to_value().to_glib_none().0,
1022             );
1023         }
1024     }
1025 
1026     #[doc(hidden)]
child_menu_label<T: IsA<Widget>>(&self, item: &T) -> Option<glib::GString>1027     fn child_menu_label<T: IsA<Widget>>(&self, item: &T) -> Option<glib::GString> {
1028         unsafe {
1029             let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
1030             crate::ffi::gtk_container_child_get_property(
1031                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1032                 item.to_glib_none().0 as *mut _,
1033                 b"menu-label\0".as_ptr() as *const _,
1034                 value.to_glib_none_mut().0,
1035             );
1036             value
1037                 .get()
1038                 .expect("Return Value for property `menu-label` getter")
1039         }
1040     }
1041 
1042     #[doc(hidden)]
set_child_menu_label<T: IsA<Widget>>(&self, item: &T, menu_label: Option<&str>)1043     fn set_child_menu_label<T: IsA<Widget>>(&self, item: &T, menu_label: Option<&str>) {
1044         unsafe {
1045             crate::ffi::gtk_container_child_set_property(
1046                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1047                 item.to_glib_none().0 as *mut _,
1048                 b"menu-label\0".as_ptr() as *const _,
1049                 menu_label.to_value().to_glib_none().0,
1050             );
1051         }
1052     }
1053 
1054     #[doc(hidden)]
child_position<T: IsA<Widget>>(&self, item: &T) -> i321055     fn child_position<T: IsA<Widget>>(&self, item: &T) -> i32 {
1056         unsafe {
1057             let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
1058             crate::ffi::gtk_container_child_get_property(
1059                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1060                 item.to_glib_none().0 as *mut _,
1061                 b"position\0".as_ptr() as *const _,
1062                 value.to_glib_none_mut().0,
1063             );
1064             value
1065                 .get()
1066                 .expect("Return Value for property `position` getter")
1067         }
1068     }
1069 
1070     #[doc(hidden)]
set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32)1071     fn set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32) {
1072         unsafe {
1073             crate::ffi::gtk_container_child_set_property(
1074                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1075                 item.to_glib_none().0 as *mut _,
1076                 b"position\0".as_ptr() as *const _,
1077                 position.to_value().to_glib_none().0,
1078             );
1079         }
1080     }
1081 
1082     #[doc(hidden)]
child_is_reorderable<T: IsA<Widget>>(&self, item: &T) -> bool1083     fn child_is_reorderable<T: IsA<Widget>>(&self, item: &T) -> bool {
1084         unsafe {
1085             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
1086             crate::ffi::gtk_container_child_get_property(
1087                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1088                 item.to_glib_none().0 as *mut _,
1089                 b"reorderable\0".as_ptr() as *const _,
1090                 value.to_glib_none_mut().0,
1091             );
1092             value
1093                 .get()
1094                 .expect("Return Value for property `reorderable` getter")
1095         }
1096     }
1097 
1098     #[doc(hidden)]
set_child_reorderable<T: IsA<Widget>>(&self, item: &T, reorderable: bool)1099     fn set_child_reorderable<T: IsA<Widget>>(&self, item: &T, reorderable: bool) {
1100         unsafe {
1101             crate::ffi::gtk_container_child_set_property(
1102                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1103                 item.to_glib_none().0 as *mut _,
1104                 b"reorderable\0".as_ptr() as *const _,
1105                 reorderable.to_value().to_glib_none().0,
1106             );
1107         }
1108     }
1109 
1110     #[doc(hidden)]
child_tab_expands<T: IsA<Widget>>(&self, item: &T) -> bool1111     fn child_tab_expands<T: IsA<Widget>>(&self, item: &T) -> bool {
1112         unsafe {
1113             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
1114             crate::ffi::gtk_container_child_get_property(
1115                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1116                 item.to_glib_none().0 as *mut _,
1117                 b"tab-expand\0".as_ptr() as *const _,
1118                 value.to_glib_none_mut().0,
1119             );
1120             value
1121                 .get()
1122                 .expect("Return Value for property `tab-expand` getter")
1123         }
1124     }
1125 
1126     #[doc(hidden)]
set_child_tab_expand<T: IsA<Widget>>(&self, item: &T, tab_expand: bool)1127     fn set_child_tab_expand<T: IsA<Widget>>(&self, item: &T, tab_expand: bool) {
1128         unsafe {
1129             crate::ffi::gtk_container_child_set_property(
1130                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1131                 item.to_glib_none().0 as *mut _,
1132                 b"tab-expand\0".as_ptr() as *const _,
1133                 tab_expand.to_value().to_glib_none().0,
1134             );
1135         }
1136     }
1137 
1138     #[doc(hidden)]
child_tab_fills<T: IsA<Widget>>(&self, item: &T) -> bool1139     fn child_tab_fills<T: IsA<Widget>>(&self, item: &T) -> bool {
1140         unsafe {
1141             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
1142             crate::ffi::gtk_container_child_get_property(
1143                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1144                 item.to_glib_none().0 as *mut _,
1145                 b"tab-fill\0".as_ptr() as *const _,
1146                 value.to_glib_none_mut().0,
1147             );
1148             value
1149                 .get()
1150                 .expect("Return Value for property `tab-fill` getter")
1151         }
1152     }
1153 
1154     #[doc(hidden)]
set_child_tab_fill<T: IsA<Widget>>(&self, item: &T, tab_fill: bool)1155     fn set_child_tab_fill<T: IsA<Widget>>(&self, item: &T, tab_fill: bool) {
1156         unsafe {
1157             crate::ffi::gtk_container_child_set_property(
1158                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1159                 item.to_glib_none().0 as *mut _,
1160                 b"tab-fill\0".as_ptr() as *const _,
1161                 tab_fill.to_value().to_glib_none().0,
1162             );
1163         }
1164     }
1165 
1166     #[doc(hidden)]
child_tab_label<T: IsA<Widget>>(&self, item: &T) -> Option<glib::GString>1167     fn child_tab_label<T: IsA<Widget>>(&self, item: &T) -> Option<glib::GString> {
1168         unsafe {
1169             let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
1170             crate::ffi::gtk_container_child_get_property(
1171                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1172                 item.to_glib_none().0 as *mut _,
1173                 b"tab-label\0".as_ptr() as *const _,
1174                 value.to_glib_none_mut().0,
1175             );
1176             value
1177                 .get()
1178                 .expect("Return Value for property `tab-label` getter")
1179         }
1180     }
1181 
1182     #[doc(hidden)]
set_child_tab_label<T: IsA<Widget>>(&self, item: &T, tab_label: Option<&str>)1183     fn set_child_tab_label<T: IsA<Widget>>(&self, item: &T, tab_label: Option<&str>) {
1184         unsafe {
1185             crate::ffi::gtk_container_child_set_property(
1186                 self.to_glib_none().0 as *mut crate::ffi::GtkContainer,
1187                 item.to_glib_none().0 as *mut _,
1188                 b"tab-label\0".as_ptr() as *const _,
1189                 tab_label.to_value().to_glib_none().0,
1190             );
1191         }
1192     }
1193 
connect_change_current_page<F: Fn(&Self, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId1194     fn connect_change_current_page<F: Fn(&Self, i32) -> bool + 'static>(
1195         &self,
1196         f: F,
1197     ) -> SignalHandlerId {
1198         unsafe extern "C" fn change_current_page_trampoline<
1199             P: IsA<Notebook>,
1200             F: Fn(&P, i32) -> bool + 'static,
1201         >(
1202             this: *mut ffi::GtkNotebook,
1203             object: libc::c_int,
1204             f: glib::ffi::gpointer,
1205         ) -> glib::ffi::gboolean {
1206             let f: &F = &*(f as *const F);
1207             f(Notebook::from_glib_borrow(this).unsafe_cast_ref(), object).into_glib()
1208         }
1209         unsafe {
1210             let f: Box_<F> = Box_::new(f);
1211             connect_raw(
1212                 self.as_ptr() as *mut _,
1213                 b"change-current-page\0".as_ptr() as *const _,
1214                 Some(transmute::<_, unsafe extern "C" fn()>(
1215                     change_current_page_trampoline::<Self, F> as *const (),
1216                 )),
1217                 Box_::into_raw(f),
1218             )
1219         }
1220     }
1221 
emit_change_current_page(&self, object: i32) -> bool1222     fn emit_change_current_page(&self, object: i32) -> bool {
1223         let res = unsafe {
1224             glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
1225                 .emit_by_name("change-current-page", &[&object])
1226                 .unwrap()
1227         };
1228         res.unwrap()
1229             .get()
1230             .expect("Return Value for `emit_change_current_page`")
1231     }
1232 
connect_create_window<F: Fn(&Self, &Widget, i32, i32) -> Notebook + 'static>( &self, f: F, ) -> SignalHandlerId1233     fn connect_create_window<F: Fn(&Self, &Widget, i32, i32) -> Notebook + 'static>(
1234         &self,
1235         f: F,
1236     ) -> SignalHandlerId {
1237         unsafe extern "C" fn create_window_trampoline<
1238             P: IsA<Notebook>,
1239             F: Fn(&P, &Widget, i32, i32) -> Notebook + 'static,
1240         >(
1241             this: *mut ffi::GtkNotebook,
1242             page: *mut ffi::GtkWidget,
1243             x: libc::c_int,
1244             y: libc::c_int,
1245             f: glib::ffi::gpointer,
1246         ) -> *mut ffi::GtkNotebook {
1247             let f: &F = &*(f as *const F);
1248             f(
1249                 Notebook::from_glib_borrow(this).unsafe_cast_ref(),
1250                 &from_glib_borrow(page),
1251                 x,
1252                 y,
1253             ) /*Not checked*/
1254             .to_glib_none()
1255             .0
1256         }
1257         unsafe {
1258             let f: Box_<F> = Box_::new(f);
1259             connect_raw(
1260                 self.as_ptr() as *mut _,
1261                 b"create-window\0".as_ptr() as *const _,
1262                 Some(transmute::<_, unsafe extern "C" fn()>(
1263                     create_window_trampoline::<Self, F> as *const (),
1264                 )),
1265                 Box_::into_raw(f),
1266             )
1267         }
1268     }
1269 
connect_focus_tab<F: Fn(&Self, NotebookTab) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId1270     fn connect_focus_tab<F: Fn(&Self, NotebookTab) -> bool + 'static>(
1271         &self,
1272         f: F,
1273     ) -> SignalHandlerId {
1274         unsafe extern "C" fn focus_tab_trampoline<
1275             P: IsA<Notebook>,
1276             F: Fn(&P, NotebookTab) -> bool + 'static,
1277         >(
1278             this: *mut ffi::GtkNotebook,
1279             object: ffi::GtkNotebookTab,
1280             f: glib::ffi::gpointer,
1281         ) -> glib::ffi::gboolean {
1282             let f: &F = &*(f as *const F);
1283             f(
1284                 Notebook::from_glib_borrow(this).unsafe_cast_ref(),
1285                 from_glib(object),
1286             )
1287             .into_glib()
1288         }
1289         unsafe {
1290             let f: Box_<F> = Box_::new(f);
1291             connect_raw(
1292                 self.as_ptr() as *mut _,
1293                 b"focus-tab\0".as_ptr() as *const _,
1294                 Some(transmute::<_, unsafe extern "C" fn()>(
1295                     focus_tab_trampoline::<Self, F> as *const (),
1296                 )),
1297                 Box_::into_raw(f),
1298             )
1299         }
1300     }
1301 
emit_focus_tab(&self, object: NotebookTab) -> bool1302     fn emit_focus_tab(&self, object: NotebookTab) -> bool {
1303         let res = unsafe {
1304             glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
1305                 .emit_by_name("focus-tab", &[&object])
1306                 .unwrap()
1307         };
1308         res.unwrap()
1309             .get()
1310             .expect("Return Value for `emit_focus_tab`")
1311     }
1312 
connect_move_focus_out<F: Fn(&Self, DirectionType) + 'static>( &self, f: F, ) -> SignalHandlerId1313     fn connect_move_focus_out<F: Fn(&Self, DirectionType) + 'static>(
1314         &self,
1315         f: F,
1316     ) -> SignalHandlerId {
1317         unsafe extern "C" fn move_focus_out_trampoline<
1318             P: IsA<Notebook>,
1319             F: Fn(&P, DirectionType) + 'static,
1320         >(
1321             this: *mut ffi::GtkNotebook,
1322             object: ffi::GtkDirectionType,
1323             f: glib::ffi::gpointer,
1324         ) {
1325             let f: &F = &*(f as *const F);
1326             f(
1327                 Notebook::from_glib_borrow(this).unsafe_cast_ref(),
1328                 from_glib(object),
1329             )
1330         }
1331         unsafe {
1332             let f: Box_<F> = Box_::new(f);
1333             connect_raw(
1334                 self.as_ptr() as *mut _,
1335                 b"move-focus-out\0".as_ptr() as *const _,
1336                 Some(transmute::<_, unsafe extern "C" fn()>(
1337                     move_focus_out_trampoline::<Self, F> as *const (),
1338                 )),
1339                 Box_::into_raw(f),
1340             )
1341         }
1342     }
1343 
emit_move_focus_out(&self, object: DirectionType)1344     fn emit_move_focus_out(&self, object: DirectionType) {
1345         let _ = unsafe {
1346             glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
1347                 .emit_by_name("move-focus-out", &[&object])
1348                 .unwrap()
1349         };
1350     }
1351 
connect_page_added<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F) -> SignalHandlerId1352     fn connect_page_added<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F) -> SignalHandlerId {
1353         unsafe extern "C" fn page_added_trampoline<
1354             P: IsA<Notebook>,
1355             F: Fn(&P, &Widget, u32) + 'static,
1356         >(
1357             this: *mut ffi::GtkNotebook,
1358             child: *mut ffi::GtkWidget,
1359             page_num: libc::c_uint,
1360             f: glib::ffi::gpointer,
1361         ) {
1362             let f: &F = &*(f as *const F);
1363             f(
1364                 Notebook::from_glib_borrow(this).unsafe_cast_ref(),
1365                 &from_glib_borrow(child),
1366                 page_num,
1367             )
1368         }
1369         unsafe {
1370             let f: Box_<F> = Box_::new(f);
1371             connect_raw(
1372                 self.as_ptr() as *mut _,
1373                 b"page-added\0".as_ptr() as *const _,
1374                 Some(transmute::<_, unsafe extern "C" fn()>(
1375                     page_added_trampoline::<Self, F> as *const (),
1376                 )),
1377                 Box_::into_raw(f),
1378             )
1379         }
1380     }
1381 
connect_page_removed<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F) -> SignalHandlerId1382     fn connect_page_removed<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F) -> SignalHandlerId {
1383         unsafe extern "C" fn page_removed_trampoline<
1384             P: IsA<Notebook>,
1385             F: Fn(&P, &Widget, u32) + 'static,
1386         >(
1387             this: *mut ffi::GtkNotebook,
1388             child: *mut ffi::GtkWidget,
1389             page_num: libc::c_uint,
1390             f: glib::ffi::gpointer,
1391         ) {
1392             let f: &F = &*(f as *const F);
1393             f(
1394                 Notebook::from_glib_borrow(this).unsafe_cast_ref(),
1395                 &from_glib_borrow(child),
1396                 page_num,
1397             )
1398         }
1399         unsafe {
1400             let f: Box_<F> = Box_::new(f);
1401             connect_raw(
1402                 self.as_ptr() as *mut _,
1403                 b"page-removed\0".as_ptr() as *const _,
1404                 Some(transmute::<_, unsafe extern "C" fn()>(
1405                     page_removed_trampoline::<Self, F> as *const (),
1406                 )),
1407                 Box_::into_raw(f),
1408             )
1409         }
1410     }
1411 
connect_page_reordered<F: Fn(&Self, &Widget, u32) + 'static>( &self, f: F, ) -> SignalHandlerId1412     fn connect_page_reordered<F: Fn(&Self, &Widget, u32) + 'static>(
1413         &self,
1414         f: F,
1415     ) -> SignalHandlerId {
1416         unsafe extern "C" fn page_reordered_trampoline<
1417             P: IsA<Notebook>,
1418             F: Fn(&P, &Widget, u32) + 'static,
1419         >(
1420             this: *mut ffi::GtkNotebook,
1421             child: *mut ffi::GtkWidget,
1422             page_num: libc::c_uint,
1423             f: glib::ffi::gpointer,
1424         ) {
1425             let f: &F = &*(f as *const F);
1426             f(
1427                 Notebook::from_glib_borrow(this).unsafe_cast_ref(),
1428                 &from_glib_borrow(child),
1429                 page_num,
1430             )
1431         }
1432         unsafe {
1433             let f: Box_<F> = Box_::new(f);
1434             connect_raw(
1435                 self.as_ptr() as *mut _,
1436                 b"page-reordered\0".as_ptr() as *const _,
1437                 Some(transmute::<_, unsafe extern "C" fn()>(
1438                     page_reordered_trampoline::<Self, F> as *const (),
1439                 )),
1440                 Box_::into_raw(f),
1441             )
1442         }
1443     }
1444 
connect_reorder_tab<F: Fn(&Self, DirectionType, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId1445     fn connect_reorder_tab<F: Fn(&Self, DirectionType, bool) -> bool + 'static>(
1446         &self,
1447         f: F,
1448     ) -> SignalHandlerId {
1449         unsafe extern "C" fn reorder_tab_trampoline<
1450             P: IsA<Notebook>,
1451             F: Fn(&P, DirectionType, bool) -> bool + 'static,
1452         >(
1453             this: *mut ffi::GtkNotebook,
1454             object: ffi::GtkDirectionType,
1455             p0: glib::ffi::gboolean,
1456             f: glib::ffi::gpointer,
1457         ) -> glib::ffi::gboolean {
1458             let f: &F = &*(f as *const F);
1459             f(
1460                 Notebook::from_glib_borrow(this).unsafe_cast_ref(),
1461                 from_glib(object),
1462                 from_glib(p0),
1463             )
1464             .into_glib()
1465         }
1466         unsafe {
1467             let f: Box_<F> = Box_::new(f);
1468             connect_raw(
1469                 self.as_ptr() as *mut _,
1470                 b"reorder-tab\0".as_ptr() as *const _,
1471                 Some(transmute::<_, unsafe extern "C" fn()>(
1472                     reorder_tab_trampoline::<Self, F> as *const (),
1473                 )),
1474                 Box_::into_raw(f),
1475             )
1476         }
1477     }
1478 
emit_reorder_tab(&self, object: DirectionType, p0: bool) -> bool1479     fn emit_reorder_tab(&self, object: DirectionType, p0: bool) -> bool {
1480         let res = unsafe {
1481             glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
1482                 .emit_by_name("reorder-tab", &[&object, &p0])
1483                 .unwrap()
1484         };
1485         res.unwrap()
1486             .get()
1487             .expect("Return Value for `emit_reorder_tab`")
1488     }
1489 
connect_select_page<F: Fn(&Self, bool) -> bool + 'static>(&self, f: F) -> SignalHandlerId1490     fn connect_select_page<F: Fn(&Self, bool) -> bool + 'static>(&self, f: F) -> SignalHandlerId {
1491         unsafe extern "C" fn select_page_trampoline<
1492             P: IsA<Notebook>,
1493             F: Fn(&P, bool) -> bool + 'static,
1494         >(
1495             this: *mut ffi::GtkNotebook,
1496             object: glib::ffi::gboolean,
1497             f: glib::ffi::gpointer,
1498         ) -> glib::ffi::gboolean {
1499             let f: &F = &*(f as *const F);
1500             f(
1501                 Notebook::from_glib_borrow(this).unsafe_cast_ref(),
1502                 from_glib(object),
1503             )
1504             .into_glib()
1505         }
1506         unsafe {
1507             let f: Box_<F> = Box_::new(f);
1508             connect_raw(
1509                 self.as_ptr() as *mut _,
1510                 b"select-page\0".as_ptr() as *const _,
1511                 Some(transmute::<_, unsafe extern "C" fn()>(
1512                     select_page_trampoline::<Self, F> as *const (),
1513                 )),
1514                 Box_::into_raw(f),
1515             )
1516         }
1517     }
1518 
emit_select_page(&self, object: bool) -> bool1519     fn emit_select_page(&self, object: bool) -> bool {
1520         let res = unsafe {
1521             glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
1522                 .emit_by_name("select-page", &[&object])
1523                 .unwrap()
1524         };
1525         res.unwrap()
1526             .get()
1527             .expect("Return Value for `emit_select_page`")
1528     }
1529 
connect_switch_page<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F) -> SignalHandlerId1530     fn connect_switch_page<F: Fn(&Self, &Widget, u32) + 'static>(&self, f: F) -> SignalHandlerId {
1531         unsafe extern "C" fn switch_page_trampoline<
1532             P: IsA<Notebook>,
1533             F: Fn(&P, &Widget, u32) + 'static,
1534         >(
1535             this: *mut ffi::GtkNotebook,
1536             page: *mut ffi::GtkWidget,
1537             page_num: libc::c_uint,
1538             f: glib::ffi::gpointer,
1539         ) {
1540             let f: &F = &*(f as *const F);
1541             f(
1542                 Notebook::from_glib_borrow(this).unsafe_cast_ref(),
1543                 &from_glib_borrow(page),
1544                 page_num,
1545             )
1546         }
1547         unsafe {
1548             let f: Box_<F> = Box_::new(f);
1549             connect_raw(
1550                 self.as_ptr() as *mut _,
1551                 b"switch-page\0".as_ptr() as *const _,
1552                 Some(transmute::<_, unsafe extern "C" fn()>(
1553                     switch_page_trampoline::<Self, F> as *const (),
1554                 )),
1555                 Box_::into_raw(f),
1556             )
1557         }
1558     }
1559 
connect_enable_popup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1560     fn connect_enable_popup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1561         unsafe extern "C" fn notify_enable_popup_trampoline<
1562             P: IsA<Notebook>,
1563             F: Fn(&P) + 'static,
1564         >(
1565             this: *mut ffi::GtkNotebook,
1566             _param_spec: glib::ffi::gpointer,
1567             f: glib::ffi::gpointer,
1568         ) {
1569             let f: &F = &*(f as *const F);
1570             f(Notebook::from_glib_borrow(this).unsafe_cast_ref())
1571         }
1572         unsafe {
1573             let f: Box_<F> = Box_::new(f);
1574             connect_raw(
1575                 self.as_ptr() as *mut _,
1576                 b"notify::enable-popup\0".as_ptr() as *const _,
1577                 Some(transmute::<_, unsafe extern "C" fn()>(
1578                     notify_enable_popup_trampoline::<Self, F> as *const (),
1579                 )),
1580                 Box_::into_raw(f),
1581             )
1582         }
1583     }
1584 
connect_group_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1585     fn connect_group_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1586         unsafe extern "C" fn notify_group_name_trampoline<P: IsA<Notebook>, F: Fn(&P) + 'static>(
1587             this: *mut ffi::GtkNotebook,
1588             _param_spec: glib::ffi::gpointer,
1589             f: glib::ffi::gpointer,
1590         ) {
1591             let f: &F = &*(f as *const F);
1592             f(Notebook::from_glib_borrow(this).unsafe_cast_ref())
1593         }
1594         unsafe {
1595             let f: Box_<F> = Box_::new(f);
1596             connect_raw(
1597                 self.as_ptr() as *mut _,
1598                 b"notify::group-name\0".as_ptr() as *const _,
1599                 Some(transmute::<_, unsafe extern "C" fn()>(
1600                     notify_group_name_trampoline::<Self, F> as *const (),
1601                 )),
1602                 Box_::into_raw(f),
1603             )
1604         }
1605     }
1606 
connect_page_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1607     fn connect_page_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1608         unsafe extern "C" fn notify_page_trampoline<P: IsA<Notebook>, F: Fn(&P) + 'static>(
1609             this: *mut ffi::GtkNotebook,
1610             _param_spec: glib::ffi::gpointer,
1611             f: glib::ffi::gpointer,
1612         ) {
1613             let f: &F = &*(f as *const F);
1614             f(Notebook::from_glib_borrow(this).unsafe_cast_ref())
1615         }
1616         unsafe {
1617             let f: Box_<F> = Box_::new(f);
1618             connect_raw(
1619                 self.as_ptr() as *mut _,
1620                 b"notify::page\0".as_ptr() as *const _,
1621                 Some(transmute::<_, unsafe extern "C" fn()>(
1622                     notify_page_trampoline::<Self, F> as *const (),
1623                 )),
1624                 Box_::into_raw(f),
1625             )
1626         }
1627     }
1628 
connect_scrollable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1629     fn connect_scrollable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1630         unsafe extern "C" fn notify_scrollable_trampoline<P: IsA<Notebook>, F: Fn(&P) + 'static>(
1631             this: *mut ffi::GtkNotebook,
1632             _param_spec: glib::ffi::gpointer,
1633             f: glib::ffi::gpointer,
1634         ) {
1635             let f: &F = &*(f as *const F);
1636             f(Notebook::from_glib_borrow(this).unsafe_cast_ref())
1637         }
1638         unsafe {
1639             let f: Box_<F> = Box_::new(f);
1640             connect_raw(
1641                 self.as_ptr() as *mut _,
1642                 b"notify::scrollable\0".as_ptr() as *const _,
1643                 Some(transmute::<_, unsafe extern "C" fn()>(
1644                     notify_scrollable_trampoline::<Self, F> as *const (),
1645                 )),
1646                 Box_::into_raw(f),
1647             )
1648         }
1649     }
1650 
connect_show_border_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1651     fn connect_show_border_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1652         unsafe extern "C" fn notify_show_border_trampoline<
1653             P: IsA<Notebook>,
1654             F: Fn(&P) + 'static,
1655         >(
1656             this: *mut ffi::GtkNotebook,
1657             _param_spec: glib::ffi::gpointer,
1658             f: glib::ffi::gpointer,
1659         ) {
1660             let f: &F = &*(f as *const F);
1661             f(Notebook::from_glib_borrow(this).unsafe_cast_ref())
1662         }
1663         unsafe {
1664             let f: Box_<F> = Box_::new(f);
1665             connect_raw(
1666                 self.as_ptr() as *mut _,
1667                 b"notify::show-border\0".as_ptr() as *const _,
1668                 Some(transmute::<_, unsafe extern "C" fn()>(
1669                     notify_show_border_trampoline::<Self, F> as *const (),
1670                 )),
1671                 Box_::into_raw(f),
1672             )
1673         }
1674     }
1675 
connect_show_tabs_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1676     fn connect_show_tabs_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1677         unsafe extern "C" fn notify_show_tabs_trampoline<P: IsA<Notebook>, F: Fn(&P) + 'static>(
1678             this: *mut ffi::GtkNotebook,
1679             _param_spec: glib::ffi::gpointer,
1680             f: glib::ffi::gpointer,
1681         ) {
1682             let f: &F = &*(f as *const F);
1683             f(Notebook::from_glib_borrow(this).unsafe_cast_ref())
1684         }
1685         unsafe {
1686             let f: Box_<F> = Box_::new(f);
1687             connect_raw(
1688                 self.as_ptr() as *mut _,
1689                 b"notify::show-tabs\0".as_ptr() as *const _,
1690                 Some(transmute::<_, unsafe extern "C" fn()>(
1691                     notify_show_tabs_trampoline::<Self, F> as *const (),
1692                 )),
1693                 Box_::into_raw(f),
1694             )
1695         }
1696     }
1697 
connect_tab_pos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1698     fn connect_tab_pos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1699         unsafe extern "C" fn notify_tab_pos_trampoline<P: IsA<Notebook>, F: Fn(&P) + 'static>(
1700             this: *mut ffi::GtkNotebook,
1701             _param_spec: glib::ffi::gpointer,
1702             f: glib::ffi::gpointer,
1703         ) {
1704             let f: &F = &*(f as *const F);
1705             f(Notebook::from_glib_borrow(this).unsafe_cast_ref())
1706         }
1707         unsafe {
1708             let f: Box_<F> = Box_::new(f);
1709             connect_raw(
1710                 self.as_ptr() as *mut _,
1711                 b"notify::tab-pos\0".as_ptr() as *const _,
1712                 Some(transmute::<_, unsafe extern "C" fn()>(
1713                     notify_tab_pos_trampoline::<Self, F> as *const (),
1714                 )),
1715                 Box_::into_raw(f),
1716             )
1717         }
1718     }
1719 }
1720 
1721 impl fmt::Display for Notebook {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1722     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1723         f.write_str("Notebook")
1724     }
1725 }
1726