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::Adjustment;
6 use crate::Align;
7 use crate::Bin;
8 use crate::Buildable;
9 use crate::Container;
10 use crate::CornerType;
11 use crate::DirectionType;
12 use crate::PolicyType;
13 use crate::PositionType;
14 use crate::ResizeMode;
15 use crate::ScrollType;
16 use crate::ShadowType;
17 use crate::Widget;
18 use glib::object::Cast;
19 use glib::object::IsA;
20 use glib::object::ObjectExt;
21 use glib::signal::connect_raw;
22 use glib::signal::SignalHandlerId;
23 use glib::translate::*;
24 use glib::StaticType;
25 use glib::ToValue;
26 use std::boxed::Box as Box_;
27 use std::fmt;
28 use std::mem;
29 use std::mem::transmute;
30 
31 glib::wrapper! {
32     #[doc(alias = "GtkScrolledWindow")]
33     pub struct ScrolledWindow(Object<ffi::GtkScrolledWindow, ffi::GtkScrolledWindowClass>) @extends Bin, Container, Widget, @implements Buildable;
34 
35     match fn {
36         type_ => || ffi::gtk_scrolled_window_get_type(),
37     }
38 }
39 
40 impl ScrolledWindow {
41     #[doc(alias = "gtk_scrolled_window_new")]
new<P: IsA<Adjustment>, Q: IsA<Adjustment>>( hadjustment: Option<&P>, vadjustment: Option<&Q>, ) -> ScrolledWindow42     pub fn new<P: IsA<Adjustment>, Q: IsA<Adjustment>>(
43         hadjustment: Option<&P>,
44         vadjustment: Option<&Q>,
45     ) -> ScrolledWindow {
46         assert_initialized_main_thread!();
47         unsafe {
48             Widget::from_glib_none(ffi::gtk_scrolled_window_new(
49                 hadjustment.map(|p| p.as_ref()).to_glib_none().0,
50                 vadjustment.map(|p| p.as_ref()).to_glib_none().0,
51             ))
52             .unsafe_cast()
53         }
54     }
55 
56     // rustdoc-stripper-ignore-next
57     /// Creates a new builder-pattern struct instance to construct [`ScrolledWindow`] objects.
58     ///
59     /// This method returns an instance of [`ScrolledWindowBuilder`] which can be used to create [`ScrolledWindow`] objects.
builder() -> ScrolledWindowBuilder60     pub fn builder() -> ScrolledWindowBuilder {
61         ScrolledWindowBuilder::default()
62     }
63 }
64 
65 #[derive(Clone, Default)]
66 // rustdoc-stripper-ignore-next
67 /// A [builder-pattern] type to construct [`ScrolledWindow`] objects.
68 ///
69 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
70 pub struct ScrolledWindowBuilder {
71     hadjustment: Option<Adjustment>,
72     hscrollbar_policy: Option<PolicyType>,
73     kinetic_scrolling: Option<bool>,
74     #[cfg(any(feature = "v3_22", feature = "dox"))]
75     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
76     max_content_height: Option<i32>,
77     #[cfg(any(feature = "v3_22", feature = "dox"))]
78     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
79     max_content_width: Option<i32>,
80     min_content_height: Option<i32>,
81     min_content_width: Option<i32>,
82     overlay_scrolling: Option<bool>,
83     #[cfg(any(feature = "v3_22", feature = "dox"))]
84     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
85     propagate_natural_height: Option<bool>,
86     #[cfg(any(feature = "v3_22", feature = "dox"))]
87     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
88     propagate_natural_width: Option<bool>,
89     shadow_type: Option<ShadowType>,
90     vadjustment: Option<Adjustment>,
91     vscrollbar_policy: Option<PolicyType>,
92     window_placement: Option<CornerType>,
93     border_width: Option<u32>,
94     child: Option<Widget>,
95     resize_mode: Option<ResizeMode>,
96     app_paintable: Option<bool>,
97     can_default: Option<bool>,
98     can_focus: Option<bool>,
99     events: Option<gdk::EventMask>,
100     expand: Option<bool>,
101     #[cfg(any(feature = "v3_20", feature = "dox"))]
102     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
103     focus_on_click: Option<bool>,
104     halign: Option<Align>,
105     has_default: Option<bool>,
106     has_focus: Option<bool>,
107     has_tooltip: Option<bool>,
108     height_request: Option<i32>,
109     hexpand: Option<bool>,
110     hexpand_set: Option<bool>,
111     is_focus: Option<bool>,
112     margin: Option<i32>,
113     margin_bottom: Option<i32>,
114     margin_end: Option<i32>,
115     margin_start: Option<i32>,
116     margin_top: Option<i32>,
117     name: Option<String>,
118     no_show_all: Option<bool>,
119     opacity: Option<f64>,
120     parent: Option<Container>,
121     receives_default: Option<bool>,
122     sensitive: Option<bool>,
123     tooltip_markup: Option<String>,
124     tooltip_text: Option<String>,
125     valign: Option<Align>,
126     vexpand: Option<bool>,
127     vexpand_set: Option<bool>,
128     visible: Option<bool>,
129     width_request: Option<i32>,
130 }
131 
132 impl ScrolledWindowBuilder {
133     // rustdoc-stripper-ignore-next
134     /// Create a new [`ScrolledWindowBuilder`].
new() -> Self135     pub fn new() -> Self {
136         Self::default()
137     }
138 
139     // rustdoc-stripper-ignore-next
140     /// Build the [`ScrolledWindow`].
build(self) -> ScrolledWindow141     pub fn build(self) -> ScrolledWindow {
142         let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
143         if let Some(ref hadjustment) = self.hadjustment {
144             properties.push(("hadjustment", hadjustment));
145         }
146         if let Some(ref hscrollbar_policy) = self.hscrollbar_policy {
147             properties.push(("hscrollbar-policy", hscrollbar_policy));
148         }
149         if let Some(ref kinetic_scrolling) = self.kinetic_scrolling {
150             properties.push(("kinetic-scrolling", kinetic_scrolling));
151         }
152         #[cfg(any(feature = "v3_22", feature = "dox"))]
153         if let Some(ref max_content_height) = self.max_content_height {
154             properties.push(("max-content-height", max_content_height));
155         }
156         #[cfg(any(feature = "v3_22", feature = "dox"))]
157         if let Some(ref max_content_width) = self.max_content_width {
158             properties.push(("max-content-width", max_content_width));
159         }
160         if let Some(ref min_content_height) = self.min_content_height {
161             properties.push(("min-content-height", min_content_height));
162         }
163         if let Some(ref min_content_width) = self.min_content_width {
164             properties.push(("min-content-width", min_content_width));
165         }
166         if let Some(ref overlay_scrolling) = self.overlay_scrolling {
167             properties.push(("overlay-scrolling", overlay_scrolling));
168         }
169         #[cfg(any(feature = "v3_22", feature = "dox"))]
170         if let Some(ref propagate_natural_height) = self.propagate_natural_height {
171             properties.push(("propagate-natural-height", propagate_natural_height));
172         }
173         #[cfg(any(feature = "v3_22", feature = "dox"))]
174         if let Some(ref propagate_natural_width) = self.propagate_natural_width {
175             properties.push(("propagate-natural-width", propagate_natural_width));
176         }
177         if let Some(ref shadow_type) = self.shadow_type {
178             properties.push(("shadow-type", shadow_type));
179         }
180         if let Some(ref vadjustment) = self.vadjustment {
181             properties.push(("vadjustment", vadjustment));
182         }
183         if let Some(ref vscrollbar_policy) = self.vscrollbar_policy {
184             properties.push(("vscrollbar-policy", vscrollbar_policy));
185         }
186         if let Some(ref window_placement) = self.window_placement {
187             properties.push(("window-placement", window_placement));
188         }
189         if let Some(ref border_width) = self.border_width {
190             properties.push(("border-width", border_width));
191         }
192         if let Some(ref child) = self.child {
193             properties.push(("child", child));
194         }
195         if let Some(ref resize_mode) = self.resize_mode {
196             properties.push(("resize-mode", resize_mode));
197         }
198         if let Some(ref app_paintable) = self.app_paintable {
199             properties.push(("app-paintable", app_paintable));
200         }
201         if let Some(ref can_default) = self.can_default {
202             properties.push(("can-default", can_default));
203         }
204         if let Some(ref can_focus) = self.can_focus {
205             properties.push(("can-focus", can_focus));
206         }
207         if let Some(ref events) = self.events {
208             properties.push(("events", events));
209         }
210         if let Some(ref expand) = self.expand {
211             properties.push(("expand", expand));
212         }
213         #[cfg(any(feature = "v3_20", feature = "dox"))]
214         if let Some(ref focus_on_click) = self.focus_on_click {
215             properties.push(("focus-on-click", focus_on_click));
216         }
217         if let Some(ref halign) = self.halign {
218             properties.push(("halign", halign));
219         }
220         if let Some(ref has_default) = self.has_default {
221             properties.push(("has-default", has_default));
222         }
223         if let Some(ref has_focus) = self.has_focus {
224             properties.push(("has-focus", has_focus));
225         }
226         if let Some(ref has_tooltip) = self.has_tooltip {
227             properties.push(("has-tooltip", has_tooltip));
228         }
229         if let Some(ref height_request) = self.height_request {
230             properties.push(("height-request", height_request));
231         }
232         if let Some(ref hexpand) = self.hexpand {
233             properties.push(("hexpand", hexpand));
234         }
235         if let Some(ref hexpand_set) = self.hexpand_set {
236             properties.push(("hexpand-set", hexpand_set));
237         }
238         if let Some(ref is_focus) = self.is_focus {
239             properties.push(("is-focus", is_focus));
240         }
241         if let Some(ref margin) = self.margin {
242             properties.push(("margin", margin));
243         }
244         if let Some(ref margin_bottom) = self.margin_bottom {
245             properties.push(("margin-bottom", margin_bottom));
246         }
247         if let Some(ref margin_end) = self.margin_end {
248             properties.push(("margin-end", margin_end));
249         }
250         if let Some(ref margin_start) = self.margin_start {
251             properties.push(("margin-start", margin_start));
252         }
253         if let Some(ref margin_top) = self.margin_top {
254             properties.push(("margin-top", margin_top));
255         }
256         if let Some(ref name) = self.name {
257             properties.push(("name", name));
258         }
259         if let Some(ref no_show_all) = self.no_show_all {
260             properties.push(("no-show-all", no_show_all));
261         }
262         if let Some(ref opacity) = self.opacity {
263             properties.push(("opacity", opacity));
264         }
265         if let Some(ref parent) = self.parent {
266             properties.push(("parent", parent));
267         }
268         if let Some(ref receives_default) = self.receives_default {
269             properties.push(("receives-default", receives_default));
270         }
271         if let Some(ref sensitive) = self.sensitive {
272             properties.push(("sensitive", sensitive));
273         }
274         if let Some(ref tooltip_markup) = self.tooltip_markup {
275             properties.push(("tooltip-markup", tooltip_markup));
276         }
277         if let Some(ref tooltip_text) = self.tooltip_text {
278             properties.push(("tooltip-text", tooltip_text));
279         }
280         if let Some(ref valign) = self.valign {
281             properties.push(("valign", valign));
282         }
283         if let Some(ref vexpand) = self.vexpand {
284             properties.push(("vexpand", vexpand));
285         }
286         if let Some(ref vexpand_set) = self.vexpand_set {
287             properties.push(("vexpand-set", vexpand_set));
288         }
289         if let Some(ref visible) = self.visible {
290             properties.push(("visible", visible));
291         }
292         if let Some(ref width_request) = self.width_request {
293             properties.push(("width-request", width_request));
294         }
295         glib::Object::new::<ScrolledWindow>(&properties)
296             .expect("Failed to create an instance of ScrolledWindow")
297     }
298 
hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self299     pub fn hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self {
300         self.hadjustment = Some(hadjustment.clone().upcast());
301         self
302     }
303 
hscrollbar_policy(mut self, hscrollbar_policy: PolicyType) -> Self304     pub fn hscrollbar_policy(mut self, hscrollbar_policy: PolicyType) -> Self {
305         self.hscrollbar_policy = Some(hscrollbar_policy);
306         self
307     }
308 
kinetic_scrolling(mut self, kinetic_scrolling: bool) -> Self309     pub fn kinetic_scrolling(mut self, kinetic_scrolling: bool) -> Self {
310         self.kinetic_scrolling = Some(kinetic_scrolling);
311         self
312     }
313 
314     #[cfg(any(feature = "v3_22", feature = "dox"))]
315     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
max_content_height(mut self, max_content_height: i32) -> Self316     pub fn max_content_height(mut self, max_content_height: i32) -> Self {
317         self.max_content_height = Some(max_content_height);
318         self
319     }
320 
321     #[cfg(any(feature = "v3_22", feature = "dox"))]
322     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
max_content_width(mut self, max_content_width: i32) -> Self323     pub fn max_content_width(mut self, max_content_width: i32) -> Self {
324         self.max_content_width = Some(max_content_width);
325         self
326     }
327 
min_content_height(mut self, min_content_height: i32) -> Self328     pub fn min_content_height(mut self, min_content_height: i32) -> Self {
329         self.min_content_height = Some(min_content_height);
330         self
331     }
332 
min_content_width(mut self, min_content_width: i32) -> Self333     pub fn min_content_width(mut self, min_content_width: i32) -> Self {
334         self.min_content_width = Some(min_content_width);
335         self
336     }
337 
overlay_scrolling(mut self, overlay_scrolling: bool) -> Self338     pub fn overlay_scrolling(mut self, overlay_scrolling: bool) -> Self {
339         self.overlay_scrolling = Some(overlay_scrolling);
340         self
341     }
342 
343     #[cfg(any(feature = "v3_22", feature = "dox"))]
344     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
propagate_natural_height(mut self, propagate_natural_height: bool) -> Self345     pub fn propagate_natural_height(mut self, propagate_natural_height: bool) -> Self {
346         self.propagate_natural_height = Some(propagate_natural_height);
347         self
348     }
349 
350     #[cfg(any(feature = "v3_22", feature = "dox"))]
351     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
propagate_natural_width(mut self, propagate_natural_width: bool) -> Self352     pub fn propagate_natural_width(mut self, propagate_natural_width: bool) -> Self {
353         self.propagate_natural_width = Some(propagate_natural_width);
354         self
355     }
356 
shadow_type(mut self, shadow_type: ShadowType) -> Self357     pub fn shadow_type(mut self, shadow_type: ShadowType) -> Self {
358         self.shadow_type = Some(shadow_type);
359         self
360     }
361 
vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self362     pub fn vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self {
363         self.vadjustment = Some(vadjustment.clone().upcast());
364         self
365     }
366 
vscrollbar_policy(mut self, vscrollbar_policy: PolicyType) -> Self367     pub fn vscrollbar_policy(mut self, vscrollbar_policy: PolicyType) -> Self {
368         self.vscrollbar_policy = Some(vscrollbar_policy);
369         self
370     }
371 
window_placement(mut self, window_placement: CornerType) -> Self372     pub fn window_placement(mut self, window_placement: CornerType) -> Self {
373         self.window_placement = Some(window_placement);
374         self
375     }
376 
border_width(mut self, border_width: u32) -> Self377     pub fn border_width(mut self, border_width: u32) -> Self {
378         self.border_width = Some(border_width);
379         self
380     }
381 
child<P: IsA<Widget>>(mut self, child: &P) -> Self382     pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self {
383         self.child = Some(child.clone().upcast());
384         self
385     }
386 
resize_mode(mut self, resize_mode: ResizeMode) -> Self387     pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
388         self.resize_mode = Some(resize_mode);
389         self
390     }
391 
app_paintable(mut self, app_paintable: bool) -> Self392     pub fn app_paintable(mut self, app_paintable: bool) -> Self {
393         self.app_paintable = Some(app_paintable);
394         self
395     }
396 
can_default(mut self, can_default: bool) -> Self397     pub fn can_default(mut self, can_default: bool) -> Self {
398         self.can_default = Some(can_default);
399         self
400     }
401 
can_focus(mut self, can_focus: bool) -> Self402     pub fn can_focus(mut self, can_focus: bool) -> Self {
403         self.can_focus = Some(can_focus);
404         self
405     }
406 
events(mut self, events: gdk::EventMask) -> Self407     pub fn events(mut self, events: gdk::EventMask) -> Self {
408         self.events = Some(events);
409         self
410     }
411 
expand(mut self, expand: bool) -> Self412     pub fn expand(mut self, expand: bool) -> Self {
413         self.expand = Some(expand);
414         self
415     }
416 
417     #[cfg(any(feature = "v3_20", feature = "dox"))]
418     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
focus_on_click(mut self, focus_on_click: bool) -> Self419     pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
420         self.focus_on_click = Some(focus_on_click);
421         self
422     }
423 
halign(mut self, halign: Align) -> Self424     pub fn halign(mut self, halign: Align) -> Self {
425         self.halign = Some(halign);
426         self
427     }
428 
has_default(mut self, has_default: bool) -> Self429     pub fn has_default(mut self, has_default: bool) -> Self {
430         self.has_default = Some(has_default);
431         self
432     }
433 
has_focus(mut self, has_focus: bool) -> Self434     pub fn has_focus(mut self, has_focus: bool) -> Self {
435         self.has_focus = Some(has_focus);
436         self
437     }
438 
has_tooltip(mut self, has_tooltip: bool) -> Self439     pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
440         self.has_tooltip = Some(has_tooltip);
441         self
442     }
443 
height_request(mut self, height_request: i32) -> Self444     pub fn height_request(mut self, height_request: i32) -> Self {
445         self.height_request = Some(height_request);
446         self
447     }
448 
hexpand(mut self, hexpand: bool) -> Self449     pub fn hexpand(mut self, hexpand: bool) -> Self {
450         self.hexpand = Some(hexpand);
451         self
452     }
453 
hexpand_set(mut self, hexpand_set: bool) -> Self454     pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
455         self.hexpand_set = Some(hexpand_set);
456         self
457     }
458 
is_focus(mut self, is_focus: bool) -> Self459     pub fn is_focus(mut self, is_focus: bool) -> Self {
460         self.is_focus = Some(is_focus);
461         self
462     }
463 
margin(mut self, margin: i32) -> Self464     pub fn margin(mut self, margin: i32) -> Self {
465         self.margin = Some(margin);
466         self
467     }
468 
margin_bottom(mut self, margin_bottom: i32) -> Self469     pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
470         self.margin_bottom = Some(margin_bottom);
471         self
472     }
473 
margin_end(mut self, margin_end: i32) -> Self474     pub fn margin_end(mut self, margin_end: i32) -> Self {
475         self.margin_end = Some(margin_end);
476         self
477     }
478 
margin_start(mut self, margin_start: i32) -> Self479     pub fn margin_start(mut self, margin_start: i32) -> Self {
480         self.margin_start = Some(margin_start);
481         self
482     }
483 
margin_top(mut self, margin_top: i32) -> Self484     pub fn margin_top(mut self, margin_top: i32) -> Self {
485         self.margin_top = Some(margin_top);
486         self
487     }
488 
name(mut self, name: &str) -> Self489     pub fn name(mut self, name: &str) -> Self {
490         self.name = Some(name.to_string());
491         self
492     }
493 
no_show_all(mut self, no_show_all: bool) -> Self494     pub fn no_show_all(mut self, no_show_all: bool) -> Self {
495         self.no_show_all = Some(no_show_all);
496         self
497     }
498 
opacity(mut self, opacity: f64) -> Self499     pub fn opacity(mut self, opacity: f64) -> Self {
500         self.opacity = Some(opacity);
501         self
502     }
503 
parent<P: IsA<Container>>(mut self, parent: &P) -> Self504     pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self {
505         self.parent = Some(parent.clone().upcast());
506         self
507     }
508 
receives_default(mut self, receives_default: bool) -> Self509     pub fn receives_default(mut self, receives_default: bool) -> Self {
510         self.receives_default = Some(receives_default);
511         self
512     }
513 
sensitive(mut self, sensitive: bool) -> Self514     pub fn sensitive(mut self, sensitive: bool) -> Self {
515         self.sensitive = Some(sensitive);
516         self
517     }
518 
tooltip_markup(mut self, tooltip_markup: &str) -> Self519     pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
520         self.tooltip_markup = Some(tooltip_markup.to_string());
521         self
522     }
523 
tooltip_text(mut self, tooltip_text: &str) -> Self524     pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
525         self.tooltip_text = Some(tooltip_text.to_string());
526         self
527     }
528 
valign(mut self, valign: Align) -> Self529     pub fn valign(mut self, valign: Align) -> Self {
530         self.valign = Some(valign);
531         self
532     }
533 
vexpand(mut self, vexpand: bool) -> Self534     pub fn vexpand(mut self, vexpand: bool) -> Self {
535         self.vexpand = Some(vexpand);
536         self
537     }
538 
vexpand_set(mut self, vexpand_set: bool) -> Self539     pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
540         self.vexpand_set = Some(vexpand_set);
541         self
542     }
543 
visible(mut self, visible: bool) -> Self544     pub fn visible(mut self, visible: bool) -> Self {
545         self.visible = Some(visible);
546         self
547     }
548 
width_request(mut self, width_request: i32) -> Self549     pub fn width_request(mut self, width_request: i32) -> Self {
550         self.width_request = Some(width_request);
551         self
552     }
553 }
554 
555 pub const NONE_SCROLLED_WINDOW: Option<&ScrolledWindow> = None;
556 
557 pub trait ScrolledWindowExt: 'static {
558     #[doc(alias = "gtk_scrolled_window_get_capture_button_press")]
559     #[doc(alias = "get_capture_button_press")]
is_capture_button_press(&self) -> bool560     fn is_capture_button_press(&self) -> bool;
561 
562     #[doc(alias = "gtk_scrolled_window_get_hadjustment")]
563     #[doc(alias = "get_hadjustment")]
hadjustment(&self) -> Adjustment564     fn hadjustment(&self) -> Adjustment;
565 
566     #[doc(alias = "gtk_scrolled_window_get_hscrollbar")]
567     #[doc(alias = "get_hscrollbar")]
hscrollbar(&self) -> Option<Widget>568     fn hscrollbar(&self) -> Option<Widget>;
569 
570     #[doc(alias = "gtk_scrolled_window_get_kinetic_scrolling")]
571     #[doc(alias = "get_kinetic_scrolling")]
is_kinetic_scrolling(&self) -> bool572     fn is_kinetic_scrolling(&self) -> bool;
573 
574     #[cfg(any(feature = "v3_22", feature = "dox"))]
575     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
576     #[doc(alias = "gtk_scrolled_window_get_max_content_height")]
577     #[doc(alias = "get_max_content_height")]
max_content_height(&self) -> i32578     fn max_content_height(&self) -> i32;
579 
580     #[cfg(any(feature = "v3_22", feature = "dox"))]
581     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
582     #[doc(alias = "gtk_scrolled_window_get_max_content_width")]
583     #[doc(alias = "get_max_content_width")]
max_content_width(&self) -> i32584     fn max_content_width(&self) -> i32;
585 
586     #[doc(alias = "gtk_scrolled_window_get_min_content_height")]
587     #[doc(alias = "get_min_content_height")]
min_content_height(&self) -> i32588     fn min_content_height(&self) -> i32;
589 
590     #[doc(alias = "gtk_scrolled_window_get_min_content_width")]
591     #[doc(alias = "get_min_content_width")]
min_content_width(&self) -> i32592     fn min_content_width(&self) -> i32;
593 
594     #[doc(alias = "gtk_scrolled_window_get_overlay_scrolling")]
595     #[doc(alias = "get_overlay_scrolling")]
is_overlay_scrolling(&self) -> bool596     fn is_overlay_scrolling(&self) -> bool;
597 
598     #[doc(alias = "gtk_scrolled_window_get_placement")]
599     #[doc(alias = "get_placement")]
placement(&self) -> CornerType600     fn placement(&self) -> CornerType;
601 
602     #[doc(alias = "gtk_scrolled_window_get_policy")]
603     #[doc(alias = "get_policy")]
policy(&self) -> (PolicyType, PolicyType)604     fn policy(&self) -> (PolicyType, PolicyType);
605 
606     #[cfg(any(feature = "v3_22", feature = "dox"))]
607     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
608     #[doc(alias = "gtk_scrolled_window_get_propagate_natural_height")]
609     #[doc(alias = "get_propagate_natural_height")]
propagates_natural_height(&self) -> bool610     fn propagates_natural_height(&self) -> bool;
611 
612     #[cfg(any(feature = "v3_22", feature = "dox"))]
613     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
614     #[doc(alias = "gtk_scrolled_window_get_propagate_natural_width")]
615     #[doc(alias = "get_propagate_natural_width")]
propagates_natural_width(&self) -> bool616     fn propagates_natural_width(&self) -> bool;
617 
618     #[doc(alias = "gtk_scrolled_window_get_shadow_type")]
619     #[doc(alias = "get_shadow_type")]
shadow_type(&self) -> ShadowType620     fn shadow_type(&self) -> ShadowType;
621 
622     #[doc(alias = "gtk_scrolled_window_get_vadjustment")]
623     #[doc(alias = "get_vadjustment")]
vadjustment(&self) -> Adjustment624     fn vadjustment(&self) -> Adjustment;
625 
626     #[doc(alias = "gtk_scrolled_window_get_vscrollbar")]
627     #[doc(alias = "get_vscrollbar")]
vscrollbar(&self) -> Option<Widget>628     fn vscrollbar(&self) -> Option<Widget>;
629 
630     #[doc(alias = "gtk_scrolled_window_set_capture_button_press")]
set_capture_button_press(&self, capture_button_press: bool)631     fn set_capture_button_press(&self, capture_button_press: bool);
632 
633     #[doc(alias = "gtk_scrolled_window_set_hadjustment")]
set_hadjustment<P: IsA<Adjustment>>(&self, hadjustment: Option<&P>)634     fn set_hadjustment<P: IsA<Adjustment>>(&self, hadjustment: Option<&P>);
635 
636     #[doc(alias = "gtk_scrolled_window_set_kinetic_scrolling")]
set_kinetic_scrolling(&self, kinetic_scrolling: bool)637     fn set_kinetic_scrolling(&self, kinetic_scrolling: bool);
638 
639     #[cfg(any(feature = "v3_22", feature = "dox"))]
640     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
641     #[doc(alias = "gtk_scrolled_window_set_max_content_height")]
set_max_content_height(&self, height: i32)642     fn set_max_content_height(&self, height: i32);
643 
644     #[cfg(any(feature = "v3_22", feature = "dox"))]
645     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
646     #[doc(alias = "gtk_scrolled_window_set_max_content_width")]
set_max_content_width(&self, width: i32)647     fn set_max_content_width(&self, width: i32);
648 
649     #[doc(alias = "gtk_scrolled_window_set_min_content_height")]
set_min_content_height(&self, height: i32)650     fn set_min_content_height(&self, height: i32);
651 
652     #[doc(alias = "gtk_scrolled_window_set_min_content_width")]
set_min_content_width(&self, width: i32)653     fn set_min_content_width(&self, width: i32);
654 
655     #[doc(alias = "gtk_scrolled_window_set_overlay_scrolling")]
set_overlay_scrolling(&self, overlay_scrolling: bool)656     fn set_overlay_scrolling(&self, overlay_scrolling: bool);
657 
658     #[doc(alias = "gtk_scrolled_window_set_placement")]
set_placement(&self, window_placement: CornerType)659     fn set_placement(&self, window_placement: CornerType);
660 
661     #[doc(alias = "gtk_scrolled_window_set_policy")]
set_policy(&self, hscrollbar_policy: PolicyType, vscrollbar_policy: PolicyType)662     fn set_policy(&self, hscrollbar_policy: PolicyType, vscrollbar_policy: PolicyType);
663 
664     #[cfg(any(feature = "v3_22", feature = "dox"))]
665     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
666     #[doc(alias = "gtk_scrolled_window_set_propagate_natural_height")]
set_propagate_natural_height(&self, propagate: bool)667     fn set_propagate_natural_height(&self, propagate: bool);
668 
669     #[cfg(any(feature = "v3_22", feature = "dox"))]
670     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
671     #[doc(alias = "gtk_scrolled_window_set_propagate_natural_width")]
set_propagate_natural_width(&self, propagate: bool)672     fn set_propagate_natural_width(&self, propagate: bool);
673 
674     #[doc(alias = "gtk_scrolled_window_set_shadow_type")]
set_shadow_type(&self, type_: ShadowType)675     fn set_shadow_type(&self, type_: ShadowType);
676 
677     #[doc(alias = "gtk_scrolled_window_set_vadjustment")]
set_vadjustment<P: IsA<Adjustment>>(&self, vadjustment: Option<&P>)678     fn set_vadjustment<P: IsA<Adjustment>>(&self, vadjustment: Option<&P>);
679 
680     #[doc(alias = "gtk_scrolled_window_unset_placement")]
unset_placement(&self)681     fn unset_placement(&self);
682 
683     #[doc(alias = "hscrollbar-policy")]
hscrollbar_policy(&self) -> PolicyType684     fn hscrollbar_policy(&self) -> PolicyType;
685 
686     #[doc(alias = "hscrollbar-policy")]
set_hscrollbar_policy(&self, hscrollbar_policy: PolicyType)687     fn set_hscrollbar_policy(&self, hscrollbar_policy: PolicyType);
688 
689     #[doc(alias = "vscrollbar-policy")]
vscrollbar_policy(&self) -> PolicyType690     fn vscrollbar_policy(&self) -> PolicyType;
691 
692     #[doc(alias = "vscrollbar-policy")]
set_vscrollbar_policy(&self, vscrollbar_policy: PolicyType)693     fn set_vscrollbar_policy(&self, vscrollbar_policy: PolicyType);
694 
695     #[doc(alias = "window-placement")]
window_placement(&self) -> CornerType696     fn window_placement(&self) -> CornerType;
697 
698     #[doc(alias = "window-placement")]
set_window_placement(&self, window_placement: CornerType)699     fn set_window_placement(&self, window_placement: CornerType);
700 
701     #[doc(alias = "edge-overshot")]
connect_edge_overshot<F: Fn(&Self, PositionType) + 'static>(&self, f: F) -> SignalHandlerId702     fn connect_edge_overshot<F: Fn(&Self, PositionType) + 'static>(&self, f: F) -> SignalHandlerId;
703 
704     #[doc(alias = "edge-reached")]
connect_edge_reached<F: Fn(&Self, PositionType) + 'static>(&self, f: F) -> SignalHandlerId705     fn connect_edge_reached<F: Fn(&Self, PositionType) + 'static>(&self, f: F) -> SignalHandlerId;
706 
707     #[doc(alias = "move-focus-out")]
connect_move_focus_out<F: Fn(&Self, DirectionType) + 'static>( &self, f: F, ) -> SignalHandlerId708     fn connect_move_focus_out<F: Fn(&Self, DirectionType) + 'static>(
709         &self,
710         f: F,
711     ) -> SignalHandlerId;
712 
emit_move_focus_out(&self, direction_type: DirectionType)713     fn emit_move_focus_out(&self, direction_type: DirectionType);
714 
715     #[doc(alias = "scroll-child")]
connect_scroll_child<F: Fn(&Self, ScrollType, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId716     fn connect_scroll_child<F: Fn(&Self, ScrollType, bool) -> bool + 'static>(
717         &self,
718         f: F,
719     ) -> SignalHandlerId;
720 
emit_scroll_child(&self, scroll: ScrollType, horizontal: bool) -> bool721     fn emit_scroll_child(&self, scroll: ScrollType, horizontal: bool) -> bool;
722 
723     #[doc(alias = "hadjustment")]
connect_hadjustment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId724     fn connect_hadjustment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
725 
726     #[doc(alias = "hscrollbar-policy")]
connect_hscrollbar_policy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId727     fn connect_hscrollbar_policy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
728 
729     #[doc(alias = "kinetic-scrolling")]
connect_kinetic_scrolling_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId730     fn connect_kinetic_scrolling_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
731 
732     #[cfg(any(feature = "v3_22", feature = "dox"))]
733     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
734     #[doc(alias = "max-content-height")]
connect_max_content_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId735     fn connect_max_content_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
736 
737     #[cfg(any(feature = "v3_22", feature = "dox"))]
738     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
739     #[doc(alias = "max-content-width")]
connect_max_content_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId740     fn connect_max_content_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
741 
742     #[doc(alias = "min-content-height")]
connect_min_content_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId743     fn connect_min_content_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
744 
745     #[doc(alias = "min-content-width")]
connect_min_content_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId746     fn connect_min_content_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
747 
748     #[doc(alias = "overlay-scrolling")]
connect_overlay_scrolling_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId749     fn connect_overlay_scrolling_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
750 
751     #[cfg(any(feature = "v3_22", feature = "dox"))]
752     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
753     #[doc(alias = "propagate-natural-height")]
connect_propagate_natural_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId754     fn connect_propagate_natural_height_notify<F: Fn(&Self) + 'static>(
755         &self,
756         f: F,
757     ) -> SignalHandlerId;
758 
759     #[cfg(any(feature = "v3_22", feature = "dox"))]
760     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
761     #[doc(alias = "propagate-natural-width")]
connect_propagate_natural_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId762     fn connect_propagate_natural_width_notify<F: Fn(&Self) + 'static>(
763         &self,
764         f: F,
765     ) -> SignalHandlerId;
766 
767     #[doc(alias = "shadow-type")]
connect_shadow_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId768     fn connect_shadow_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
769 
770     #[doc(alias = "vadjustment")]
connect_vadjustment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId771     fn connect_vadjustment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
772 
773     #[doc(alias = "vscrollbar-policy")]
connect_vscrollbar_policy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId774     fn connect_vscrollbar_policy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
775 
776     #[doc(alias = "window-placement")]
connect_window_placement_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId777     fn connect_window_placement_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
778 }
779 
780 impl<O: IsA<ScrolledWindow>> ScrolledWindowExt for O {
is_capture_button_press(&self) -> bool781     fn is_capture_button_press(&self) -> bool {
782         unsafe {
783             from_glib(ffi::gtk_scrolled_window_get_capture_button_press(
784                 self.as_ref().to_glib_none().0,
785             ))
786         }
787     }
788 
hadjustment(&self) -> Adjustment789     fn hadjustment(&self) -> Adjustment {
790         unsafe {
791             from_glib_none(ffi::gtk_scrolled_window_get_hadjustment(
792                 self.as_ref().to_glib_none().0,
793             ))
794         }
795     }
796 
hscrollbar(&self) -> Option<Widget>797     fn hscrollbar(&self) -> Option<Widget> {
798         unsafe {
799             from_glib_none(ffi::gtk_scrolled_window_get_hscrollbar(
800                 self.as_ref().to_glib_none().0,
801             ))
802         }
803     }
804 
is_kinetic_scrolling(&self) -> bool805     fn is_kinetic_scrolling(&self) -> bool {
806         unsafe {
807             from_glib(ffi::gtk_scrolled_window_get_kinetic_scrolling(
808                 self.as_ref().to_glib_none().0,
809             ))
810         }
811     }
812 
813     #[cfg(any(feature = "v3_22", feature = "dox"))]
814     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
max_content_height(&self) -> i32815     fn max_content_height(&self) -> i32 {
816         unsafe { ffi::gtk_scrolled_window_get_max_content_height(self.as_ref().to_glib_none().0) }
817     }
818 
819     #[cfg(any(feature = "v3_22", feature = "dox"))]
820     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
max_content_width(&self) -> i32821     fn max_content_width(&self) -> i32 {
822         unsafe { ffi::gtk_scrolled_window_get_max_content_width(self.as_ref().to_glib_none().0) }
823     }
824 
min_content_height(&self) -> i32825     fn min_content_height(&self) -> i32 {
826         unsafe { ffi::gtk_scrolled_window_get_min_content_height(self.as_ref().to_glib_none().0) }
827     }
828 
min_content_width(&self) -> i32829     fn min_content_width(&self) -> i32 {
830         unsafe { ffi::gtk_scrolled_window_get_min_content_width(self.as_ref().to_glib_none().0) }
831     }
832 
is_overlay_scrolling(&self) -> bool833     fn is_overlay_scrolling(&self) -> bool {
834         unsafe {
835             from_glib(ffi::gtk_scrolled_window_get_overlay_scrolling(
836                 self.as_ref().to_glib_none().0,
837             ))
838         }
839     }
840 
placement(&self) -> CornerType841     fn placement(&self) -> CornerType {
842         unsafe {
843             from_glib(ffi::gtk_scrolled_window_get_placement(
844                 self.as_ref().to_glib_none().0,
845             ))
846         }
847     }
848 
policy(&self) -> (PolicyType, PolicyType)849     fn policy(&self) -> (PolicyType, PolicyType) {
850         unsafe {
851             let mut hscrollbar_policy = mem::MaybeUninit::uninit();
852             let mut vscrollbar_policy = mem::MaybeUninit::uninit();
853             ffi::gtk_scrolled_window_get_policy(
854                 self.as_ref().to_glib_none().0,
855                 hscrollbar_policy.as_mut_ptr(),
856                 vscrollbar_policy.as_mut_ptr(),
857             );
858             let hscrollbar_policy = hscrollbar_policy.assume_init();
859             let vscrollbar_policy = vscrollbar_policy.assume_init();
860             (from_glib(hscrollbar_policy), from_glib(vscrollbar_policy))
861         }
862     }
863 
864     #[cfg(any(feature = "v3_22", feature = "dox"))]
865     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
propagates_natural_height(&self) -> bool866     fn propagates_natural_height(&self) -> bool {
867         unsafe {
868             from_glib(ffi::gtk_scrolled_window_get_propagate_natural_height(
869                 self.as_ref().to_glib_none().0,
870             ))
871         }
872     }
873 
874     #[cfg(any(feature = "v3_22", feature = "dox"))]
875     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
propagates_natural_width(&self) -> bool876     fn propagates_natural_width(&self) -> bool {
877         unsafe {
878             from_glib(ffi::gtk_scrolled_window_get_propagate_natural_width(
879                 self.as_ref().to_glib_none().0,
880             ))
881         }
882     }
883 
shadow_type(&self) -> ShadowType884     fn shadow_type(&self) -> ShadowType {
885         unsafe {
886             from_glib(ffi::gtk_scrolled_window_get_shadow_type(
887                 self.as_ref().to_glib_none().0,
888             ))
889         }
890     }
891 
vadjustment(&self) -> Adjustment892     fn vadjustment(&self) -> Adjustment {
893         unsafe {
894             from_glib_none(ffi::gtk_scrolled_window_get_vadjustment(
895                 self.as_ref().to_glib_none().0,
896             ))
897         }
898     }
899 
vscrollbar(&self) -> Option<Widget>900     fn vscrollbar(&self) -> Option<Widget> {
901         unsafe {
902             from_glib_none(ffi::gtk_scrolled_window_get_vscrollbar(
903                 self.as_ref().to_glib_none().0,
904             ))
905         }
906     }
907 
set_capture_button_press(&self, capture_button_press: bool)908     fn set_capture_button_press(&self, capture_button_press: bool) {
909         unsafe {
910             ffi::gtk_scrolled_window_set_capture_button_press(
911                 self.as_ref().to_glib_none().0,
912                 capture_button_press.into_glib(),
913             );
914         }
915     }
916 
set_hadjustment<P: IsA<Adjustment>>(&self, hadjustment: Option<&P>)917     fn set_hadjustment<P: IsA<Adjustment>>(&self, hadjustment: Option<&P>) {
918         unsafe {
919             ffi::gtk_scrolled_window_set_hadjustment(
920                 self.as_ref().to_glib_none().0,
921                 hadjustment.map(|p| p.as_ref()).to_glib_none().0,
922             );
923         }
924     }
925 
set_kinetic_scrolling(&self, kinetic_scrolling: bool)926     fn set_kinetic_scrolling(&self, kinetic_scrolling: bool) {
927         unsafe {
928             ffi::gtk_scrolled_window_set_kinetic_scrolling(
929                 self.as_ref().to_glib_none().0,
930                 kinetic_scrolling.into_glib(),
931             );
932         }
933     }
934 
935     #[cfg(any(feature = "v3_22", feature = "dox"))]
936     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
set_max_content_height(&self, height: i32)937     fn set_max_content_height(&self, height: i32) {
938         unsafe {
939             ffi::gtk_scrolled_window_set_max_content_height(self.as_ref().to_glib_none().0, height);
940         }
941     }
942 
943     #[cfg(any(feature = "v3_22", feature = "dox"))]
944     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
set_max_content_width(&self, width: i32)945     fn set_max_content_width(&self, width: i32) {
946         unsafe {
947             ffi::gtk_scrolled_window_set_max_content_width(self.as_ref().to_glib_none().0, width);
948         }
949     }
950 
set_min_content_height(&self, height: i32)951     fn set_min_content_height(&self, height: i32) {
952         unsafe {
953             ffi::gtk_scrolled_window_set_min_content_height(self.as_ref().to_glib_none().0, height);
954         }
955     }
956 
set_min_content_width(&self, width: i32)957     fn set_min_content_width(&self, width: i32) {
958         unsafe {
959             ffi::gtk_scrolled_window_set_min_content_width(self.as_ref().to_glib_none().0, width);
960         }
961     }
962 
set_overlay_scrolling(&self, overlay_scrolling: bool)963     fn set_overlay_scrolling(&self, overlay_scrolling: bool) {
964         unsafe {
965             ffi::gtk_scrolled_window_set_overlay_scrolling(
966                 self.as_ref().to_glib_none().0,
967                 overlay_scrolling.into_glib(),
968             );
969         }
970     }
971 
set_placement(&self, window_placement: CornerType)972     fn set_placement(&self, window_placement: CornerType) {
973         unsafe {
974             ffi::gtk_scrolled_window_set_placement(
975                 self.as_ref().to_glib_none().0,
976                 window_placement.into_glib(),
977             );
978         }
979     }
980 
set_policy(&self, hscrollbar_policy: PolicyType, vscrollbar_policy: PolicyType)981     fn set_policy(&self, hscrollbar_policy: PolicyType, vscrollbar_policy: PolicyType) {
982         unsafe {
983             ffi::gtk_scrolled_window_set_policy(
984                 self.as_ref().to_glib_none().0,
985                 hscrollbar_policy.into_glib(),
986                 vscrollbar_policy.into_glib(),
987             );
988         }
989     }
990 
991     #[cfg(any(feature = "v3_22", feature = "dox"))]
992     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
set_propagate_natural_height(&self, propagate: bool)993     fn set_propagate_natural_height(&self, propagate: bool) {
994         unsafe {
995             ffi::gtk_scrolled_window_set_propagate_natural_height(
996                 self.as_ref().to_glib_none().0,
997                 propagate.into_glib(),
998             );
999         }
1000     }
1001 
1002     #[cfg(any(feature = "v3_22", feature = "dox"))]
1003     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
set_propagate_natural_width(&self, propagate: bool)1004     fn set_propagate_natural_width(&self, propagate: bool) {
1005         unsafe {
1006             ffi::gtk_scrolled_window_set_propagate_natural_width(
1007                 self.as_ref().to_glib_none().0,
1008                 propagate.into_glib(),
1009             );
1010         }
1011     }
1012 
set_shadow_type(&self, type_: ShadowType)1013     fn set_shadow_type(&self, type_: ShadowType) {
1014         unsafe {
1015             ffi::gtk_scrolled_window_set_shadow_type(
1016                 self.as_ref().to_glib_none().0,
1017                 type_.into_glib(),
1018             );
1019         }
1020     }
1021 
set_vadjustment<P: IsA<Adjustment>>(&self, vadjustment: Option<&P>)1022     fn set_vadjustment<P: IsA<Adjustment>>(&self, vadjustment: Option<&P>) {
1023         unsafe {
1024             ffi::gtk_scrolled_window_set_vadjustment(
1025                 self.as_ref().to_glib_none().0,
1026                 vadjustment.map(|p| p.as_ref()).to_glib_none().0,
1027             );
1028         }
1029     }
1030 
unset_placement(&self)1031     fn unset_placement(&self) {
1032         unsafe {
1033             ffi::gtk_scrolled_window_unset_placement(self.as_ref().to_glib_none().0);
1034         }
1035     }
1036 
hscrollbar_policy(&self) -> PolicyType1037     fn hscrollbar_policy(&self) -> PolicyType {
1038         unsafe {
1039             let mut value = glib::Value::from_type(<PolicyType as StaticType>::static_type());
1040             glib::gobject_ffi::g_object_get_property(
1041                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
1042                 b"hscrollbar-policy\0".as_ptr() as *const _,
1043                 value.to_glib_none_mut().0,
1044             );
1045             value
1046                 .get()
1047                 .expect("Return Value for property `hscrollbar-policy` getter")
1048         }
1049     }
1050 
set_hscrollbar_policy(&self, hscrollbar_policy: PolicyType)1051     fn set_hscrollbar_policy(&self, hscrollbar_policy: PolicyType) {
1052         unsafe {
1053             glib::gobject_ffi::g_object_set_property(
1054                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
1055                 b"hscrollbar-policy\0".as_ptr() as *const _,
1056                 hscrollbar_policy.to_value().to_glib_none().0,
1057             );
1058         }
1059     }
1060 
vscrollbar_policy(&self) -> PolicyType1061     fn vscrollbar_policy(&self) -> PolicyType {
1062         unsafe {
1063             let mut value = glib::Value::from_type(<PolicyType as StaticType>::static_type());
1064             glib::gobject_ffi::g_object_get_property(
1065                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
1066                 b"vscrollbar-policy\0".as_ptr() as *const _,
1067                 value.to_glib_none_mut().0,
1068             );
1069             value
1070                 .get()
1071                 .expect("Return Value for property `vscrollbar-policy` getter")
1072         }
1073     }
1074 
set_vscrollbar_policy(&self, vscrollbar_policy: PolicyType)1075     fn set_vscrollbar_policy(&self, vscrollbar_policy: PolicyType) {
1076         unsafe {
1077             glib::gobject_ffi::g_object_set_property(
1078                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
1079                 b"vscrollbar-policy\0".as_ptr() as *const _,
1080                 vscrollbar_policy.to_value().to_glib_none().0,
1081             );
1082         }
1083     }
1084 
window_placement(&self) -> CornerType1085     fn window_placement(&self) -> CornerType {
1086         unsafe {
1087             let mut value = glib::Value::from_type(<CornerType as StaticType>::static_type());
1088             glib::gobject_ffi::g_object_get_property(
1089                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
1090                 b"window-placement\0".as_ptr() as *const _,
1091                 value.to_glib_none_mut().0,
1092             );
1093             value
1094                 .get()
1095                 .expect("Return Value for property `window-placement` getter")
1096         }
1097     }
1098 
set_window_placement(&self, window_placement: CornerType)1099     fn set_window_placement(&self, window_placement: CornerType) {
1100         unsafe {
1101             glib::gobject_ffi::g_object_set_property(
1102                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
1103                 b"window-placement\0".as_ptr() as *const _,
1104                 window_placement.to_value().to_glib_none().0,
1105             );
1106         }
1107     }
1108 
connect_edge_overshot<F: Fn(&Self, PositionType) + 'static>(&self, f: F) -> SignalHandlerId1109     fn connect_edge_overshot<F: Fn(&Self, PositionType) + 'static>(&self, f: F) -> SignalHandlerId {
1110         unsafe extern "C" fn edge_overshot_trampoline<
1111             P: IsA<ScrolledWindow>,
1112             F: Fn(&P, PositionType) + 'static,
1113         >(
1114             this: *mut ffi::GtkScrolledWindow,
1115             pos: ffi::GtkPositionType,
1116             f: glib::ffi::gpointer,
1117         ) {
1118             let f: &F = &*(f as *const F);
1119             f(
1120                 ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref(),
1121                 from_glib(pos),
1122             )
1123         }
1124         unsafe {
1125             let f: Box_<F> = Box_::new(f);
1126             connect_raw(
1127                 self.as_ptr() as *mut _,
1128                 b"edge-overshot\0".as_ptr() as *const _,
1129                 Some(transmute::<_, unsafe extern "C" fn()>(
1130                     edge_overshot_trampoline::<Self, F> as *const (),
1131                 )),
1132                 Box_::into_raw(f),
1133             )
1134         }
1135     }
1136 
connect_edge_reached<F: Fn(&Self, PositionType) + 'static>(&self, f: F) -> SignalHandlerId1137     fn connect_edge_reached<F: Fn(&Self, PositionType) + 'static>(&self, f: F) -> SignalHandlerId {
1138         unsafe extern "C" fn edge_reached_trampoline<
1139             P: IsA<ScrolledWindow>,
1140             F: Fn(&P, PositionType) + 'static,
1141         >(
1142             this: *mut ffi::GtkScrolledWindow,
1143             pos: ffi::GtkPositionType,
1144             f: glib::ffi::gpointer,
1145         ) {
1146             let f: &F = &*(f as *const F);
1147             f(
1148                 ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref(),
1149                 from_glib(pos),
1150             )
1151         }
1152         unsafe {
1153             let f: Box_<F> = Box_::new(f);
1154             connect_raw(
1155                 self.as_ptr() as *mut _,
1156                 b"edge-reached\0".as_ptr() as *const _,
1157                 Some(transmute::<_, unsafe extern "C" fn()>(
1158                     edge_reached_trampoline::<Self, F> as *const (),
1159                 )),
1160                 Box_::into_raw(f),
1161             )
1162         }
1163     }
1164 
connect_move_focus_out<F: Fn(&Self, DirectionType) + 'static>( &self, f: F, ) -> SignalHandlerId1165     fn connect_move_focus_out<F: Fn(&Self, DirectionType) + 'static>(
1166         &self,
1167         f: F,
1168     ) -> SignalHandlerId {
1169         unsafe extern "C" fn move_focus_out_trampoline<
1170             P: IsA<ScrolledWindow>,
1171             F: Fn(&P, DirectionType) + 'static,
1172         >(
1173             this: *mut ffi::GtkScrolledWindow,
1174             direction_type: ffi::GtkDirectionType,
1175             f: glib::ffi::gpointer,
1176         ) {
1177             let f: &F = &*(f as *const F);
1178             f(
1179                 ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref(),
1180                 from_glib(direction_type),
1181             )
1182         }
1183         unsafe {
1184             let f: Box_<F> = Box_::new(f);
1185             connect_raw(
1186                 self.as_ptr() as *mut _,
1187                 b"move-focus-out\0".as_ptr() as *const _,
1188                 Some(transmute::<_, unsafe extern "C" fn()>(
1189                     move_focus_out_trampoline::<Self, F> as *const (),
1190                 )),
1191                 Box_::into_raw(f),
1192             )
1193         }
1194     }
1195 
emit_move_focus_out(&self, direction_type: DirectionType)1196     fn emit_move_focus_out(&self, direction_type: DirectionType) {
1197         let _ = unsafe {
1198             glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
1199                 .emit_by_name("move-focus-out", &[&direction_type])
1200                 .unwrap()
1201         };
1202     }
1203 
connect_scroll_child<F: Fn(&Self, ScrollType, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId1204     fn connect_scroll_child<F: Fn(&Self, ScrollType, bool) -> bool + 'static>(
1205         &self,
1206         f: F,
1207     ) -> SignalHandlerId {
1208         unsafe extern "C" fn scroll_child_trampoline<
1209             P: IsA<ScrolledWindow>,
1210             F: Fn(&P, ScrollType, bool) -> bool + 'static,
1211         >(
1212             this: *mut ffi::GtkScrolledWindow,
1213             scroll: ffi::GtkScrollType,
1214             horizontal: glib::ffi::gboolean,
1215             f: glib::ffi::gpointer,
1216         ) -> glib::ffi::gboolean {
1217             let f: &F = &*(f as *const F);
1218             f(
1219                 ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref(),
1220                 from_glib(scroll),
1221                 from_glib(horizontal),
1222             )
1223             .into_glib()
1224         }
1225         unsafe {
1226             let f: Box_<F> = Box_::new(f);
1227             connect_raw(
1228                 self.as_ptr() as *mut _,
1229                 b"scroll-child\0".as_ptr() as *const _,
1230                 Some(transmute::<_, unsafe extern "C" fn()>(
1231                     scroll_child_trampoline::<Self, F> as *const (),
1232                 )),
1233                 Box_::into_raw(f),
1234             )
1235         }
1236     }
1237 
emit_scroll_child(&self, scroll: ScrollType, horizontal: bool) -> bool1238     fn emit_scroll_child(&self, scroll: ScrollType, horizontal: bool) -> bool {
1239         let res = unsafe {
1240             glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject)
1241                 .emit_by_name("scroll-child", &[&scroll, &horizontal])
1242                 .unwrap()
1243         };
1244         res.unwrap()
1245             .get()
1246             .expect("Return Value for `emit_scroll_child`")
1247     }
1248 
connect_hadjustment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1249     fn connect_hadjustment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1250         unsafe extern "C" fn notify_hadjustment_trampoline<
1251             P: IsA<ScrolledWindow>,
1252             F: Fn(&P) + 'static,
1253         >(
1254             this: *mut ffi::GtkScrolledWindow,
1255             _param_spec: glib::ffi::gpointer,
1256             f: glib::ffi::gpointer,
1257         ) {
1258             let f: &F = &*(f as *const F);
1259             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1260         }
1261         unsafe {
1262             let f: Box_<F> = Box_::new(f);
1263             connect_raw(
1264                 self.as_ptr() as *mut _,
1265                 b"notify::hadjustment\0".as_ptr() as *const _,
1266                 Some(transmute::<_, unsafe extern "C" fn()>(
1267                     notify_hadjustment_trampoline::<Self, F> as *const (),
1268                 )),
1269                 Box_::into_raw(f),
1270             )
1271         }
1272     }
1273 
connect_hscrollbar_policy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1274     fn connect_hscrollbar_policy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1275         unsafe extern "C" fn notify_hscrollbar_policy_trampoline<
1276             P: IsA<ScrolledWindow>,
1277             F: Fn(&P) + 'static,
1278         >(
1279             this: *mut ffi::GtkScrolledWindow,
1280             _param_spec: glib::ffi::gpointer,
1281             f: glib::ffi::gpointer,
1282         ) {
1283             let f: &F = &*(f as *const F);
1284             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1285         }
1286         unsafe {
1287             let f: Box_<F> = Box_::new(f);
1288             connect_raw(
1289                 self.as_ptr() as *mut _,
1290                 b"notify::hscrollbar-policy\0".as_ptr() as *const _,
1291                 Some(transmute::<_, unsafe extern "C" fn()>(
1292                     notify_hscrollbar_policy_trampoline::<Self, F> as *const (),
1293                 )),
1294                 Box_::into_raw(f),
1295             )
1296         }
1297     }
1298 
connect_kinetic_scrolling_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1299     fn connect_kinetic_scrolling_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1300         unsafe extern "C" fn notify_kinetic_scrolling_trampoline<
1301             P: IsA<ScrolledWindow>,
1302             F: Fn(&P) + 'static,
1303         >(
1304             this: *mut ffi::GtkScrolledWindow,
1305             _param_spec: glib::ffi::gpointer,
1306             f: glib::ffi::gpointer,
1307         ) {
1308             let f: &F = &*(f as *const F);
1309             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1310         }
1311         unsafe {
1312             let f: Box_<F> = Box_::new(f);
1313             connect_raw(
1314                 self.as_ptr() as *mut _,
1315                 b"notify::kinetic-scrolling\0".as_ptr() as *const _,
1316                 Some(transmute::<_, unsafe extern "C" fn()>(
1317                     notify_kinetic_scrolling_trampoline::<Self, F> as *const (),
1318                 )),
1319                 Box_::into_raw(f),
1320             )
1321         }
1322     }
1323 
1324     #[cfg(any(feature = "v3_22", feature = "dox"))]
1325     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
connect_max_content_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1326     fn connect_max_content_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1327         unsafe extern "C" fn notify_max_content_height_trampoline<
1328             P: IsA<ScrolledWindow>,
1329             F: Fn(&P) + 'static,
1330         >(
1331             this: *mut ffi::GtkScrolledWindow,
1332             _param_spec: glib::ffi::gpointer,
1333             f: glib::ffi::gpointer,
1334         ) {
1335             let f: &F = &*(f as *const F);
1336             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1337         }
1338         unsafe {
1339             let f: Box_<F> = Box_::new(f);
1340             connect_raw(
1341                 self.as_ptr() as *mut _,
1342                 b"notify::max-content-height\0".as_ptr() as *const _,
1343                 Some(transmute::<_, unsafe extern "C" fn()>(
1344                     notify_max_content_height_trampoline::<Self, F> as *const (),
1345                 )),
1346                 Box_::into_raw(f),
1347             )
1348         }
1349     }
1350 
1351     #[cfg(any(feature = "v3_22", feature = "dox"))]
1352     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
connect_max_content_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1353     fn connect_max_content_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1354         unsafe extern "C" fn notify_max_content_width_trampoline<
1355             P: IsA<ScrolledWindow>,
1356             F: Fn(&P) + 'static,
1357         >(
1358             this: *mut ffi::GtkScrolledWindow,
1359             _param_spec: glib::ffi::gpointer,
1360             f: glib::ffi::gpointer,
1361         ) {
1362             let f: &F = &*(f as *const F);
1363             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1364         }
1365         unsafe {
1366             let f: Box_<F> = Box_::new(f);
1367             connect_raw(
1368                 self.as_ptr() as *mut _,
1369                 b"notify::max-content-width\0".as_ptr() as *const _,
1370                 Some(transmute::<_, unsafe extern "C" fn()>(
1371                     notify_max_content_width_trampoline::<Self, F> as *const (),
1372                 )),
1373                 Box_::into_raw(f),
1374             )
1375         }
1376     }
1377 
connect_min_content_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1378     fn connect_min_content_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1379         unsafe extern "C" fn notify_min_content_height_trampoline<
1380             P: IsA<ScrolledWindow>,
1381             F: Fn(&P) + 'static,
1382         >(
1383             this: *mut ffi::GtkScrolledWindow,
1384             _param_spec: glib::ffi::gpointer,
1385             f: glib::ffi::gpointer,
1386         ) {
1387             let f: &F = &*(f as *const F);
1388             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1389         }
1390         unsafe {
1391             let f: Box_<F> = Box_::new(f);
1392             connect_raw(
1393                 self.as_ptr() as *mut _,
1394                 b"notify::min-content-height\0".as_ptr() as *const _,
1395                 Some(transmute::<_, unsafe extern "C" fn()>(
1396                     notify_min_content_height_trampoline::<Self, F> as *const (),
1397                 )),
1398                 Box_::into_raw(f),
1399             )
1400         }
1401     }
1402 
connect_min_content_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1403     fn connect_min_content_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1404         unsafe extern "C" fn notify_min_content_width_trampoline<
1405             P: IsA<ScrolledWindow>,
1406             F: Fn(&P) + 'static,
1407         >(
1408             this: *mut ffi::GtkScrolledWindow,
1409             _param_spec: glib::ffi::gpointer,
1410             f: glib::ffi::gpointer,
1411         ) {
1412             let f: &F = &*(f as *const F);
1413             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1414         }
1415         unsafe {
1416             let f: Box_<F> = Box_::new(f);
1417             connect_raw(
1418                 self.as_ptr() as *mut _,
1419                 b"notify::min-content-width\0".as_ptr() as *const _,
1420                 Some(transmute::<_, unsafe extern "C" fn()>(
1421                     notify_min_content_width_trampoline::<Self, F> as *const (),
1422                 )),
1423                 Box_::into_raw(f),
1424             )
1425         }
1426     }
1427 
connect_overlay_scrolling_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1428     fn connect_overlay_scrolling_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1429         unsafe extern "C" fn notify_overlay_scrolling_trampoline<
1430             P: IsA<ScrolledWindow>,
1431             F: Fn(&P) + 'static,
1432         >(
1433             this: *mut ffi::GtkScrolledWindow,
1434             _param_spec: glib::ffi::gpointer,
1435             f: glib::ffi::gpointer,
1436         ) {
1437             let f: &F = &*(f as *const F);
1438             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1439         }
1440         unsafe {
1441             let f: Box_<F> = Box_::new(f);
1442             connect_raw(
1443                 self.as_ptr() as *mut _,
1444                 b"notify::overlay-scrolling\0".as_ptr() as *const _,
1445                 Some(transmute::<_, unsafe extern "C" fn()>(
1446                     notify_overlay_scrolling_trampoline::<Self, F> as *const (),
1447                 )),
1448                 Box_::into_raw(f),
1449             )
1450         }
1451     }
1452 
1453     #[cfg(any(feature = "v3_22", feature = "dox"))]
1454     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
connect_propagate_natural_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1455     fn connect_propagate_natural_height_notify<F: Fn(&Self) + 'static>(
1456         &self,
1457         f: F,
1458     ) -> SignalHandlerId {
1459         unsafe extern "C" fn notify_propagate_natural_height_trampoline<
1460             P: IsA<ScrolledWindow>,
1461             F: Fn(&P) + 'static,
1462         >(
1463             this: *mut ffi::GtkScrolledWindow,
1464             _param_spec: glib::ffi::gpointer,
1465             f: glib::ffi::gpointer,
1466         ) {
1467             let f: &F = &*(f as *const F);
1468             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1469         }
1470         unsafe {
1471             let f: Box_<F> = Box_::new(f);
1472             connect_raw(
1473                 self.as_ptr() as *mut _,
1474                 b"notify::propagate-natural-height\0".as_ptr() as *const _,
1475                 Some(transmute::<_, unsafe extern "C" fn()>(
1476                     notify_propagate_natural_height_trampoline::<Self, F> as *const (),
1477                 )),
1478                 Box_::into_raw(f),
1479             )
1480         }
1481     }
1482 
1483     #[cfg(any(feature = "v3_22", feature = "dox"))]
1484     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
connect_propagate_natural_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1485     fn connect_propagate_natural_width_notify<F: Fn(&Self) + 'static>(
1486         &self,
1487         f: F,
1488     ) -> SignalHandlerId {
1489         unsafe extern "C" fn notify_propagate_natural_width_trampoline<
1490             P: IsA<ScrolledWindow>,
1491             F: Fn(&P) + 'static,
1492         >(
1493             this: *mut ffi::GtkScrolledWindow,
1494             _param_spec: glib::ffi::gpointer,
1495             f: glib::ffi::gpointer,
1496         ) {
1497             let f: &F = &*(f as *const F);
1498             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1499         }
1500         unsafe {
1501             let f: Box_<F> = Box_::new(f);
1502             connect_raw(
1503                 self.as_ptr() as *mut _,
1504                 b"notify::propagate-natural-width\0".as_ptr() as *const _,
1505                 Some(transmute::<_, unsafe extern "C" fn()>(
1506                     notify_propagate_natural_width_trampoline::<Self, F> as *const (),
1507                 )),
1508                 Box_::into_raw(f),
1509             )
1510         }
1511     }
1512 
connect_shadow_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1513     fn connect_shadow_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1514         unsafe extern "C" fn notify_shadow_type_trampoline<
1515             P: IsA<ScrolledWindow>,
1516             F: Fn(&P) + 'static,
1517         >(
1518             this: *mut ffi::GtkScrolledWindow,
1519             _param_spec: glib::ffi::gpointer,
1520             f: glib::ffi::gpointer,
1521         ) {
1522             let f: &F = &*(f as *const F);
1523             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1524         }
1525         unsafe {
1526             let f: Box_<F> = Box_::new(f);
1527             connect_raw(
1528                 self.as_ptr() as *mut _,
1529                 b"notify::shadow-type\0".as_ptr() as *const _,
1530                 Some(transmute::<_, unsafe extern "C" fn()>(
1531                     notify_shadow_type_trampoline::<Self, F> as *const (),
1532                 )),
1533                 Box_::into_raw(f),
1534             )
1535         }
1536     }
1537 
connect_vadjustment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1538     fn connect_vadjustment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1539         unsafe extern "C" fn notify_vadjustment_trampoline<
1540             P: IsA<ScrolledWindow>,
1541             F: Fn(&P) + 'static,
1542         >(
1543             this: *mut ffi::GtkScrolledWindow,
1544             _param_spec: glib::ffi::gpointer,
1545             f: glib::ffi::gpointer,
1546         ) {
1547             let f: &F = &*(f as *const F);
1548             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1549         }
1550         unsafe {
1551             let f: Box_<F> = Box_::new(f);
1552             connect_raw(
1553                 self.as_ptr() as *mut _,
1554                 b"notify::vadjustment\0".as_ptr() as *const _,
1555                 Some(transmute::<_, unsafe extern "C" fn()>(
1556                     notify_vadjustment_trampoline::<Self, F> as *const (),
1557                 )),
1558                 Box_::into_raw(f),
1559             )
1560         }
1561     }
1562 
connect_vscrollbar_policy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1563     fn connect_vscrollbar_policy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1564         unsafe extern "C" fn notify_vscrollbar_policy_trampoline<
1565             P: IsA<ScrolledWindow>,
1566             F: Fn(&P) + 'static,
1567         >(
1568             this: *mut ffi::GtkScrolledWindow,
1569             _param_spec: glib::ffi::gpointer,
1570             f: glib::ffi::gpointer,
1571         ) {
1572             let f: &F = &*(f as *const F);
1573             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1574         }
1575         unsafe {
1576             let f: Box_<F> = Box_::new(f);
1577             connect_raw(
1578                 self.as_ptr() as *mut _,
1579                 b"notify::vscrollbar-policy\0".as_ptr() as *const _,
1580                 Some(transmute::<_, unsafe extern "C" fn()>(
1581                     notify_vscrollbar_policy_trampoline::<Self, F> as *const (),
1582                 )),
1583                 Box_::into_raw(f),
1584             )
1585         }
1586     }
1587 
connect_window_placement_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1588     fn connect_window_placement_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1589         unsafe extern "C" fn notify_window_placement_trampoline<
1590             P: IsA<ScrolledWindow>,
1591             F: Fn(&P) + 'static,
1592         >(
1593             this: *mut ffi::GtkScrolledWindow,
1594             _param_spec: glib::ffi::gpointer,
1595             f: glib::ffi::gpointer,
1596         ) {
1597             let f: &F = &*(f as *const F);
1598             f(ScrolledWindow::from_glib_borrow(this).unsafe_cast_ref())
1599         }
1600         unsafe {
1601             let f: Box_<F> = Box_::new(f);
1602             connect_raw(
1603                 self.as_ptr() as *mut _,
1604                 b"notify::window-placement\0".as_ptr() as *const _,
1605                 Some(transmute::<_, unsafe extern "C" fn()>(
1606                     notify_window_placement_trampoline::<Self, F> as *const (),
1607                 )),
1608                 Box_::into_raw(f),
1609             )
1610         }
1611     }
1612 }
1613 
1614 impl fmt::Display for ScrolledWindow {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1615     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1616         f.write_str("ScrolledWindow")
1617     }
1618 }
1619