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