1use atk;
6use cairo;
7use cairo_sys;
8use gdk;
9use gdk_pixbuf;
10use gdk_sys;
11use gio;
12use glib;
13use glib::object::Cast;
14use glib::object::IsA;
15use glib::object::ObjectExt;
16use glib::signal::connect_raw;
17use glib::signal::SignalHandlerId;
18use glib::translate::*;
19use glib::GString;
20use glib::StaticType;
21use glib::Value;
22use glib_sys;
23use gobject_sys;
24use gtk_sys;
25use libc;
26use pango;
27use signal::Inhibit;
28use std::boxed::Box as Box_;
29use std::fmt;
30use std::mem;
31use std::mem::transmute;
32use AccelFlags;
33use AccelGroup;
34use Align;
35use Allocation;
36use Buildable;
37use Clipboard;
38use DirectionType;
39use DragResult;
40use Orientation;
41use Requisition;
42use SelectionData;
43use Settings;
44use SizeRequestMode;
45use StateFlags;
46use StyleContext;
47use TargetList;
48use TextDirection;
49use Tooltip;
50use WidgetHelpType;
51use WidgetPath;
52use Window;
53
54glib_wrapper! {
55 pub struct Widget(Object<gtk_sys::GtkWidget, gtk_sys::GtkWidgetClass, WidgetClass>) @implements Buildable;
56
57 match fn {
58 get_type => || gtk_sys::gtk_widget_get_type(),
59 }
60}
61
62impl Widget {
63 pub fn get_default_direction() -> TextDirection {
68 assert_initialized_main_thread!();
69 unsafe { from_glib(gtk_sys::gtk_widget_get_default_direction()) }
70 }
71
72 pub fn set_default_direction(dir: TextDirection) {
73 assert_initialized_main_thread!();
74 unsafe {
75 gtk_sys::gtk_widget_set_default_direction(dir.to_glib());
76 }
77 }
78}
79
80pub const NONE_WIDGET: Option<&Widget> = None;
81
82pub trait WidgetExt: 'static {
83 fn activate(&self) -> bool;
84
85 fn add_accelerator<P: IsA<AccelGroup>>(
86 &self,
87 accel_signal: &str,
88 accel_group: &P,
89 accel_key: u32,
90 accel_mods: gdk::ModifierType,
91 accel_flags: AccelFlags,
92 );
93
94 fn add_device_events(&self, device: &gdk::Device, events: gdk::EventMask);
95
96 fn add_mnemonic_label<P: IsA<Widget>>(&self, label: &P);
97
98 fn can_activate_accel(&self, signal_id: u32) -> bool;
99
100 fn child_focus(&self, direction: DirectionType) -> bool;
101
102 fn child_notify(&self, child_property: &str);
103
104 fn compute_expand(&self, orientation: Orientation) -> bool;
105
106 fn create_pango_context(&self) -> Option<pango::Context>;
107
108 fn create_pango_layout(&self, text: Option<&str>) -> Option<pango::Layout>;
109
110 fn destroy(&self);
111
112 fn device_is_shadowed(&self, device: &gdk::Device) -> bool;
115
116 fn drag_begin_with_coordinates(
117 &self,
118 targets: &TargetList,
119 actions: gdk::DragAction,
120 button: i32,
121 event: Option<&gdk::Event>,
122 x: i32,
123 y: i32,
124 ) -> Option<gdk::DragContext>;
125
126 fn drag_check_threshold(
127 &self,
128 start_x: i32,
129 start_y: i32,
130 current_x: i32,
131 current_y: i32,
132 ) -> bool;
133
134 fn drag_dest_add_image_targets(&self);
135
136 fn drag_dest_add_text_targets(&self);
137
138 fn drag_dest_add_uri_targets(&self);
139
140 fn drag_dest_find_target(
141 &self,
142 context: &gdk::DragContext,
143 target_list: Option<&TargetList>,
144 ) -> Option<gdk::Atom>;
145
146 fn drag_dest_get_target_list(&self) -> Option<TargetList>;
147
148 fn drag_dest_get_track_motion(&self) -> bool;
149
150 #[cfg_attr(feature = "v3_22", deprecated)]
151 fn drag_dest_set_proxy<P: IsA<gdk::Window>>(
152 &self,
153 proxy_window: &P,
154 protocol: gdk::DragProtocol,
155 use_coordinates: bool,
156 );
157
158 fn drag_dest_set_target_list(&self, target_list: Option<&TargetList>);
159
160 fn drag_dest_set_track_motion(&self, track_motion: bool);
161
162 fn drag_dest_unset(&self);
163
164 fn drag_get_data(&self, context: &gdk::DragContext, target: &gdk::Atom, time_: u32);
165
166 fn drag_highlight(&self);
167
168 fn drag_source_add_image_targets(&self);
169
170 fn drag_source_add_text_targets(&self);
171
172 fn drag_source_add_uri_targets(&self);
173
174 fn drag_source_get_target_list(&self) -> Option<TargetList>;
175
176 fn drag_source_set_icon_gicon<P: IsA<gio::Icon>>(&self, icon: &P);
177
178 fn drag_source_set_icon_name(&self, icon_name: &str);
179
180 fn drag_source_set_icon_pixbuf(&self, pixbuf: &gdk_pixbuf::Pixbuf);
181
182 fn drag_source_set_target_list(&self, target_list: Option<&TargetList>);
183
184 fn drag_source_unset(&self);
185
186 fn drag_unhighlight(&self);
187
188 fn draw(&self, cr: &cairo::Context);
189
190 fn error_bell(&self);
191
192 fn event(&self, event: &gdk::Event) -> bool;
193
194 fn freeze_child_notify(&self);
195
196 fn get_accessible(&self) -> Option<atk::Object>;
197
198 #[cfg(any(feature = "v3_16", feature = "dox"))]
199 fn get_action_group(&self, prefix: &str) -> Option<gio::ActionGroup>;
200
201 fn get_allocated_baseline(&self) -> i32;
202
203 fn get_allocated_height(&self) -> i32;
204
205 #[cfg(any(feature = "v3_20", feature = "dox"))]
206 fn get_allocated_size(&self) -> (Allocation, i32);
207
208 fn get_allocated_width(&self) -> i32;
209
210 fn get_allocation(&self) -> Allocation;
211
212 fn get_ancestor(&self, widget_type: glib::types::Type) -> Option<Widget>;
213
214 fn get_app_paintable(&self) -> bool;
215
216 fn get_can_default(&self) -> bool;
217
218 fn get_can_focus(&self) -> bool;
219
220 fn get_child_visible(&self) -> bool;
221
222 fn get_clip(&self) -> Allocation;
223
224 fn get_clipboard(&self, selection: &gdk::Atom) -> Clipboard;
225
226 fn get_device_enabled(&self, device: &gdk::Device) -> bool;
227
228 fn get_device_events(&self, device: &gdk::Device) -> gdk::EventMask;
229
230 fn get_direction(&self) -> TextDirection;
231
232 fn get_display(&self) -> Option<gdk::Display>;
233
234 fn get_double_buffered(&self) -> bool;
235
236 #[cfg(any(feature = "v3_20", feature = "dox"))]
237 fn get_focus_on_click(&self) -> bool;
238
239 #[cfg(any(feature = "v3_18", feature = "dox"))]
240 fn get_font_map(&self) -> Option<pango::FontMap>;
241
242 #[cfg(any(feature = "v3_18", feature = "dox"))]
243 fn get_font_options(&self) -> Option<cairo::FontOptions>;
244
245 fn get_frame_clock(&self) -> Option<gdk::FrameClock>;
246
247 fn get_halign(&self) -> Align;
248
249 fn get_has_tooltip(&self) -> bool;
250
251 fn get_has_window(&self) -> bool;
252
253 fn get_hexpand(&self) -> bool;
254
255 fn get_hexpand_set(&self) -> bool;
256
257 fn get_mapped(&self) -> bool;
258
259 fn get_margin_bottom(&self) -> i32;
260
261 fn get_margin_end(&self) -> i32;
262
263 fn get_margin_start(&self) -> i32;
264
265 fn get_margin_top(&self) -> i32;
266
267 fn get_modifier_mask(&self, intent: gdk::ModifierIntent) -> gdk::ModifierType;
268
269 fn get_name(&self) -> Option<GString>;
270
271 fn get_no_show_all(&self) -> bool;
272
273 fn get_opacity(&self) -> f64;
274
275 fn get_pango_context(&self) -> Option<pango::Context>;
276
277 fn get_parent(&self) -> Option<Widget>;
278
279 fn get_parent_window(&self) -> Option<gdk::Window>;
280
281 fn get_path(&self) -> WidgetPath;
282
283 fn get_preferred_height(&self) -> (i32, i32);
284
285 fn get_preferred_height_and_baseline_for_width(&self, width: i32) -> (i32, i32, i32, i32);
286
287 fn get_preferred_height_for_width(&self, width: i32) -> (i32, i32);
288
289 fn get_preferred_size(&self) -> (Requisition, Requisition);
290
291 fn get_preferred_width(&self) -> (i32, i32);
292
293 fn get_preferred_width_for_height(&self, height: i32) -> (i32, i32);
294
295 fn get_realized(&self) -> bool;
296
297 fn get_receives_default(&self) -> bool;
298
299 fn get_request_mode(&self) -> SizeRequestMode;
300
301 fn get_scale_factor(&self) -> i32;
302
303 fn get_screen(&self) -> Option<gdk::Screen>;
304
305 fn get_sensitive(&self) -> bool;
306
307 fn get_settings(&self) -> Option<Settings>;
308
309 fn get_size_request(&self) -> (i32, i32);
310
311 fn get_state_flags(&self) -> StateFlags;
312
313 fn get_style_context(&self) -> StyleContext;
314
315 fn get_support_multidevice(&self) -> bool;
316
317 fn get_template_child(
318 &self,
319 widget_type: glib::types::Type,
320 name: &str,
321 ) -> Option<glib::Object>;
322
323 fn get_tooltip_markup(&self) -> Option<GString>;
324
325 fn get_tooltip_text(&self) -> Option<GString>;
326
327 fn get_tooltip_window(&self) -> Option<Window>;
328
329 fn get_toplevel(&self) -> Option<Widget>;
330
331 fn get_valign(&self) -> Align;
332
333 fn get_valign_with_baseline(&self) -> Align;
334
335 fn get_vexpand(&self) -> bool;
336
337 fn get_vexpand_set(&self) -> bool;
338
339 fn get_visible(&self) -> bool;
340
341 fn get_visual(&self) -> Option<gdk::Visual>;
342
343 fn get_window(&self) -> Option<gdk::Window>;
344
345 fn grab_add(&self);
346
347 fn grab_default(&self);
348
349 fn grab_focus(&self);
350
351 fn grab_remove(&self);
352
353 fn has_default(&self) -> bool;
354
355 fn has_focus(&self) -> bool;
356
357 fn has_grab(&self) -> bool;
358
359 fn has_screen(&self) -> bool;
360
361 fn has_visible_focus(&self) -> bool;
362
363 fn hide(&self);
364
365 fn hide_on_delete(&self) -> bool;
366
367 fn in_destruction(&self) -> bool;
368
369 fn init_template(&self);
370
371 fn input_shape_combine_region(&self, region: Option<&cairo::Region>);
372
373 fn insert_action_group<P: IsA<gio::ActionGroup>>(&self, name: &str, group: Option<&P>);
374
375 fn is_ancestor<P: IsA<Widget>>(&self, ancestor: &P) -> bool;
376
377 #[cfg_attr(feature = "v3_22", deprecated)]
378 fn is_composited(&self) -> bool;
379
380 fn is_drawable(&self) -> bool;
381
382 fn is_focus(&self) -> bool;
383
384 fn is_sensitive(&self) -> bool;
385
386 fn is_toplevel(&self) -> bool;
387
388 fn is_visible(&self) -> bool;
389
390 fn keynav_failed(&self, direction: DirectionType) -> bool;
391
392 fn list_accel_closures(&self) -> Vec<glib::Closure>;
393
394 #[cfg(any(feature = "v3_16", feature = "dox"))]
395 fn list_action_prefixes(&self) -> Vec<GString>;
396
397 fn list_mnemonic_labels(&self) -> Vec<Widget>;
398
399 fn map(&self);
400
401 fn mnemonic_activate(&self, group_cycling: bool) -> bool;
402
403 #[cfg_attr(feature = "v3_16", deprecated)]
404 fn override_background_color(&self, state: StateFlags, color: Option<&gdk::RGBA>);
405
406 #[cfg_attr(feature = "v3_16", deprecated)]
407 fn override_color(&self, state: StateFlags, color: Option<&gdk::RGBA>);
408
409 #[cfg_attr(feature = "v3_16", deprecated)]
410 fn override_cursor(&self, cursor: Option<&gdk::RGBA>, secondary_cursor: Option<&gdk::RGBA>);
411
412 #[cfg_attr(feature = "v3_16", deprecated)]
413 fn override_font(&self, font_desc: Option<&pango::FontDescription>);
414
415 #[cfg_attr(feature = "v3_16", deprecated)]
416 fn override_symbolic_color(&self, name: &str, color: Option<&gdk::RGBA>);
417
418 #[cfg(any(feature = "v3_20", feature = "dox"))]
419 fn queue_allocate(&self);
420
421 fn queue_compute_expand(&self);
422
423 fn queue_draw(&self);
424
425 fn queue_draw_area(&self, x: i32, y: i32, width: i32, height: i32);
426
427 fn queue_draw_region(&self, region: &cairo::Region);
428
429 fn queue_resize(&self);
430
431 fn queue_resize_no_redraw(&self);
432
433 fn realize(&self);
434
435 fn register_window<P: IsA<gdk::Window>>(&self, window: &P);
436
437 fn remove_accelerator<P: IsA<AccelGroup>>(
438 &self,
439 accel_group: &P,
440 accel_key: u32,
441 accel_mods: gdk::ModifierType,
442 ) -> bool;
443
444 fn remove_mnemonic_label<P: IsA<Widget>>(&self, label: &P);
445
446 fn reset_style(&self);
447
448 #[cfg_attr(feature = "v3_22", deprecated)]
449 fn send_expose(&self, event: &gdk::Event) -> i32;
450
451 fn send_focus_change(&self, event: &gdk::Event) -> bool;
452
453 fn set_accel_path<P: IsA<AccelGroup>>(&self, accel_path: Option<&str>, accel_group: Option<&P>);
454
455 fn set_allocation(&self, allocation: &Allocation);
456
457 fn set_app_paintable(&self, app_paintable: bool);
458
459 fn set_can_default(&self, can_default: bool);
460
461 fn set_can_focus(&self, can_focus: bool);
462
463 fn set_child_visible(&self, is_visible: bool);
464
465 fn set_clip(&self, clip: &Allocation);
466
467 fn set_device_enabled(&self, device: &gdk::Device, enabled: bool);
468
469 fn set_device_events(&self, device: &gdk::Device, events: gdk::EventMask);
470
471 fn set_direction(&self, dir: TextDirection);
472
473 #[cfg(any(feature = "v3_20", feature = "dox"))]
474 fn set_focus_on_click(&self, focus_on_click: bool);
475
476 #[cfg(any(feature = "v3_18", feature = "dox"))]
477 fn set_font_map<P: IsA<pango::FontMap>>(&self, font_map: Option<&P>);
478
479 #[cfg(any(feature = "v3_18", feature = "dox"))]
480 fn set_font_options(&self, options: Option<&cairo::FontOptions>);
481
482 fn set_halign(&self, align: Align);
483
484 fn set_has_tooltip(&self, has_tooltip: bool);
485
486 fn set_has_window(&self, has_window: bool);
487
488 fn set_hexpand(&self, expand: bool);
489
490 fn set_hexpand_set(&self, set: bool);
491
492 fn set_mapped(&self, mapped: bool);
493
494 fn set_margin_bottom(&self, margin: i32);
495
496 fn set_margin_end(&self, margin: i32);
497
498 fn set_margin_start(&self, margin: i32);
499
500 fn set_margin_top(&self, margin: i32);
501
502 fn set_name(&self, name: &str);
503
504 fn set_no_show_all(&self, no_show_all: bool);
505
506 fn set_opacity(&self, opacity: f64);
507
508 fn set_parent<P: IsA<Widget>>(&self, parent: &P);
509
510 fn set_parent_window<P: IsA<gdk::Window>>(&self, parent_window: &P);
511
512 fn set_realized(&self, realized: bool);
513
514 fn set_receives_default(&self, receives_default: bool);
515
516 fn set_redraw_on_allocate(&self, redraw_on_allocate: bool);
517
518 fn set_sensitive(&self, sensitive: bool);
519
520 fn set_size_request(&self, width: i32, height: i32);
521
522 fn set_state_flags(&self, flags: StateFlags, clear: bool);
523
524 fn set_support_multidevice(&self, support_multidevice: bool);
525
526 fn set_tooltip_markup(&self, markup: Option<&str>);
527
528 fn set_tooltip_text(&self, text: Option<&str>);
529
530 fn set_tooltip_window<P: IsA<Window>>(&self, custom_window: Option<&P>);
531
532 fn set_valign(&self, align: Align);
533
534 fn set_vexpand(&self, expand: bool);
535
536 fn set_vexpand_set(&self, set: bool);
537
538 fn set_visible(&self, visible: bool);
539
540 fn set_visual(&self, visual: Option<&gdk::Visual>);
541
542 fn set_window<P: IsA<gdk::Window>>(&self, window: &P);
543
544 fn shape_combine_region(&self, region: Option<&cairo::Region>);
545
546 fn show(&self);
547
548 fn show_all(&self);
549
550 fn show_now(&self);
551
552 fn size_allocate(&self, allocation: &mut Allocation);
553
554 fn size_allocate_with_baseline(&self, allocation: &mut Allocation, baseline: i32);
555
556 fn thaw_child_notify(&self);
561
562 fn translate_coordinates<P: IsA<Widget>>(
563 &self,
564 dest_widget: &P,
565 src_x: i32,
566 src_y: i32,
567 ) -> Option<(i32, i32)>;
568
569 fn trigger_tooltip_query(&self);
570
571 fn unmap(&self);
572
573 fn unparent(&self);
574
575 fn unrealize(&self);
576
577 fn unregister_window<P: IsA<gdk::Window>>(&self, window: &P);
578
579 fn unset_state_flags(&self, flags: StateFlags);
580
581 fn get_property_composite_child(&self) -> bool;
582
583 fn get_property_expand(&self) -> bool;
584
585 fn set_property_expand(&self, expand: bool);
586
587 fn get_property_has_default(&self) -> bool;
588
589 fn set_property_has_default(&self, has_default: bool);
590
591 fn get_property_has_focus(&self) -> bool;
592
593 fn set_property_has_focus(&self, has_focus: bool);
594
595 fn get_property_height_request(&self) -> i32;
596
597 fn set_property_height_request(&self, height_request: i32);
598
599 fn get_property_is_focus(&self) -> bool;
600
601 fn set_property_is_focus(&self, is_focus: bool);
602
603 fn get_property_margin(&self) -> i32;
604
605 fn set_property_margin(&self, margin: i32);
606
607 fn get_property_width_request(&self) -> i32;
608
609 fn set_property_width_request(&self, width_request: i32);
610
611 fn connect_accel_closures_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
612
613 fn connect_button_press_event<F: Fn(&Self, &gdk::EventButton) -> Inhibit + 'static>(
614 &self,
615 f: F,
616 ) -> SignalHandlerId;
617
618 fn connect_button_release_event<F: Fn(&Self, &gdk::EventButton) -> Inhibit + 'static>(
619 &self,
620 f: F,
621 ) -> SignalHandlerId;
622
623 fn connect_can_activate_accel<F: Fn(&Self, u32) -> bool + 'static>(
624 &self,
625 f: F,
626 ) -> SignalHandlerId;
627
628 #[cfg_attr(feature = "v3_22", deprecated)]
631 fn connect_composited_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
632
633 #[cfg_attr(feature = "v3_22", deprecated)]
634 fn emit_composited_changed(&self);
635
636 fn connect_configure_event<F: Fn(&Self, &gdk::EventConfigure) -> bool + 'static>(
637 &self,
638 f: F,
639 ) -> SignalHandlerId;
640
641 fn connect_damage_event<F: Fn(&Self, &gdk::EventExpose) -> bool + 'static>(
642 &self,
643 f: F,
644 ) -> SignalHandlerId;
645
646 fn connect_delete_event<F: Fn(&Self, &gdk::Event) -> Inhibit + 'static>(
647 &self,
648 f: F,
649 ) -> SignalHandlerId;
650
651 fn connect_destroy<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
652
653 fn connect_destroy_event<F: Fn(&Self, &gdk::Event) -> Inhibit + 'static>(
654 &self,
655 f: F,
656 ) -> SignalHandlerId;
657
658 fn connect_direction_changed<F: Fn(&Self, TextDirection) + 'static>(
659 &self,
660 f: F,
661 ) -> SignalHandlerId;
662
663 fn connect_drag_begin<F: Fn(&Self, &gdk::DragContext) + 'static>(
664 &self,
665 f: F,
666 ) -> SignalHandlerId;
667
668 fn connect_drag_data_delete<F: Fn(&Self, &gdk::DragContext) + 'static>(
669 &self,
670 f: F,
671 ) -> SignalHandlerId;
672
673 fn connect_drag_data_get<F: Fn(&Self, &gdk::DragContext, &SelectionData, u32, u32) + 'static>(
674 &self,
675 f: F,
676 ) -> SignalHandlerId;
677
678 fn connect_drag_data_received<
679 F: Fn(&Self, &gdk::DragContext, i32, i32, &SelectionData, u32, u32) + 'static,
680 >(
681 &self,
682 f: F,
683 ) -> SignalHandlerId;
684
685 fn connect_drag_drop<F: Fn(&Self, &gdk::DragContext, i32, i32, u32) -> Inhibit + 'static>(
686 &self,
687 f: F,
688 ) -> SignalHandlerId;
689
690 fn connect_drag_end<F: Fn(&Self, &gdk::DragContext) + 'static>(&self, f: F) -> SignalHandlerId;
691
692 fn connect_drag_failed<F: Fn(&Self, &gdk::DragContext, DragResult) -> Inhibit + 'static>(
693 &self,
694 f: F,
695 ) -> SignalHandlerId;
696
697 fn connect_drag_leave<F: Fn(&Self, &gdk::DragContext, u32) + 'static>(
698 &self,
699 f: F,
700 ) -> SignalHandlerId;
701
702 fn connect_drag_motion<F: Fn(&Self, &gdk::DragContext, i32, i32, u32) -> Inhibit + 'static>(
703 &self,
704 f: F,
705 ) -> SignalHandlerId;
706
707 fn connect_draw<F: Fn(&Self, &cairo::Context) -> Inhibit + 'static>(
708 &self,
709 f: F,
710 ) -> SignalHandlerId;
711
712 fn connect_enter_notify_event<F: Fn(&Self, &gdk::EventCrossing) -> Inhibit + 'static>(
713 &self,
714 f: F,
715 ) -> SignalHandlerId;
716
717 fn connect_event<F: Fn(&Self, &gdk::Event) -> Inhibit + 'static>(
718 &self,
719 f: F,
720 ) -> SignalHandlerId;
721
722 fn connect_event_after<F: Fn(&Self, &gdk::Event) + 'static>(&self, f: F) -> SignalHandlerId;
723
724 fn connect_focus<F: Fn(&Self, DirectionType) -> Inhibit + 'static>(
725 &self,
726 f: F,
727 ) -> SignalHandlerId;
728
729 fn connect_focus_in_event<F: Fn(&Self, &gdk::EventFocus) -> Inhibit + 'static>(
730 &self,
731 f: F,
732 ) -> SignalHandlerId;
733
734 fn connect_focus_out_event<F: Fn(&Self, &gdk::EventFocus) -> Inhibit + 'static>(
735 &self,
736 f: F,
737 ) -> SignalHandlerId;
738
739 fn connect_grab_broken_event<F: Fn(&Self, &gdk::EventGrabBroken) -> Inhibit + 'static>(
740 &self,
741 f: F,
742 ) -> SignalHandlerId;
743
744 fn connect_grab_focus<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
745
746 fn emit_grab_focus(&self);
747
748 fn connect_grab_notify<F: Fn(&Self, bool) + 'static>(&self, f: F) -> SignalHandlerId;
749
750 fn connect_hide<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
751
752 fn connect_hierarchy_changed<F: Fn(&Self, Option<&Widget>) + 'static>(
753 &self,
754 f: F,
755 ) -> SignalHandlerId;
756
757 fn connect_key_press_event<F: Fn(&Self, &gdk::EventKey) -> Inhibit + 'static>(
758 &self,
759 f: F,
760 ) -> SignalHandlerId;
761
762 fn connect_key_release_event<F: Fn(&Self, &gdk::EventKey) -> Inhibit + 'static>(
763 &self,
764 f: F,
765 ) -> SignalHandlerId;
766
767 fn connect_keynav_failed<F: Fn(&Self, DirectionType) -> Inhibit + 'static>(
768 &self,
769 f: F,
770 ) -> SignalHandlerId;
771
772 fn connect_leave_notify_event<F: Fn(&Self, &gdk::EventCrossing) -> Inhibit + 'static>(
773 &self,
774 f: F,
775 ) -> SignalHandlerId;
776
777 fn connect_map<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
778
779 fn connect_mnemonic_activate<F: Fn(&Self, bool) -> Inhibit + 'static>(
780 &self,
781 f: F,
782 ) -> SignalHandlerId;
783
784 fn connect_motion_notify_event<F: Fn(&Self, &gdk::EventMotion) -> Inhibit + 'static>(
785 &self,
786 f: F,
787 ) -> SignalHandlerId;
788
789 fn connect_move_focus<F: Fn(&Self, DirectionType) + 'static>(&self, f: F) -> SignalHandlerId;
790
791 fn emit_move_focus(&self, direction: DirectionType);
792
793 fn connect_parent_set<F: Fn(&Self, Option<&Widget>) + 'static>(&self, f: F) -> SignalHandlerId;
794
795 fn connect_popup_menu<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId;
796
797 fn emit_popup_menu(&self) -> bool;
798
799 fn connect_property_notify_event<F: Fn(&Self, &gdk::EventProperty) -> Inhibit + 'static>(
800 &self,
801 f: F,
802 ) -> SignalHandlerId;
803
804 fn connect_proximity_in_event<F: Fn(&Self, &gdk::EventProximity) -> Inhibit + 'static>(
805 &self,
806 f: F,
807 ) -> SignalHandlerId;
808
809 fn connect_proximity_out_event<F: Fn(&Self, &gdk::EventProximity) -> Inhibit + 'static>(
810 &self,
811 f: F,
812 ) -> SignalHandlerId;
813
814 fn connect_query_tooltip<F: Fn(&Self, i32, i32, bool, &Tooltip) -> bool + 'static>(
815 &self,
816 f: F,
817 ) -> SignalHandlerId;
818
819 fn connect_realize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
820
821 fn connect_screen_changed<F: Fn(&Self, Option<&gdk::Screen>) + 'static>(
822 &self,
823 f: F,
824 ) -> SignalHandlerId;
825
826 fn connect_scroll_event<F: Fn(&Self, &gdk::EventScroll) -> Inhibit + 'static>(
827 &self,
828 f: F,
829 ) -> SignalHandlerId;
830
831 fn connect_selection_clear_event<F: Fn(&Self, &gdk::EventSelection) -> Inhibit + 'static>(
832 &self,
833 f: F,
834 ) -> SignalHandlerId;
835
836 fn connect_selection_get<F: Fn(&Self, &SelectionData, u32, u32) + 'static>(
837 &self,
838 f: F,
839 ) -> SignalHandlerId;
840
841 fn connect_selection_notify_event<F: Fn(&Self, &gdk::EventSelection) -> Inhibit + 'static>(
842 &self,
843 f: F,
844 ) -> SignalHandlerId;
845
846 fn connect_selection_received<F: Fn(&Self, &SelectionData, u32) + 'static>(
847 &self,
848 f: F,
849 ) -> SignalHandlerId;
850
851 fn connect_selection_request_event<F: Fn(&Self, &gdk::EventSelection) -> Inhibit + 'static>(
852 &self,
853 f: F,
854 ) -> SignalHandlerId;
855
856 fn connect_show<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
857
858 fn connect_show_help<F: Fn(&Self, WidgetHelpType) -> bool + 'static>(
859 &self,
860 f: F,
861 ) -> SignalHandlerId;
862
863 fn emit_show_help(&self, help_type: WidgetHelpType) -> bool;
864
865 fn connect_size_allocate<F: Fn(&Self, &Allocation) + 'static>(&self, f: F) -> SignalHandlerId;
866
867 fn connect_state_flags_changed<F: Fn(&Self, StateFlags) + 'static>(
868 &self,
869 f: F,
870 ) -> SignalHandlerId;
871
872 fn connect_style_updated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
873
874 fn connect_touch_event<F: Fn(&Self, &gdk::Event) -> Inhibit + 'static>(
875 &self,
876 f: F,
877 ) -> SignalHandlerId;
878
879 fn connect_unmap<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
880
881 fn connect_unrealize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
882
883 fn connect_window_state_event<F: Fn(&Self, &gdk::EventWindowState) -> Inhibit + 'static>(
884 &self,
885 f: F,
886 ) -> SignalHandlerId;
887
888 fn connect_property_app_paintable_notify<F: Fn(&Self) + 'static>(
889 &self,
890 f: F,
891 ) -> SignalHandlerId;
892
893 fn connect_property_can_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
894
895 fn connect_property_can_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
896
897 fn connect_property_composite_child_notify<F: Fn(&Self) + 'static>(
898 &self,
899 f: F,
900 ) -> SignalHandlerId;
901
902 fn connect_property_events_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
903
904 fn connect_property_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
905
906 #[cfg(any(feature = "v3_20", feature = "dox"))]
907 fn connect_property_focus_on_click_notify<F: Fn(&Self) + 'static>(
908 &self,
909 f: F,
910 ) -> SignalHandlerId;
911
912 fn connect_property_halign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
913
914 fn connect_property_has_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
915
916 fn connect_property_has_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
917
918 fn connect_property_has_tooltip_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
919
920 fn connect_property_height_request_notify<F: Fn(&Self) + 'static>(
921 &self,
922 f: F,
923 ) -> SignalHandlerId;
924
925 fn connect_property_hexpand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
926
927 fn connect_property_hexpand_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
928
929 fn connect_property_is_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
930
931 fn connect_property_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
932
933 fn connect_property_margin_bottom_notify<F: Fn(&Self) + 'static>(
934 &self,
935 f: F,
936 ) -> SignalHandlerId;
937
938 fn connect_property_margin_end_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
939
940 fn connect_property_margin_start_notify<F: Fn(&Self) + 'static>(&self, f: F)
941 -> SignalHandlerId;
942
943 fn connect_property_margin_top_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
944
945 fn connect_property_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
946
947 fn connect_property_no_show_all_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
948
949 fn connect_property_opacity_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
950
951 fn connect_property_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
952
953 fn connect_property_receives_default_notify<F: Fn(&Self) + 'static>(
954 &self,
955 f: F,
956 ) -> SignalHandlerId;
957
958 fn connect_property_scale_factor_notify<F: Fn(&Self) + 'static>(&self, f: F)
959 -> SignalHandlerId;
960
961 fn connect_property_sensitive_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
962
963 fn connect_property_tooltip_markup_notify<F: Fn(&Self) + 'static>(
964 &self,
965 f: F,
966 ) -> SignalHandlerId;
967
968 fn connect_property_tooltip_text_notify<F: Fn(&Self) + 'static>(&self, f: F)
969 -> SignalHandlerId;
970
971 fn connect_property_valign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
972
973 fn connect_property_vexpand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
974
975 fn connect_property_vexpand_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
976
977 fn connect_property_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
978
979 fn connect_property_width_request_notify<F: Fn(&Self) + 'static>(
980 &self,
981 f: F,
982 ) -> SignalHandlerId;
983
984 fn connect_property_window_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
985}
986
987impl<O: IsA<Widget>> WidgetExt for O {
988 fn activate(&self) -> bool {
989 unsafe { from_glib(gtk_sys::gtk_widget_activate(self.as_ref().to_glib_none().0)) }
990 }
991
992 fn add_accelerator<P: IsA<AccelGroup>>(
993 &self,
994 accel_signal: &str,
995 accel_group: &P,
996 accel_key: u32,
997 accel_mods: gdk::ModifierType,
998 accel_flags: AccelFlags,
999 ) {
1000 unsafe {
1001 gtk_sys::gtk_widget_add_accelerator(
1002 self.as_ref().to_glib_none().0,
1003 accel_signal.to_glib_none().0,
1004 accel_group.as_ref().to_glib_none().0,
1005 accel_key,
1006 accel_mods.to_glib(),
1007 accel_flags.to_glib(),
1008 );
1009 }
1010 }
1011
1012 fn add_device_events(&self, device: &gdk::Device, events: gdk::EventMask) {
1013 unsafe {
1014 gtk_sys::gtk_widget_add_device_events(
1015 self.as_ref().to_glib_none().0,
1016 device.to_glib_none().0,
1017 events.to_glib(),
1018 );
1019 }
1020 }
1021
1022 fn add_mnemonic_label<P: IsA<Widget>>(&self, label: &P) {
1023 unsafe {
1024 gtk_sys::gtk_widget_add_mnemonic_label(
1025 self.as_ref().to_glib_none().0,
1026 label.as_ref().to_glib_none().0,
1027 );
1028 }
1029 }
1030
1031 fn can_activate_accel(&self, signal_id: u32) -> bool {
1032 unsafe {
1033 from_glib(gtk_sys::gtk_widget_can_activate_accel(
1034 self.as_ref().to_glib_none().0,
1035 signal_id,
1036 ))
1037 }
1038 }
1039
1040 fn child_focus(&self, direction: DirectionType) -> bool {
1041 unsafe {
1042 from_glib(gtk_sys::gtk_widget_child_focus(
1043 self.as_ref().to_glib_none().0,
1044 direction.to_glib(),
1045 ))
1046 }
1047 }
1048
1049 fn child_notify(&self, child_property: &str) {
1050 unsafe {
1051 gtk_sys::gtk_widget_child_notify(
1052 self.as_ref().to_glib_none().0,
1053 child_property.to_glib_none().0,
1054 );
1055 }
1056 }
1057
1058 fn compute_expand(&self, orientation: Orientation) -> bool {
1059 unsafe {
1060 from_glib(gtk_sys::gtk_widget_compute_expand(
1061 self.as_ref().to_glib_none().0,
1062 orientation.to_glib(),
1063 ))
1064 }
1065 }
1066
1067 fn create_pango_context(&self) -> Option<pango::Context> {
1068 unsafe {
1069 from_glib_full(gtk_sys::gtk_widget_create_pango_context(
1070 self.as_ref().to_glib_none().0,
1071 ))
1072 }
1073 }
1074
1075 fn create_pango_layout(&self, text: Option<&str>) -> Option<pango::Layout> {
1076 unsafe {
1077 from_glib_full(gtk_sys::gtk_widget_create_pango_layout(
1078 self.as_ref().to_glib_none().0,
1079 text.to_glib_none().0,
1080 ))
1081 }
1082 }
1083
1084 fn destroy(&self) {
1085 unsafe {
1086 gtk_sys::gtk_widget_destroy(self.as_ref().to_glib_none().0);
1087 }
1088 }
1089
1090 fn device_is_shadowed(&self, device: &gdk::Device) -> bool {
1095 unsafe {
1096 from_glib(gtk_sys::gtk_widget_device_is_shadowed(
1097 self.as_ref().to_glib_none().0,
1098 device.to_glib_none().0,
1099 ))
1100 }
1101 }
1102
1103 fn drag_begin_with_coordinates(
1104 &self,
1105 targets: &TargetList,
1106 actions: gdk::DragAction,
1107 button: i32,
1108 event: Option<&gdk::Event>,
1109 x: i32,
1110 y: i32,
1111 ) -> Option<gdk::DragContext> {
1112 unsafe {
1113 from_glib_none(gtk_sys::gtk_drag_begin_with_coordinates(
1114 self.as_ref().to_glib_none().0,
1115 targets.to_glib_none().0,
1116 actions.to_glib(),
1117 button,
1118 mut_override(event.to_glib_none().0),
1119 x,
1120 y,
1121 ))
1122 }
1123 }
1124
1125 fn drag_check_threshold(
1126 &self,
1127 start_x: i32,
1128 start_y: i32,
1129 current_x: i32,
1130 current_y: i32,
1131 ) -> bool {
1132 unsafe {
1133 from_glib(gtk_sys::gtk_drag_check_threshold(
1134 self.as_ref().to_glib_none().0,
1135 start_x,
1136 start_y,
1137 current_x,
1138 current_y,
1139 ))
1140 }
1141 }
1142
1143 fn drag_dest_add_image_targets(&self) {
1144 unsafe {
1145 gtk_sys::gtk_drag_dest_add_image_targets(self.as_ref().to_glib_none().0);
1146 }
1147 }
1148
1149 fn drag_dest_add_text_targets(&self) {
1150 unsafe {
1151 gtk_sys::gtk_drag_dest_add_text_targets(self.as_ref().to_glib_none().0);
1152 }
1153 }
1154
1155 fn drag_dest_add_uri_targets(&self) {
1156 unsafe {
1157 gtk_sys::gtk_drag_dest_add_uri_targets(self.as_ref().to_glib_none().0);
1158 }
1159 }
1160
1161 fn drag_dest_find_target(
1162 &self,
1163 context: &gdk::DragContext,
1164 target_list: Option<&TargetList>,
1165 ) -> Option<gdk::Atom> {
1166 unsafe {
1167 from_glib_none(gtk_sys::gtk_drag_dest_find_target(
1168 self.as_ref().to_glib_none().0,
1169 context.to_glib_none().0,
1170 target_list.to_glib_none().0,
1171 ))
1172 }
1173 }
1174
1175 fn drag_dest_get_target_list(&self) -> Option<TargetList> {
1176 unsafe {
1177 from_glib_none(gtk_sys::gtk_drag_dest_get_target_list(
1178 self.as_ref().to_glib_none().0,
1179 ))
1180 }
1181 }
1182
1183 fn drag_dest_get_track_motion(&self) -> bool {
1184 unsafe {
1185 from_glib(gtk_sys::gtk_drag_dest_get_track_motion(
1186 self.as_ref().to_glib_none().0,
1187 ))
1188 }
1189 }
1190
1191 fn drag_dest_set_proxy<P: IsA<gdk::Window>>(
1192 &self,
1193 proxy_window: &P,
1194 protocol: gdk::DragProtocol,
1195 use_coordinates: bool,
1196 ) {
1197 unsafe {
1198 gtk_sys::gtk_drag_dest_set_proxy(
1199 self.as_ref().to_glib_none().0,
1200 proxy_window.as_ref().to_glib_none().0,
1201 protocol.to_glib(),
1202 use_coordinates.to_glib(),
1203 );
1204 }
1205 }
1206
1207 fn drag_dest_set_target_list(&self, target_list: Option<&TargetList>) {
1208 unsafe {
1209 gtk_sys::gtk_drag_dest_set_target_list(
1210 self.as_ref().to_glib_none().0,
1211 target_list.to_glib_none().0,
1212 );
1213 }
1214 }
1215
1216 fn drag_dest_set_track_motion(&self, track_motion: bool) {
1217 unsafe {
1218 gtk_sys::gtk_drag_dest_set_track_motion(
1219 self.as_ref().to_glib_none().0,
1220 track_motion.to_glib(),
1221 );
1222 }
1223 }
1224
1225 fn drag_dest_unset(&self) {
1226 unsafe {
1227 gtk_sys::gtk_drag_dest_unset(self.as_ref().to_glib_none().0);
1228 }
1229 }
1230
1231 fn drag_get_data(&self, context: &gdk::DragContext, target: &gdk::Atom, time_: u32) {
1232 unsafe {
1233 gtk_sys::gtk_drag_get_data(
1234 self.as_ref().to_glib_none().0,
1235 context.to_glib_none().0,
1236 target.to_glib_none().0,
1237 time_,
1238 );
1239 }
1240 }
1241
1242 fn drag_highlight(&self) {
1243 unsafe {
1244 gtk_sys::gtk_drag_highlight(self.as_ref().to_glib_none().0);
1245 }
1246 }
1247
1248 fn drag_source_add_image_targets(&self) {
1249 unsafe {
1250 gtk_sys::gtk_drag_source_add_image_targets(self.as_ref().to_glib_none().0);
1251 }
1252 }
1253
1254 fn drag_source_add_text_targets(&self) {
1255 unsafe {
1256 gtk_sys::gtk_drag_source_add_text_targets(self.as_ref().to_glib_none().0);
1257 }
1258 }
1259
1260 fn drag_source_add_uri_targets(&self) {
1261 unsafe {
1262 gtk_sys::gtk_drag_source_add_uri_targets(self.as_ref().to_glib_none().0);
1263 }
1264 }
1265
1266 fn drag_source_get_target_list(&self) -> Option<TargetList> {
1267 unsafe {
1268 from_glib_none(gtk_sys::gtk_drag_source_get_target_list(
1269 self.as_ref().to_glib_none().0,
1270 ))
1271 }
1272 }
1273
1274 fn drag_source_set_icon_gicon<P: IsA<gio::Icon>>(&self, icon: &P) {
1275 unsafe {
1276 gtk_sys::gtk_drag_source_set_icon_gicon(
1277 self.as_ref().to_glib_none().0,
1278 icon.as_ref().to_glib_none().0,
1279 );
1280 }
1281 }
1282
1283 fn drag_source_set_icon_name(&self, icon_name: &str) {
1284 unsafe {
1285 gtk_sys::gtk_drag_source_set_icon_name(
1286 self.as_ref().to_glib_none().0,
1287 icon_name.to_glib_none().0,
1288 );
1289 }
1290 }
1291
1292 fn drag_source_set_icon_pixbuf(&self, pixbuf: &gdk_pixbuf::Pixbuf) {
1293 unsafe {
1294 gtk_sys::gtk_drag_source_set_icon_pixbuf(
1295 self.as_ref().to_glib_none().0,
1296 pixbuf.to_glib_none().0,
1297 );
1298 }
1299 }
1300
1301 fn drag_source_set_target_list(&self, target_list: Option<&TargetList>) {
1302 unsafe {
1303 gtk_sys::gtk_drag_source_set_target_list(
1304 self.as_ref().to_glib_none().0,
1305 target_list.to_glib_none().0,
1306 );
1307 }
1308 }
1309
1310 fn drag_source_unset(&self) {
1311 unsafe {
1312 gtk_sys::gtk_drag_source_unset(self.as_ref().to_glib_none().0);
1313 }
1314 }
1315
1316 fn drag_unhighlight(&self) {
1317 unsafe {
1318 gtk_sys::gtk_drag_unhighlight(self.as_ref().to_glib_none().0);
1319 }
1320 }
1321
1322 fn draw(&self, cr: &cairo::Context) {
1323 unsafe {
1324 gtk_sys::gtk_widget_draw(
1325 self.as_ref().to_glib_none().0,
1326 mut_override(cr.to_glib_none().0),
1327 );
1328 }
1329 }
1330
1331 fn error_bell(&self) {
1332 unsafe {
1333 gtk_sys::gtk_widget_error_bell(self.as_ref().to_glib_none().0);
1334 }
1335 }
1336
1337 fn event(&self, event: &gdk::Event) -> bool {
1338 unsafe {
1339 from_glib(gtk_sys::gtk_widget_event(
1340 self.as_ref().to_glib_none().0,
1341 mut_override(event.to_glib_none().0),
1342 ))
1343 }
1344 }
1345
1346 fn freeze_child_notify(&self) {
1347 unsafe {
1348 gtk_sys::gtk_widget_freeze_child_notify(self.as_ref().to_glib_none().0);
1349 }
1350 }
1351
1352 fn get_accessible(&self) -> Option<atk::Object> {
1353 unsafe {
1354 from_glib_none(gtk_sys::gtk_widget_get_accessible(
1355 self.as_ref().to_glib_none().0,
1356 ))
1357 }
1358 }
1359
1360 #[cfg(any(feature = "v3_16", feature = "dox"))]
1361 fn get_action_group(&self, prefix: &str) -> Option<gio::ActionGroup> {
1362 unsafe {
1363 from_glib_none(gtk_sys::gtk_widget_get_action_group(
1364 self.as_ref().to_glib_none().0,
1365 prefix.to_glib_none().0,
1366 ))
1367 }
1368 }
1369
1370 fn get_allocated_baseline(&self) -> i32 {
1371 unsafe { gtk_sys::gtk_widget_get_allocated_baseline(self.as_ref().to_glib_none().0) }
1372 }
1373
1374 fn get_allocated_height(&self) -> i32 {
1375 unsafe { gtk_sys::gtk_widget_get_allocated_height(self.as_ref().to_glib_none().0) }
1376 }
1377
1378 #[cfg(any(feature = "v3_20", feature = "dox"))]
1379 fn get_allocated_size(&self) -> (Allocation, i32) {
1380 unsafe {
1381 let mut allocation = Allocation::uninitialized();
1382 let mut baseline = mem::uninitialized();
1383 gtk_sys::gtk_widget_get_allocated_size(
1384 self.as_ref().to_glib_none().0,
1385 allocation.to_glib_none_mut().0,
1386 &mut baseline,
1387 );
1388 (allocation, baseline)
1389 }
1390 }
1391
1392 fn get_allocated_width(&self) -> i32 {
1393 unsafe { gtk_sys::gtk_widget_get_allocated_width(self.as_ref().to_glib_none().0) }
1394 }
1395
1396 fn get_allocation(&self) -> Allocation {
1397 unsafe {
1398 let mut allocation = Allocation::uninitialized();
1399 gtk_sys::gtk_widget_get_allocation(
1400 self.as_ref().to_glib_none().0,
1401 allocation.to_glib_none_mut().0,
1402 );
1403 allocation
1404 }
1405 }
1406
1407 fn get_ancestor(&self, widget_type: glib::types::Type) -> Option<Widget> {
1408 unsafe {
1409 from_glib_none(gtk_sys::gtk_widget_get_ancestor(
1410 self.as_ref().to_glib_none().0,
1411 widget_type.to_glib(),
1412 ))
1413 }
1414 }
1415
1416 fn get_app_paintable(&self) -> bool {
1417 unsafe {
1418 from_glib(gtk_sys::gtk_widget_get_app_paintable(
1419 self.as_ref().to_glib_none().0,
1420 ))
1421 }
1422 }
1423
1424 fn get_can_default(&self) -> bool {
1425 unsafe {
1426 from_glib(gtk_sys::gtk_widget_get_can_default(
1427 self.as_ref().to_glib_none().0,
1428 ))
1429 }
1430 }
1431
1432 fn get_can_focus(&self) -> bool {
1433 unsafe {
1434 from_glib(gtk_sys::gtk_widget_get_can_focus(
1435 self.as_ref().to_glib_none().0,
1436 ))
1437 }
1438 }
1439
1440 fn get_child_visible(&self) -> bool {
1441 unsafe {
1442 from_glib(gtk_sys::gtk_widget_get_child_visible(
1443 self.as_ref().to_glib_none().0,
1444 ))
1445 }
1446 }
1447
1448 fn get_clip(&self) -> Allocation {
1449 unsafe {
1450 let mut clip = Allocation::uninitialized();
1451 gtk_sys::gtk_widget_get_clip(self.as_ref().to_glib_none().0, clip.to_glib_none_mut().0);
1452 clip
1453 }
1454 }
1455
1456 fn get_clipboard(&self, selection: &gdk::Atom) -> Clipboard {
1457 unsafe {
1458 from_glib_none(gtk_sys::gtk_widget_get_clipboard(
1459 self.as_ref().to_glib_none().0,
1460 selection.to_glib_none().0,
1461 ))
1462 }
1463 }
1464
1465 fn get_device_enabled(&self, device: &gdk::Device) -> bool {
1466 unsafe {
1467 from_glib(gtk_sys::gtk_widget_get_device_enabled(
1468 self.as_ref().to_glib_none().0,
1469 device.to_glib_none().0,
1470 ))
1471 }
1472 }
1473
1474 fn get_device_events(&self, device: &gdk::Device) -> gdk::EventMask {
1475 unsafe {
1476 from_glib(gtk_sys::gtk_widget_get_device_events(
1477 self.as_ref().to_glib_none().0,
1478 device.to_glib_none().0,
1479 ))
1480 }
1481 }
1482
1483 fn get_direction(&self) -> TextDirection {
1484 unsafe {
1485 from_glib(gtk_sys::gtk_widget_get_direction(
1486 self.as_ref().to_glib_none().0,
1487 ))
1488 }
1489 }
1490
1491 fn get_display(&self) -> Option<gdk::Display> {
1492 unsafe {
1493 from_glib_none(gtk_sys::gtk_widget_get_display(
1494 self.as_ref().to_glib_none().0,
1495 ))
1496 }
1497 }
1498
1499 fn get_double_buffered(&self) -> bool {
1500 unsafe {
1501 from_glib(gtk_sys::gtk_widget_get_double_buffered(
1502 self.as_ref().to_glib_none().0,
1503 ))
1504 }
1505 }
1506
1507 #[cfg(any(feature = "v3_20", feature = "dox"))]
1508 fn get_focus_on_click(&self) -> bool {
1509 unsafe {
1510 from_glib(gtk_sys::gtk_widget_get_focus_on_click(
1511 self.as_ref().to_glib_none().0,
1512 ))
1513 }
1514 }
1515
1516 #[cfg(any(feature = "v3_18", feature = "dox"))]
1517 fn get_font_map(&self) -> Option<pango::FontMap> {
1518 unsafe {
1519 from_glib_none(gtk_sys::gtk_widget_get_font_map(
1520 self.as_ref().to_glib_none().0,
1521 ))
1522 }
1523 }
1524
1525 #[cfg(any(feature = "v3_18", feature = "dox"))]
1526 fn get_font_options(&self) -> Option<cairo::FontOptions> {
1527 unsafe {
1528 from_glib_none(gtk_sys::gtk_widget_get_font_options(
1529 self.as_ref().to_glib_none().0,
1530 ))
1531 }
1532 }
1533
1534 fn get_frame_clock(&self) -> Option<gdk::FrameClock> {
1535 unsafe {
1536 from_glib_none(gtk_sys::gtk_widget_get_frame_clock(
1537 self.as_ref().to_glib_none().0,
1538 ))
1539 }
1540 }
1541
1542 fn get_halign(&self) -> Align {
1543 unsafe {
1544 from_glib(gtk_sys::gtk_widget_get_halign(
1545 self.as_ref().to_glib_none().0,
1546 ))
1547 }
1548 }
1549
1550 fn get_has_tooltip(&self) -> bool {
1551 unsafe {
1552 from_glib(gtk_sys::gtk_widget_get_has_tooltip(
1553 self.as_ref().to_glib_none().0,
1554 ))
1555 }
1556 }
1557
1558 fn get_has_window(&self) -> bool {
1559 unsafe {
1560 from_glib(gtk_sys::gtk_widget_get_has_window(
1561 self.as_ref().to_glib_none().0,
1562 ))
1563 }
1564 }
1565
1566 fn get_hexpand(&self) -> bool {
1567 unsafe {
1568 from_glib(gtk_sys::gtk_widget_get_hexpand(
1569 self.as_ref().to_glib_none().0,
1570 ))
1571 }
1572 }
1573
1574 fn get_hexpand_set(&self) -> bool {
1575 unsafe {
1576 from_glib(gtk_sys::gtk_widget_get_hexpand_set(
1577 self.as_ref().to_glib_none().0,
1578 ))
1579 }
1580 }
1581
1582 fn get_mapped(&self) -> bool {
1583 unsafe {
1584 from_glib(gtk_sys::gtk_widget_get_mapped(
1585 self.as_ref().to_glib_none().0,
1586 ))
1587 }
1588 }
1589
1590 fn get_margin_bottom(&self) -> i32 {
1591 unsafe { gtk_sys::gtk_widget_get_margin_bottom(self.as_ref().to_glib_none().0) }
1592 }
1593
1594 fn get_margin_end(&self) -> i32 {
1595 unsafe { gtk_sys::gtk_widget_get_margin_end(self.as_ref().to_glib_none().0) }
1596 }
1597
1598 fn get_margin_start(&self) -> i32 {
1599 unsafe { gtk_sys::gtk_widget_get_margin_start(self.as_ref().to_glib_none().0) }
1600 }
1601
1602 fn get_margin_top(&self) -> i32 {
1603 unsafe { gtk_sys::gtk_widget_get_margin_top(self.as_ref().to_glib_none().0) }
1604 }
1605
1606 fn get_modifier_mask(&self, intent: gdk::ModifierIntent) -> gdk::ModifierType {
1607 unsafe {
1608 from_glib(gtk_sys::gtk_widget_get_modifier_mask(
1609 self.as_ref().to_glib_none().0,
1610 intent.to_glib(),
1611 ))
1612 }
1613 }
1614
1615 fn get_name(&self) -> Option<GString> {
1616 unsafe { from_glib_none(gtk_sys::gtk_widget_get_name(self.as_ref().to_glib_none().0)) }
1617 }
1618
1619 fn get_no_show_all(&self) -> bool {
1620 unsafe {
1621 from_glib(gtk_sys::gtk_widget_get_no_show_all(
1622 self.as_ref().to_glib_none().0,
1623 ))
1624 }
1625 }
1626
1627 fn get_opacity(&self) -> f64 {
1628 unsafe { gtk_sys::gtk_widget_get_opacity(self.as_ref().to_glib_none().0) }
1629 }
1630
1631 fn get_pango_context(&self) -> Option<pango::Context> {
1632 unsafe {
1633 from_glib_none(gtk_sys::gtk_widget_get_pango_context(
1634 self.as_ref().to_glib_none().0,
1635 ))
1636 }
1637 }
1638
1639 fn get_parent(&self) -> Option<Widget> {
1640 unsafe {
1641 from_glib_none(gtk_sys::gtk_widget_get_parent(
1642 self.as_ref().to_glib_none().0,
1643 ))
1644 }
1645 }
1646
1647 fn get_parent_window(&self) -> Option<gdk::Window> {
1648 unsafe {
1649 from_glib_none(gtk_sys::gtk_widget_get_parent_window(
1650 self.as_ref().to_glib_none().0,
1651 ))
1652 }
1653 }
1654
1655 fn get_path(&self) -> WidgetPath {
1656 unsafe { from_glib_none(gtk_sys::gtk_widget_get_path(self.as_ref().to_glib_none().0)) }
1657 }
1658
1659 fn get_preferred_height(&self) -> (i32, i32) {
1660 unsafe {
1661 let mut minimum_height = mem::uninitialized();
1662 let mut natural_height = mem::uninitialized();
1663 gtk_sys::gtk_widget_get_preferred_height(
1664 self.as_ref().to_glib_none().0,
1665 &mut minimum_height,
1666 &mut natural_height,
1667 );
1668 (minimum_height, natural_height)
1669 }
1670 }
1671
1672 fn get_preferred_height_and_baseline_for_width(&self, width: i32) -> (i32, i32, i32, i32) {
1673 unsafe {
1674 let mut minimum_height = mem::uninitialized();
1675 let mut natural_height = mem::uninitialized();
1676 let mut minimum_baseline = mem::uninitialized();
1677 let mut natural_baseline = mem::uninitialized();
1678 gtk_sys::gtk_widget_get_preferred_height_and_baseline_for_width(
1679 self.as_ref().to_glib_none().0,
1680 width,
1681 &mut minimum_height,
1682 &mut natural_height,
1683 &mut minimum_baseline,
1684 &mut natural_baseline,
1685 );
1686 (
1687 minimum_height,
1688 natural_height,
1689 minimum_baseline,
1690 natural_baseline,
1691 )
1692 }
1693 }
1694
1695 fn get_preferred_height_for_width(&self, width: i32) -> (i32, i32) {
1696 unsafe {
1697 let mut minimum_height = mem::uninitialized();
1698 let mut natural_height = mem::uninitialized();
1699 gtk_sys::gtk_widget_get_preferred_height_for_width(
1700 self.as_ref().to_glib_none().0,
1701 width,
1702 &mut minimum_height,
1703 &mut natural_height,
1704 );
1705 (minimum_height, natural_height)
1706 }
1707 }
1708
1709 fn get_preferred_size(&self) -> (Requisition, Requisition) {
1710 unsafe {
1711 let mut minimum_size = Requisition::uninitialized();
1712 let mut natural_size = Requisition::uninitialized();
1713 gtk_sys::gtk_widget_get_preferred_size(
1714 self.as_ref().to_glib_none().0,
1715 minimum_size.to_glib_none_mut().0,
1716 natural_size.to_glib_none_mut().0,
1717 );
1718 (minimum_size, natural_size)
1719 }
1720 }
1721
1722 fn get_preferred_width(&self) -> (i32, i32) {
1723 unsafe {
1724 let mut minimum_width = mem::uninitialized();
1725 let mut natural_width = mem::uninitialized();
1726 gtk_sys::gtk_widget_get_preferred_width(
1727 self.as_ref().to_glib_none().0,
1728 &mut minimum_width,
1729 &mut natural_width,
1730 );
1731 (minimum_width, natural_width)
1732 }
1733 }
1734
1735 fn get_preferred_width_for_height(&self, height: i32) -> (i32, i32) {
1736 unsafe {
1737 let mut minimum_width = mem::uninitialized();
1738 let mut natural_width = mem::uninitialized();
1739 gtk_sys::gtk_widget_get_preferred_width_for_height(
1740 self.as_ref().to_glib_none().0,
1741 height,
1742 &mut minimum_width,
1743 &mut natural_width,
1744 );
1745 (minimum_width, natural_width)
1746 }
1747 }
1748
1749 fn get_realized(&self) -> bool {
1750 unsafe {
1751 from_glib(gtk_sys::gtk_widget_get_realized(
1752 self.as_ref().to_glib_none().0,
1753 ))
1754 }
1755 }
1756
1757 fn get_receives_default(&self) -> bool {
1758 unsafe {
1759 from_glib(gtk_sys::gtk_widget_get_receives_default(
1760 self.as_ref().to_glib_none().0,
1761 ))
1762 }
1763 }
1764
1765 fn get_request_mode(&self) -> SizeRequestMode {
1766 unsafe {
1767 from_glib(gtk_sys::gtk_widget_get_request_mode(
1768 self.as_ref().to_glib_none().0,
1769 ))
1770 }
1771 }
1772
1773 fn get_scale_factor(&self) -> i32 {
1774 unsafe { gtk_sys::gtk_widget_get_scale_factor(self.as_ref().to_glib_none().0) }
1775 }
1776
1777 fn get_screen(&self) -> Option<gdk::Screen> {
1778 unsafe {
1779 from_glib_none(gtk_sys::gtk_widget_get_screen(
1780 self.as_ref().to_glib_none().0,
1781 ))
1782 }
1783 }
1784
1785 fn get_sensitive(&self) -> bool {
1786 unsafe {
1787 from_glib(gtk_sys::gtk_widget_get_sensitive(
1788 self.as_ref().to_glib_none().0,
1789 ))
1790 }
1791 }
1792
1793 fn get_settings(&self) -> Option<Settings> {
1794 unsafe {
1795 from_glib_none(gtk_sys::gtk_widget_get_settings(
1796 self.as_ref().to_glib_none().0,
1797 ))
1798 }
1799 }
1800
1801 fn get_size_request(&self) -> (i32, i32) {
1802 unsafe {
1803 let mut width = mem::uninitialized();
1804 let mut height = mem::uninitialized();
1805 gtk_sys::gtk_widget_get_size_request(
1806 self.as_ref().to_glib_none().0,
1807 &mut width,
1808 &mut height,
1809 );
1810 (width, height)
1811 }
1812 }
1813
1814 fn get_state_flags(&self) -> StateFlags {
1815 unsafe {
1816 from_glib(gtk_sys::gtk_widget_get_state_flags(
1817 self.as_ref().to_glib_none().0,
1818 ))
1819 }
1820 }
1821
1822 fn get_style_context(&self) -> StyleContext {
1823 unsafe {
1824 from_glib_none(gtk_sys::gtk_widget_get_style_context(
1825 self.as_ref().to_glib_none().0,
1826 ))
1827 }
1828 }
1829
1830 fn get_support_multidevice(&self) -> bool {
1831 unsafe {
1832 from_glib(gtk_sys::gtk_widget_get_support_multidevice(
1833 self.as_ref().to_glib_none().0,
1834 ))
1835 }
1836 }
1837
1838 fn get_template_child(
1839 &self,
1840 widget_type: glib::types::Type,
1841 name: &str,
1842 ) -> Option<glib::Object> {
1843 unsafe {
1844 from_glib_none(gtk_sys::gtk_widget_get_template_child(
1845 self.as_ref().to_glib_none().0,
1846 widget_type.to_glib(),
1847 name.to_glib_none().0,
1848 ))
1849 }
1850 }
1851
1852 fn get_tooltip_markup(&self) -> Option<GString> {
1853 unsafe {
1854 from_glib_full(gtk_sys::gtk_widget_get_tooltip_markup(
1855 self.as_ref().to_glib_none().0,
1856 ))
1857 }
1858 }
1859
1860 fn get_tooltip_text(&self) -> Option<GString> {
1861 unsafe {
1862 from_glib_full(gtk_sys::gtk_widget_get_tooltip_text(
1863 self.as_ref().to_glib_none().0,
1864 ))
1865 }
1866 }
1867
1868 fn get_tooltip_window(&self) -> Option<Window> {
1869 unsafe {
1870 from_glib_none(gtk_sys::gtk_widget_get_tooltip_window(
1871 self.as_ref().to_glib_none().0,
1872 ))
1873 }
1874 }
1875
1876 fn get_toplevel(&self) -> Option<Widget> {
1877 unsafe {
1878 from_glib_none(gtk_sys::gtk_widget_get_toplevel(
1879 self.as_ref().to_glib_none().0,
1880 ))
1881 }
1882 }
1883
1884 fn get_valign(&self) -> Align {
1885 unsafe {
1886 from_glib(gtk_sys::gtk_widget_get_valign(
1887 self.as_ref().to_glib_none().0,
1888 ))
1889 }
1890 }
1891
1892 fn get_valign_with_baseline(&self) -> Align {
1893 unsafe {
1894 from_glib(gtk_sys::gtk_widget_get_valign_with_baseline(
1895 self.as_ref().to_glib_none().0,
1896 ))
1897 }
1898 }
1899
1900 fn get_vexpand(&self) -> bool {
1901 unsafe {
1902 from_glib(gtk_sys::gtk_widget_get_vexpand(
1903 self.as_ref().to_glib_none().0,
1904 ))
1905 }
1906 }
1907
1908 fn get_vexpand_set(&self) -> bool {
1909 unsafe {
1910 from_glib(gtk_sys::gtk_widget_get_vexpand_set(
1911 self.as_ref().to_glib_none().0,
1912 ))
1913 }
1914 }
1915
1916 fn get_visible(&self) -> bool {
1917 unsafe {
1918 from_glib(gtk_sys::gtk_widget_get_visible(
1919 self.as_ref().to_glib_none().0,
1920 ))
1921 }
1922 }
1923
1924 fn get_visual(&self) -> Option<gdk::Visual> {
1925 unsafe {
1926 from_glib_none(gtk_sys::gtk_widget_get_visual(
1927 self.as_ref().to_glib_none().0,
1928 ))
1929 }
1930 }
1931
1932 fn get_window(&self) -> Option<gdk::Window> {
1933 unsafe {
1934 from_glib_none(gtk_sys::gtk_widget_get_window(
1935 self.as_ref().to_glib_none().0,
1936 ))
1937 }
1938 }
1939
1940 fn grab_add(&self) {
1941 unsafe {
1942 gtk_sys::gtk_grab_add(self.as_ref().to_glib_none().0);
1943 }
1944 }
1945
1946 fn grab_default(&self) {
1947 unsafe {
1948 gtk_sys::gtk_widget_grab_default(self.as_ref().to_glib_none().0);
1949 }
1950 }
1951
1952 fn grab_focus(&self) {
1953 unsafe {
1954 gtk_sys::gtk_widget_grab_focus(self.as_ref().to_glib_none().0);
1955 }
1956 }
1957
1958 fn grab_remove(&self) {
1959 unsafe {
1960 gtk_sys::gtk_grab_remove(self.as_ref().to_glib_none().0);
1961 }
1962 }
1963
1964 fn has_default(&self) -> bool {
1965 unsafe {
1966 from_glib(gtk_sys::gtk_widget_has_default(
1967 self.as_ref().to_glib_none().0,
1968 ))
1969 }
1970 }
1971
1972 fn has_focus(&self) -> bool {
1973 unsafe {
1974 from_glib(gtk_sys::gtk_widget_has_focus(
1975 self.as_ref().to_glib_none().0,
1976 ))
1977 }
1978 }
1979
1980 fn has_grab(&self) -> bool {
1981 unsafe { from_glib(gtk_sys::gtk_widget_has_grab(self.as_ref().to_glib_none().0)) }
1982 }
1983
1984 fn has_screen(&self) -> bool {
1985 unsafe {
1986 from_glib(gtk_sys::gtk_widget_has_screen(
1987 self.as_ref().to_glib_none().0,
1988 ))
1989 }
1990 }
1991
1992 fn has_visible_focus(&self) -> bool {
1993 unsafe {
1994 from_glib(gtk_sys::gtk_widget_has_visible_focus(
1995 self.as_ref().to_glib_none().0,
1996 ))
1997 }
1998 }
1999
2000 fn hide(&self) {
2001 unsafe {
2002 gtk_sys::gtk_widget_hide(self.as_ref().to_glib_none().0);
2003 }
2004 }
2005
2006 fn hide_on_delete(&self) -> bool {
2007 unsafe {
2008 from_glib(gtk_sys::gtk_widget_hide_on_delete(
2009 self.as_ref().to_glib_none().0,
2010 ))
2011 }
2012 }
2013
2014 fn in_destruction(&self) -> bool {
2015 unsafe {
2016 from_glib(gtk_sys::gtk_widget_in_destruction(
2017 self.as_ref().to_glib_none().0,
2018 ))
2019 }
2020 }
2021
2022 fn init_template(&self) {
2023 unsafe {
2024 gtk_sys::gtk_widget_init_template(self.as_ref().to_glib_none().0);
2025 }
2026 }
2027
2028 fn input_shape_combine_region(&self, region: Option<&cairo::Region>) {
2029 unsafe {
2030 gtk_sys::gtk_widget_input_shape_combine_region(
2031 self.as_ref().to_glib_none().0,
2032 mut_override(region.to_glib_none().0),
2033 );
2034 }
2035 }
2036
2037 fn insert_action_group<P: IsA<gio::ActionGroup>>(&self, name: &str, group: Option<&P>) {
2038 unsafe {
2039 gtk_sys::gtk_widget_insert_action_group(
2040 self.as_ref().to_glib_none().0,
2041 name.to_glib_none().0,
2042 group.map(|p| p.as_ref()).to_glib_none().0,
2043 );
2044 }
2045 }
2046
2047 fn is_ancestor<P: IsA<Widget>>(&self, ancestor: &P) -> bool {
2048 unsafe {
2049 from_glib(gtk_sys::gtk_widget_is_ancestor(
2050 self.as_ref().to_glib_none().0,
2051 ancestor.as_ref().to_glib_none().0,
2052 ))
2053 }
2054 }
2055
2056 fn is_composited(&self) -> bool {
2057 unsafe {
2058 from_glib(gtk_sys::gtk_widget_is_composited(
2059 self.as_ref().to_glib_none().0,
2060 ))
2061 }
2062 }
2063
2064 fn is_drawable(&self) -> bool {
2065 unsafe {
2066 from_glib(gtk_sys::gtk_widget_is_drawable(
2067 self.as_ref().to_glib_none().0,
2068 ))
2069 }
2070 }
2071
2072 fn is_focus(&self) -> bool {
2073 unsafe { from_glib(gtk_sys::gtk_widget_is_focus(self.as_ref().to_glib_none().0)) }
2074 }
2075
2076 fn is_sensitive(&self) -> bool {
2077 unsafe {
2078 from_glib(gtk_sys::gtk_widget_is_sensitive(
2079 self.as_ref().to_glib_none().0,
2080 ))
2081 }
2082 }
2083
2084 fn is_toplevel(&self) -> bool {
2085 unsafe {
2086 from_glib(gtk_sys::gtk_widget_is_toplevel(
2087 self.as_ref().to_glib_none().0,
2088 ))
2089 }
2090 }
2091
2092 fn is_visible(&self) -> bool {
2093 unsafe {
2094 from_glib(gtk_sys::gtk_widget_is_visible(
2095 self.as_ref().to_glib_none().0,
2096 ))
2097 }
2098 }
2099
2100 fn keynav_failed(&self, direction: DirectionType) -> bool {
2101 unsafe {
2102 from_glib(gtk_sys::gtk_widget_keynav_failed(
2103 self.as_ref().to_glib_none().0,
2104 direction.to_glib(),
2105 ))
2106 }
2107 }
2108
2109 fn list_accel_closures(&self) -> Vec<glib::Closure> {
2110 unsafe {
2111 FromGlibPtrContainer::from_glib_container(gtk_sys::gtk_widget_list_accel_closures(
2112 self.as_ref().to_glib_none().0,
2113 ))
2114 }
2115 }
2116
2117 #[cfg(any(feature = "v3_16", feature = "dox"))]
2118 fn list_action_prefixes(&self) -> Vec<GString> {
2119 unsafe {
2120 FromGlibPtrContainer::from_glib_container(gtk_sys::gtk_widget_list_action_prefixes(
2121 self.as_ref().to_glib_none().0,
2122 ))
2123 }
2124 }
2125
2126 fn list_mnemonic_labels(&self) -> Vec<Widget> {
2127 unsafe {
2128 FromGlibPtrContainer::from_glib_container(gtk_sys::gtk_widget_list_mnemonic_labels(
2129 self.as_ref().to_glib_none().0,
2130 ))
2131 }
2132 }
2133
2134 fn map(&self) {
2135 unsafe {
2136 gtk_sys::gtk_widget_map(self.as_ref().to_glib_none().0);
2137 }
2138 }
2139
2140 fn mnemonic_activate(&self, group_cycling: bool) -> bool {
2141 unsafe {
2142 from_glib(gtk_sys::gtk_widget_mnemonic_activate(
2143 self.as_ref().to_glib_none().0,
2144 group_cycling.to_glib(),
2145 ))
2146 }
2147 }
2148
2149 fn override_background_color(&self, state: StateFlags, color: Option<&gdk::RGBA>) {
2150 unsafe {
2151 gtk_sys::gtk_widget_override_background_color(
2152 self.as_ref().to_glib_none().0,
2153 state.to_glib(),
2154 color.to_glib_none().0,
2155 );
2156 }
2157 }
2158
2159 fn override_color(&self, state: StateFlags, color: Option<&gdk::RGBA>) {
2160 unsafe {
2161 gtk_sys::gtk_widget_override_color(
2162 self.as_ref().to_glib_none().0,
2163 state.to_glib(),
2164 color.to_glib_none().0,
2165 );
2166 }
2167 }
2168
2169 fn override_cursor(&self, cursor: Option<&gdk::RGBA>, secondary_cursor: Option<&gdk::RGBA>) {
2170 unsafe {
2171 gtk_sys::gtk_widget_override_cursor(
2172 self.as_ref().to_glib_none().0,
2173 cursor.to_glib_none().0,
2174 secondary_cursor.to_glib_none().0,
2175 );
2176 }
2177 }
2178
2179 fn override_font(&self, font_desc: Option<&pango::FontDescription>) {
2180 unsafe {
2181 gtk_sys::gtk_widget_override_font(
2182 self.as_ref().to_glib_none().0,
2183 font_desc.to_glib_none().0,
2184 );
2185 }
2186 }
2187
2188 fn override_symbolic_color(&self, name: &str, color: Option<&gdk::RGBA>) {
2189 unsafe {
2190 gtk_sys::gtk_widget_override_symbolic_color(
2191 self.as_ref().to_glib_none().0,
2192 name.to_glib_none().0,
2193 color.to_glib_none().0,
2194 );
2195 }
2196 }
2197
2198 #[cfg(any(feature = "v3_20", feature = "dox"))]
2199 fn queue_allocate(&self) {
2200 unsafe {
2201 gtk_sys::gtk_widget_queue_allocate(self.as_ref().to_glib_none().0);
2202 }
2203 }
2204
2205 fn queue_compute_expand(&self) {
2206 unsafe {
2207 gtk_sys::gtk_widget_queue_compute_expand(self.as_ref().to_glib_none().0);
2208 }
2209 }
2210
2211 fn queue_draw(&self) {
2212 unsafe {
2213 gtk_sys::gtk_widget_queue_draw(self.as_ref().to_glib_none().0);
2214 }
2215 }
2216
2217 fn queue_draw_area(&self, x: i32, y: i32, width: i32, height: i32) {
2218 unsafe {
2219 gtk_sys::gtk_widget_queue_draw_area(
2220 self.as_ref().to_glib_none().0,
2221 x,
2222 y,
2223 width,
2224 height,
2225 );
2226 }
2227 }
2228
2229 fn queue_draw_region(&self, region: &cairo::Region) {
2230 unsafe {
2231 gtk_sys::gtk_widget_queue_draw_region(
2232 self.as_ref().to_glib_none().0,
2233 region.to_glib_none().0,
2234 );
2235 }
2236 }
2237
2238 fn queue_resize(&self) {
2239 unsafe {
2240 gtk_sys::gtk_widget_queue_resize(self.as_ref().to_glib_none().0);
2241 }
2242 }
2243
2244 fn queue_resize_no_redraw(&self) {
2245 unsafe {
2246 gtk_sys::gtk_widget_queue_resize_no_redraw(self.as_ref().to_glib_none().0);
2247 }
2248 }
2249
2250 fn realize(&self) {
2251 unsafe {
2252 gtk_sys::gtk_widget_realize(self.as_ref().to_glib_none().0);
2253 }
2254 }
2255
2256 fn register_window<P: IsA<gdk::Window>>(&self, window: &P) {
2257 unsafe {
2258 gtk_sys::gtk_widget_register_window(
2259 self.as_ref().to_glib_none().0,
2260 window.as_ref().to_glib_none().0,
2261 );
2262 }
2263 }
2264
2265 fn remove_accelerator<P: IsA<AccelGroup>>(
2266 &self,
2267 accel_group: &P,
2268 accel_key: u32,
2269 accel_mods: gdk::ModifierType,
2270 ) -> bool {
2271 unsafe {
2272 from_glib(gtk_sys::gtk_widget_remove_accelerator(
2273 self.as_ref().to_glib_none().0,
2274 accel_group.as_ref().to_glib_none().0,
2275 accel_key,
2276 accel_mods.to_glib(),
2277 ))
2278 }
2279 }
2280
2281 fn remove_mnemonic_label<P: IsA<Widget>>(&self, label: &P) {
2282 unsafe {
2283 gtk_sys::gtk_widget_remove_mnemonic_label(
2284 self.as_ref().to_glib_none().0,
2285 label.as_ref().to_glib_none().0,
2286 );
2287 }
2288 }
2289
2290 fn reset_style(&self) {
2291 unsafe {
2292 gtk_sys::gtk_widget_reset_style(self.as_ref().to_glib_none().0);
2293 }
2294 }
2295
2296 fn send_expose(&self, event: &gdk::Event) -> i32 {
2297 unsafe {
2298 gtk_sys::gtk_widget_send_expose(
2299 self.as_ref().to_glib_none().0,
2300 mut_override(event.to_glib_none().0),
2301 )
2302 }
2303 }
2304
2305 fn send_focus_change(&self, event: &gdk::Event) -> bool {
2306 unsafe {
2307 from_glib(gtk_sys::gtk_widget_send_focus_change(
2308 self.as_ref().to_glib_none().0,
2309 mut_override(event.to_glib_none().0),
2310 ))
2311 }
2312 }
2313
2314 fn set_accel_path<P: IsA<AccelGroup>>(
2315 &self,
2316 accel_path: Option<&str>,
2317 accel_group: Option<&P>,
2318 ) {
2319 unsafe {
2320 gtk_sys::gtk_widget_set_accel_path(
2321 self.as_ref().to_glib_none().0,
2322 accel_path.to_glib_none().0,
2323 accel_group.map(|p| p.as_ref()).to_glib_none().0,
2324 );
2325 }
2326 }
2327
2328 fn set_allocation(&self, allocation: &Allocation) {
2329 unsafe {
2330 gtk_sys::gtk_widget_set_allocation(
2331 self.as_ref().to_glib_none().0,
2332 allocation.to_glib_none().0,
2333 );
2334 }
2335 }
2336
2337 fn set_app_paintable(&self, app_paintable: bool) {
2338 unsafe {
2339 gtk_sys::gtk_widget_set_app_paintable(
2340 self.as_ref().to_glib_none().0,
2341 app_paintable.to_glib(),
2342 );
2343 }
2344 }
2345
2346 fn set_can_default(&self, can_default: bool) {
2347 unsafe {
2348 gtk_sys::gtk_widget_set_can_default(
2349 self.as_ref().to_glib_none().0,
2350 can_default.to_glib(),
2351 );
2352 }
2353 }
2354
2355 fn set_can_focus(&self, can_focus: bool) {
2356 unsafe {
2357 gtk_sys::gtk_widget_set_can_focus(self.as_ref().to_glib_none().0, can_focus.to_glib());
2358 }
2359 }
2360
2361 fn set_child_visible(&self, is_visible: bool) {
2362 unsafe {
2363 gtk_sys::gtk_widget_set_child_visible(
2364 self.as_ref().to_glib_none().0,
2365 is_visible.to_glib(),
2366 );
2367 }
2368 }
2369
2370 fn set_clip(&self, clip: &Allocation) {
2371 unsafe {
2372 gtk_sys::gtk_widget_set_clip(self.as_ref().to_glib_none().0, clip.to_glib_none().0);
2373 }
2374 }
2375
2376 fn set_device_enabled(&self, device: &gdk::Device, enabled: bool) {
2377 unsafe {
2378 gtk_sys::gtk_widget_set_device_enabled(
2379 self.as_ref().to_glib_none().0,
2380 device.to_glib_none().0,
2381 enabled.to_glib(),
2382 );
2383 }
2384 }
2385
2386 fn set_device_events(&self, device: &gdk::Device, events: gdk::EventMask) {
2387 unsafe {
2388 gtk_sys::gtk_widget_set_device_events(
2389 self.as_ref().to_glib_none().0,
2390 device.to_glib_none().0,
2391 events.to_glib(),
2392 );
2393 }
2394 }
2395
2396 fn set_direction(&self, dir: TextDirection) {
2397 unsafe {
2398 gtk_sys::gtk_widget_set_direction(self.as_ref().to_glib_none().0, dir.to_glib());
2399 }
2400 }
2401
2402 #[cfg(any(feature = "v3_20", feature = "dox"))]
2403 fn set_focus_on_click(&self, focus_on_click: bool) {
2404 unsafe {
2405 gtk_sys::gtk_widget_set_focus_on_click(
2406 self.as_ref().to_glib_none().0,
2407 focus_on_click.to_glib(),
2408 );
2409 }
2410 }
2411
2412 #[cfg(any(feature = "v3_18", feature = "dox"))]
2413 fn set_font_map<P: IsA<pango::FontMap>>(&self, font_map: Option<&P>) {
2414 unsafe {
2415 gtk_sys::gtk_widget_set_font_map(
2416 self.as_ref().to_glib_none().0,
2417 font_map.map(|p| p.as_ref()).to_glib_none().0,
2418 );
2419 }
2420 }
2421
2422 #[cfg(any(feature = "v3_18", feature = "dox"))]
2423 fn set_font_options(&self, options: Option<&cairo::FontOptions>) {
2424 unsafe {
2425 gtk_sys::gtk_widget_set_font_options(
2426 self.as_ref().to_glib_none().0,
2427 options.to_glib_none().0,
2428 );
2429 }
2430 }
2431
2432 fn set_halign(&self, align: Align) {
2433 unsafe {
2434 gtk_sys::gtk_widget_set_halign(self.as_ref().to_glib_none().0, align.to_glib());
2435 }
2436 }
2437
2438 fn set_has_tooltip(&self, has_tooltip: bool) {
2439 unsafe {
2440 gtk_sys::gtk_widget_set_has_tooltip(
2441 self.as_ref().to_glib_none().0,
2442 has_tooltip.to_glib(),
2443 );
2444 }
2445 }
2446
2447 fn set_has_window(&self, has_window: bool) {
2448 unsafe {
2449 gtk_sys::gtk_widget_set_has_window(
2450 self.as_ref().to_glib_none().0,
2451 has_window.to_glib(),
2452 );
2453 }
2454 }
2455
2456 fn set_hexpand(&self, expand: bool) {
2457 unsafe {
2458 gtk_sys::gtk_widget_set_hexpand(self.as_ref().to_glib_none().0, expand.to_glib());
2459 }
2460 }
2461
2462 fn set_hexpand_set(&self, set: bool) {
2463 unsafe {
2464 gtk_sys::gtk_widget_set_hexpand_set(self.as_ref().to_glib_none().0, set.to_glib());
2465 }
2466 }
2467
2468 fn set_mapped(&self, mapped: bool) {
2469 unsafe {
2470 gtk_sys::gtk_widget_set_mapped(self.as_ref().to_glib_none().0, mapped.to_glib());
2471 }
2472 }
2473
2474 fn set_margin_bottom(&self, margin: i32) {
2475 unsafe {
2476 gtk_sys::gtk_widget_set_margin_bottom(self.as_ref().to_glib_none().0, margin);
2477 }
2478 }
2479
2480 fn set_margin_end(&self, margin: i32) {
2481 unsafe {
2482 gtk_sys::gtk_widget_set_margin_end(self.as_ref().to_glib_none().0, margin);
2483 }
2484 }
2485
2486 fn set_margin_start(&self, margin: i32) {
2487 unsafe {
2488 gtk_sys::gtk_widget_set_margin_start(self.as_ref().to_glib_none().0, margin);
2489 }
2490 }
2491
2492 fn set_margin_top(&self, margin: i32) {
2493 unsafe {
2494 gtk_sys::gtk_widget_set_margin_top(self.as_ref().to_glib_none().0, margin);
2495 }
2496 }
2497
2498 fn set_name(&self, name: &str) {
2499 unsafe {
2500 gtk_sys::gtk_widget_set_name(self.as_ref().to_glib_none().0, name.to_glib_none().0);
2501 }
2502 }
2503
2504 fn set_no_show_all(&self, no_show_all: bool) {
2505 unsafe {
2506 gtk_sys::gtk_widget_set_no_show_all(
2507 self.as_ref().to_glib_none().0,
2508 no_show_all.to_glib(),
2509 );
2510 }
2511 }
2512
2513 fn set_opacity(&self, opacity: f64) {
2514 unsafe {
2515 gtk_sys::gtk_widget_set_opacity(self.as_ref().to_glib_none().0, opacity);
2516 }
2517 }
2518
2519 fn set_parent<P: IsA<Widget>>(&self, parent: &P) {
2520 unsafe {
2521 gtk_sys::gtk_widget_set_parent(
2522 self.as_ref().to_glib_none().0,
2523 parent.as_ref().to_glib_none().0,
2524 );
2525 }
2526 }
2527
2528 fn set_parent_window<P: IsA<gdk::Window>>(&self, parent_window: &P) {
2529 unsafe {
2530 gtk_sys::gtk_widget_set_parent_window(
2531 self.as_ref().to_glib_none().0,
2532 parent_window.as_ref().to_glib_none().0,
2533 );
2534 }
2535 }
2536
2537 fn set_realized(&self, realized: bool) {
2538 unsafe {
2539 gtk_sys::gtk_widget_set_realized(self.as_ref().to_glib_none().0, realized.to_glib());
2540 }
2541 }
2542
2543 fn set_receives_default(&self, receives_default: bool) {
2544 unsafe {
2545 gtk_sys::gtk_widget_set_receives_default(
2546 self.as_ref().to_glib_none().0,
2547 receives_default.to_glib(),
2548 );
2549 }
2550 }
2551
2552 fn set_redraw_on_allocate(&self, redraw_on_allocate: bool) {
2553 unsafe {
2554 gtk_sys::gtk_widget_set_redraw_on_allocate(
2555 self.as_ref().to_glib_none().0,
2556 redraw_on_allocate.to_glib(),
2557 );
2558 }
2559 }
2560
2561 fn set_sensitive(&self, sensitive: bool) {
2562 unsafe {
2563 gtk_sys::gtk_widget_set_sensitive(self.as_ref().to_glib_none().0, sensitive.to_glib());
2564 }
2565 }
2566
2567 fn set_size_request(&self, width: i32, height: i32) {
2568 unsafe {
2569 gtk_sys::gtk_widget_set_size_request(self.as_ref().to_glib_none().0, width, height);
2570 }
2571 }
2572
2573 fn set_state_flags(&self, flags: StateFlags, clear: bool) {
2574 unsafe {
2575 gtk_sys::gtk_widget_set_state_flags(
2576 self.as_ref().to_glib_none().0,
2577 flags.to_glib(),
2578 clear.to_glib(),
2579 );
2580 }
2581 }
2582
2583 fn set_support_multidevice(&self, support_multidevice: bool) {
2584 unsafe {
2585 gtk_sys::gtk_widget_set_support_multidevice(
2586 self.as_ref().to_glib_none().0,
2587 support_multidevice.to_glib(),
2588 );
2589 }
2590 }
2591
2592 fn set_tooltip_markup(&self, markup: Option<&str>) {
2593 unsafe {
2594 gtk_sys::gtk_widget_set_tooltip_markup(
2595 self.as_ref().to_glib_none().0,
2596 markup.to_glib_none().0,
2597 );
2598 }
2599 }
2600
2601 fn set_tooltip_text(&self, text: Option<&str>) {
2602 unsafe {
2603 gtk_sys::gtk_widget_set_tooltip_text(
2604 self.as_ref().to_glib_none().0,
2605 text.to_glib_none().0,
2606 );
2607 }
2608 }
2609
2610 fn set_tooltip_window<P: IsA<Window>>(&self, custom_window: Option<&P>) {
2611 unsafe {
2612 gtk_sys::gtk_widget_set_tooltip_window(
2613 self.as_ref().to_glib_none().0,
2614 custom_window.map(|p| p.as_ref()).to_glib_none().0,
2615 );
2616 }
2617 }
2618
2619 fn set_valign(&self, align: Align) {
2620 unsafe {
2621 gtk_sys::gtk_widget_set_valign(self.as_ref().to_glib_none().0, align.to_glib());
2622 }
2623 }
2624
2625 fn set_vexpand(&self, expand: bool) {
2626 unsafe {
2627 gtk_sys::gtk_widget_set_vexpand(self.as_ref().to_glib_none().0, expand.to_glib());
2628 }
2629 }
2630
2631 fn set_vexpand_set(&self, set: bool) {
2632 unsafe {
2633 gtk_sys::gtk_widget_set_vexpand_set(self.as_ref().to_glib_none().0, set.to_glib());
2634 }
2635 }
2636
2637 fn set_visible(&self, visible: bool) {
2638 unsafe {
2639 gtk_sys::gtk_widget_set_visible(self.as_ref().to_glib_none().0, visible.to_glib());
2640 }
2641 }
2642
2643 fn set_visual(&self, visual: Option<&gdk::Visual>) {
2644 unsafe {
2645 gtk_sys::gtk_widget_set_visual(self.as_ref().to_glib_none().0, visual.to_glib_none().0);
2646 }
2647 }
2648
2649 fn set_window<P: IsA<gdk::Window>>(&self, window: &P) {
2650 unsafe {
2651 gtk_sys::gtk_widget_set_window(
2652 self.as_ref().to_glib_none().0,
2653 window.as_ref().to_glib_full(),
2654 );
2655 }
2656 }
2657
2658 fn shape_combine_region(&self, region: Option<&cairo::Region>) {
2659 unsafe {
2660 gtk_sys::gtk_widget_shape_combine_region(
2661 self.as_ref().to_glib_none().0,
2662 mut_override(region.to_glib_none().0),
2663 );
2664 }
2665 }
2666
2667 fn show(&self) {
2668 unsafe {
2669 gtk_sys::gtk_widget_show(self.as_ref().to_glib_none().0);
2670 }
2671 }
2672
2673 fn show_all(&self) {
2674 unsafe {
2675 gtk_sys::gtk_widget_show_all(self.as_ref().to_glib_none().0);
2676 }
2677 }
2678
2679 fn show_now(&self) {
2680 unsafe {
2681 gtk_sys::gtk_widget_show_now(self.as_ref().to_glib_none().0);
2682 }
2683 }
2684
2685 fn size_allocate(&self, allocation: &mut Allocation) {
2686 unsafe {
2687 gtk_sys::gtk_widget_size_allocate(
2688 self.as_ref().to_glib_none().0,
2689 allocation.to_glib_none_mut().0,
2690 );
2691 }
2692 }
2693
2694 fn size_allocate_with_baseline(&self, allocation: &mut Allocation, baseline: i32) {
2695 unsafe {
2696 gtk_sys::gtk_widget_size_allocate_with_baseline(
2697 self.as_ref().to_glib_none().0,
2698 allocation.to_glib_none_mut().0,
2699 baseline,
2700 );
2701 }
2702 }
2703
2704 fn thaw_child_notify(&self) {
2713 unsafe {
2714 gtk_sys::gtk_widget_thaw_child_notify(self.as_ref().to_glib_none().0);
2715 }
2716 }
2717
2718 fn translate_coordinates<P: IsA<Widget>>(
2719 &self,
2720 dest_widget: &P,
2721 src_x: i32,
2722 src_y: i32,
2723 ) -> Option<(i32, i32)> {
2724 unsafe {
2725 let mut dest_x = mem::uninitialized();
2726 let mut dest_y = mem::uninitialized();
2727 let ret = from_glib(gtk_sys::gtk_widget_translate_coordinates(
2728 self.as_ref().to_glib_none().0,
2729 dest_widget.as_ref().to_glib_none().0,
2730 src_x,
2731 src_y,
2732 &mut dest_x,
2733 &mut dest_y,
2734 ));
2735 if ret {
2736 Some((dest_x, dest_y))
2737 } else {
2738 None
2739 }
2740 }
2741 }
2742
2743 fn trigger_tooltip_query(&self) {
2744 unsafe {
2745 gtk_sys::gtk_widget_trigger_tooltip_query(self.as_ref().to_glib_none().0);
2746 }
2747 }
2748
2749 fn unmap(&self) {
2750 unsafe {
2751 gtk_sys::gtk_widget_unmap(self.as_ref().to_glib_none().0);
2752 }
2753 }
2754
2755 fn unparent(&self) {
2756 unsafe {
2757 gtk_sys::gtk_widget_unparent(self.as_ref().to_glib_none().0);
2758 }
2759 }
2760
2761 fn unrealize(&self) {
2762 unsafe {
2763 gtk_sys::gtk_widget_unrealize(self.as_ref().to_glib_none().0);
2764 }
2765 }
2766
2767 fn unregister_window<P: IsA<gdk::Window>>(&self, window: &P) {
2768 unsafe {
2769 gtk_sys::gtk_widget_unregister_window(
2770 self.as_ref().to_glib_none().0,
2771 window.as_ref().to_glib_none().0,
2772 );
2773 }
2774 }
2775
2776 fn unset_state_flags(&self, flags: StateFlags) {
2777 unsafe {
2778 gtk_sys::gtk_widget_unset_state_flags(self.as_ref().to_glib_none().0, flags.to_glib());
2779 }
2780 }
2781
2782 fn get_property_composite_child(&self) -> bool {
2783 unsafe {
2784 let mut value = Value::from_type(<bool as StaticType>::static_type());
2785 gobject_sys::g_object_get_property(
2786 self.to_glib_none().0 as *mut gobject_sys::GObject,
2787 b"composite-child\0".as_ptr() as *const _,
2788 value.to_glib_none_mut().0,
2789 );
2790 value.get().unwrap()
2791 }
2792 }
2793
2794 fn get_property_expand(&self) -> bool {
2795 unsafe {
2796 let mut value = Value::from_type(<bool as StaticType>::static_type());
2797 gobject_sys::g_object_get_property(
2798 self.to_glib_none().0 as *mut gobject_sys::GObject,
2799 b"expand\0".as_ptr() as *const _,
2800 value.to_glib_none_mut().0,
2801 );
2802 value.get().unwrap()
2803 }
2804 }
2805
2806 fn set_property_expand(&self, expand: bool) {
2807 unsafe {
2808 gobject_sys::g_object_set_property(
2809 self.to_glib_none().0 as *mut gobject_sys::GObject,
2810 b"expand\0".as_ptr() as *const _,
2811 Value::from(&expand).to_glib_none().0,
2812 );
2813 }
2814 }
2815
2816 fn get_property_has_default(&self) -> bool {
2817 unsafe {
2818 let mut value = Value::from_type(<bool as StaticType>::static_type());
2819 gobject_sys::g_object_get_property(
2820 self.to_glib_none().0 as *mut gobject_sys::GObject,
2821 b"has-default\0".as_ptr() as *const _,
2822 value.to_glib_none_mut().0,
2823 );
2824 value.get().unwrap()
2825 }
2826 }
2827
2828 fn set_property_has_default(&self, has_default: bool) {
2829 unsafe {
2830 gobject_sys::g_object_set_property(
2831 self.to_glib_none().0 as *mut gobject_sys::GObject,
2832 b"has-default\0".as_ptr() as *const _,
2833 Value::from(&has_default).to_glib_none().0,
2834 );
2835 }
2836 }
2837
2838 fn get_property_has_focus(&self) -> bool {
2839 unsafe {
2840 let mut value = Value::from_type(<bool as StaticType>::static_type());
2841 gobject_sys::g_object_get_property(
2842 self.to_glib_none().0 as *mut gobject_sys::GObject,
2843 b"has-focus\0".as_ptr() as *const _,
2844 value.to_glib_none_mut().0,
2845 );
2846 value.get().unwrap()
2847 }
2848 }
2849
2850 fn set_property_has_focus(&self, has_focus: bool) {
2851 unsafe {
2852 gobject_sys::g_object_set_property(
2853 self.to_glib_none().0 as *mut gobject_sys::GObject,
2854 b"has-focus\0".as_ptr() as *const _,
2855 Value::from(&has_focus).to_glib_none().0,
2856 );
2857 }
2858 }
2859
2860 fn get_property_height_request(&self) -> i32 {
2861 unsafe {
2862 let mut value = Value::from_type(<i32 as StaticType>::static_type());
2863 gobject_sys::g_object_get_property(
2864 self.to_glib_none().0 as *mut gobject_sys::GObject,
2865 b"height-request\0".as_ptr() as *const _,
2866 value.to_glib_none_mut().0,
2867 );
2868 value.get().unwrap()
2869 }
2870 }
2871
2872 fn set_property_height_request(&self, height_request: i32) {
2873 unsafe {
2874 gobject_sys::g_object_set_property(
2875 self.to_glib_none().0 as *mut gobject_sys::GObject,
2876 b"height-request\0".as_ptr() as *const _,
2877 Value::from(&height_request).to_glib_none().0,
2878 );
2879 }
2880 }
2881
2882 fn get_property_is_focus(&self) -> bool {
2883 unsafe {
2884 let mut value = Value::from_type(<bool as StaticType>::static_type());
2885 gobject_sys::g_object_get_property(
2886 self.to_glib_none().0 as *mut gobject_sys::GObject,
2887 b"is-focus\0".as_ptr() as *const _,
2888 value.to_glib_none_mut().0,
2889 );
2890 value.get().unwrap()
2891 }
2892 }
2893
2894 fn set_property_is_focus(&self, is_focus: bool) {
2895 unsafe {
2896 gobject_sys::g_object_set_property(
2897 self.to_glib_none().0 as *mut gobject_sys::GObject,
2898 b"is-focus\0".as_ptr() as *const _,
2899 Value::from(&is_focus).to_glib_none().0,
2900 );
2901 }
2902 }
2903
2904 fn get_property_margin(&self) -> i32 {
2905 unsafe {
2906 let mut value = Value::from_type(<i32 as StaticType>::static_type());
2907 gobject_sys::g_object_get_property(
2908 self.to_glib_none().0 as *mut gobject_sys::GObject,
2909 b"margin\0".as_ptr() as *const _,
2910 value.to_glib_none_mut().0,
2911 );
2912 value.get().unwrap()
2913 }
2914 }
2915
2916 fn set_property_margin(&self, margin: i32) {
2917 unsafe {
2918 gobject_sys::g_object_set_property(
2919 self.to_glib_none().0 as *mut gobject_sys::GObject,
2920 b"margin\0".as_ptr() as *const _,
2921 Value::from(&margin).to_glib_none().0,
2922 );
2923 }
2924 }
2925
2926 fn get_property_width_request(&self) -> i32 {
2927 unsafe {
2928 let mut value = Value::from_type(<i32 as StaticType>::static_type());
2929 gobject_sys::g_object_get_property(
2930 self.to_glib_none().0 as *mut gobject_sys::GObject,
2931 b"width-request\0".as_ptr() as *const _,
2932 value.to_glib_none_mut().0,
2933 );
2934 value.get().unwrap()
2935 }
2936 }
2937
2938 fn set_property_width_request(&self, width_request: i32) {
2939 unsafe {
2940 gobject_sys::g_object_set_property(
2941 self.to_glib_none().0 as *mut gobject_sys::GObject,
2942 b"width-request\0".as_ptr() as *const _,
2943 Value::from(&width_request).to_glib_none().0,
2944 );
2945 }
2946 }
2947
2948 fn connect_accel_closures_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2949 unsafe extern "C" fn accel_closures_changed_trampoline<P, F: Fn(&P) + 'static>(
2950 this: *mut gtk_sys::GtkWidget,
2951 f: glib_sys::gpointer,
2952 ) where
2953 P: IsA<Widget>,
2954 {
2955 let f: &F = &*(f as *const F);
2956 f(&Widget::from_glib_borrow(this).unsafe_cast())
2957 }
2958 unsafe {
2959 let f: Box_<F> = Box_::new(f);
2960 connect_raw(
2961 self.as_ptr() as *mut _,
2962 b"accel-closures-changed\0".as_ptr() as *const _,
2963 Some(transmute(
2964 accel_closures_changed_trampoline::<Self, F> as usize,
2965 )),
2966 Box_::into_raw(f),
2967 )
2968 }
2969 }
2970
2971 fn connect_button_press_event<F: Fn(&Self, &gdk::EventButton) -> Inhibit + 'static>(
2972 &self,
2973 f: F,
2974 ) -> SignalHandlerId {
2975 unsafe extern "C" fn button_press_event_trampoline<
2976 P,
2977 F: Fn(&P, &gdk::EventButton) -> Inhibit + 'static,
2978 >(
2979 this: *mut gtk_sys::GtkWidget,
2980 event: *mut gdk_sys::GdkEventButton,
2981 f: glib_sys::gpointer,
2982 ) -> glib_sys::gboolean
2983 where
2984 P: IsA<Widget>,
2985 {
2986 let f: &F = &*(f as *const F);
2987 f(
2988 &Widget::from_glib_borrow(this).unsafe_cast(),
2989 &from_glib_borrow(event),
2990 )
2991 .to_glib()
2992 }
2993 unsafe {
2994 let f: Box_<F> = Box_::new(f);
2995 connect_raw(
2996 self.as_ptr() as *mut _,
2997 b"button-press-event\0".as_ptr() as *const _,
2998 Some(transmute(button_press_event_trampoline::<Self, F> as usize)),
2999 Box_::into_raw(f),
3000 )
3001 }
3002 }
3003
3004 fn connect_button_release_event<F: Fn(&Self, &gdk::EventButton) -> Inhibit + 'static>(
3005 &self,
3006 f: F,
3007 ) -> SignalHandlerId {
3008 unsafe extern "C" fn button_release_event_trampoline<
3009 P,
3010 F: Fn(&P, &gdk::EventButton) -> Inhibit + 'static,
3011 >(
3012 this: *mut gtk_sys::GtkWidget,
3013 event: *mut gdk_sys::GdkEventButton,
3014 f: glib_sys::gpointer,
3015 ) -> glib_sys::gboolean
3016 where
3017 P: IsA<Widget>,
3018 {
3019 let f: &F = &*(f as *const F);
3020 f(
3021 &Widget::from_glib_borrow(this).unsafe_cast(),
3022 &from_glib_borrow(event),
3023 )
3024 .to_glib()
3025 }
3026 unsafe {
3027 let f: Box_<F> = Box_::new(f);
3028 connect_raw(
3029 self.as_ptr() as *mut _,
3030 b"button-release-event\0".as_ptr() as *const _,
3031 Some(transmute(
3032 button_release_event_trampoline::<Self, F> as usize,
3033 )),
3034 Box_::into_raw(f),
3035 )
3036 }
3037 }
3038
3039 fn connect_can_activate_accel<F: Fn(&Self, u32) -> bool + 'static>(
3040 &self,
3041 f: F,
3042 ) -> SignalHandlerId {
3043 unsafe extern "C" fn can_activate_accel_trampoline<P, F: Fn(&P, u32) -> bool + 'static>(
3044 this: *mut gtk_sys::GtkWidget,
3045 signal_id: libc::c_uint,
3046 f: glib_sys::gpointer,
3047 ) -> glib_sys::gboolean
3048 where
3049 P: IsA<Widget>,
3050 {
3051 let f: &F = &*(f as *const F);
3052 f(&Widget::from_glib_borrow(this).unsafe_cast(), signal_id).to_glib()
3053 }
3054 unsafe {
3055 let f: Box_<F> = Box_::new(f);
3056 connect_raw(
3057 self.as_ptr() as *mut _,
3058 b"can-activate-accel\0".as_ptr() as *const _,
3059 Some(transmute(can_activate_accel_trampoline::<Self, F> as usize)),
3060 Box_::into_raw(f),
3061 )
3062 }
3063 }
3064
3065 fn connect_composited_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3070 unsafe extern "C" fn composited_changed_trampoline<P, F: Fn(&P) + 'static>(
3071 this: *mut gtk_sys::GtkWidget,
3072 f: glib_sys::gpointer,
3073 ) where
3074 P: IsA<Widget>,
3075 {
3076 let f: &F = &*(f as *const F);
3077 f(&Widget::from_glib_borrow(this).unsafe_cast())
3078 }
3079 unsafe {
3080 let f: Box_<F> = Box_::new(f);
3081 connect_raw(
3082 self.as_ptr() as *mut _,
3083 b"composited-changed\0".as_ptr() as *const _,
3084 Some(transmute(composited_changed_trampoline::<Self, F> as usize)),
3085 Box_::into_raw(f),
3086 )
3087 }
3088 }
3089
3090 fn emit_composited_changed(&self) {
3091 let _ = unsafe {
3092 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
3093 .emit("composited-changed", &[])
3094 .unwrap()
3095 };
3096 }
3097
3098 fn connect_configure_event<F: Fn(&Self, &gdk::EventConfigure) -> bool + 'static>(
3099 &self,
3100 f: F,
3101 ) -> SignalHandlerId {
3102 unsafe extern "C" fn configure_event_trampoline<
3103 P,
3104 F: Fn(&P, &gdk::EventConfigure) -> bool + 'static,
3105 >(
3106 this: *mut gtk_sys::GtkWidget,
3107 event: *mut gdk_sys::GdkEventConfigure,
3108 f: glib_sys::gpointer,
3109 ) -> glib_sys::gboolean
3110 where
3111 P: IsA<Widget>,
3112 {
3113 let f: &F = &*(f as *const F);
3114 f(
3115 &Widget::from_glib_borrow(this).unsafe_cast(),
3116 &from_glib_borrow(event),
3117 )
3118 .to_glib()
3119 }
3120 unsafe {
3121 let f: Box_<F> = Box_::new(f);
3122 connect_raw(
3123 self.as_ptr() as *mut _,
3124 b"configure-event\0".as_ptr() as *const _,
3125 Some(transmute(configure_event_trampoline::<Self, F> as usize)),
3126 Box_::into_raw(f),
3127 )
3128 }
3129 }
3130
3131 fn connect_damage_event<F: Fn(&Self, &gdk::EventExpose) -> bool + 'static>(
3132 &self,
3133 f: F,
3134 ) -> SignalHandlerId {
3135 unsafe extern "C" fn damage_event_trampoline<
3136 P,
3137 F: Fn(&P, &gdk::EventExpose) -> bool + 'static,
3138 >(
3139 this: *mut gtk_sys::GtkWidget,
3140 event: *mut gdk_sys::GdkEventExpose,
3141 f: glib_sys::gpointer,
3142 ) -> glib_sys::gboolean
3143 where
3144 P: IsA<Widget>,
3145 {
3146 let f: &F = &*(f as *const F);
3147 f(
3148 &Widget::from_glib_borrow(this).unsafe_cast(),
3149 &from_glib_borrow(event),
3150 )
3151 .to_glib()
3152 }
3153 unsafe {
3154 let f: Box_<F> = Box_::new(f);
3155 connect_raw(
3156 self.as_ptr() as *mut _,
3157 b"damage-event\0".as_ptr() as *const _,
3158 Some(transmute(damage_event_trampoline::<Self, F> as usize)),
3159 Box_::into_raw(f),
3160 )
3161 }
3162 }
3163
3164 fn connect_delete_event<F: Fn(&Self, &gdk::Event) -> Inhibit + 'static>(
3165 &self,
3166 f: F,
3167 ) -> SignalHandlerId {
3168 unsafe extern "C" fn delete_event_trampoline<
3169 P,
3170 F: Fn(&P, &gdk::Event) -> Inhibit + 'static,
3171 >(
3172 this: *mut gtk_sys::GtkWidget,
3173 event: *mut gdk_sys::GdkEvent,
3174 f: glib_sys::gpointer,
3175 ) -> glib_sys::gboolean
3176 where
3177 P: IsA<Widget>,
3178 {
3179 let f: &F = &*(f as *const F);
3180 f(
3181 &Widget::from_glib_borrow(this).unsafe_cast(),
3182 &from_glib_none(event),
3183 )
3184 .to_glib()
3185 }
3186 unsafe {
3187 let f: Box_<F> = Box_::new(f);
3188 connect_raw(
3189 self.as_ptr() as *mut _,
3190 b"delete-event\0".as_ptr() as *const _,
3191 Some(transmute(delete_event_trampoline::<Self, F> as usize)),
3192 Box_::into_raw(f),
3193 )
3194 }
3195 }
3196
3197 fn connect_destroy<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3198 unsafe extern "C" fn destroy_trampoline<P, F: Fn(&P) + 'static>(
3199 this: *mut gtk_sys::GtkWidget,
3200 f: glib_sys::gpointer,
3201 ) where
3202 P: IsA<Widget>,
3203 {
3204 let f: &F = &*(f as *const F);
3205 f(&Widget::from_glib_borrow(this).unsafe_cast())
3206 }
3207 unsafe {
3208 let f: Box_<F> = Box_::new(f);
3209 connect_raw(
3210 self.as_ptr() as *mut _,
3211 b"destroy\0".as_ptr() as *const _,
3212 Some(transmute(destroy_trampoline::<Self, F> as usize)),
3213 Box_::into_raw(f),
3214 )
3215 }
3216 }
3217
3218 fn connect_destroy_event<F: Fn(&Self, &gdk::Event) -> Inhibit + 'static>(
3219 &self,
3220 f: F,
3221 ) -> SignalHandlerId {
3222 unsafe extern "C" fn destroy_event_trampoline<
3223 P,
3224 F: Fn(&P, &gdk::Event) -> Inhibit + 'static,
3225 >(
3226 this: *mut gtk_sys::GtkWidget,
3227 event: *mut gdk_sys::GdkEvent,
3228 f: glib_sys::gpointer,
3229 ) -> glib_sys::gboolean
3230 where
3231 P: IsA<Widget>,
3232 {
3233 let f: &F = &*(f as *const F);
3234 f(
3235 &Widget::from_glib_borrow(this).unsafe_cast(),
3236 &from_glib_none(event),
3237 )
3238 .to_glib()
3239 }
3240 unsafe {
3241 let f: Box_<F> = Box_::new(f);
3242 connect_raw(
3243 self.as_ptr() as *mut _,
3244 b"destroy-event\0".as_ptr() as *const _,
3245 Some(transmute(destroy_event_trampoline::<Self, F> as usize)),
3246 Box_::into_raw(f),
3247 )
3248 }
3249 }
3250
3251 fn connect_direction_changed<F: Fn(&Self, TextDirection) + 'static>(
3252 &self,
3253 f: F,
3254 ) -> SignalHandlerId {
3255 unsafe extern "C" fn direction_changed_trampoline<P, F: Fn(&P, TextDirection) + 'static>(
3256 this: *mut gtk_sys::GtkWidget,
3257 previous_direction: gtk_sys::GtkTextDirection,
3258 f: glib_sys::gpointer,
3259 ) where
3260 P: IsA<Widget>,
3261 {
3262 let f: &F = &*(f as *const F);
3263 f(
3264 &Widget::from_glib_borrow(this).unsafe_cast(),
3265 from_glib(previous_direction),
3266 )
3267 }
3268 unsafe {
3269 let f: Box_<F> = Box_::new(f);
3270 connect_raw(
3271 self.as_ptr() as *mut _,
3272 b"direction-changed\0".as_ptr() as *const _,
3273 Some(transmute(direction_changed_trampoline::<Self, F> as usize)),
3274 Box_::into_raw(f),
3275 )
3276 }
3277 }
3278
3279 fn connect_drag_begin<F: Fn(&Self, &gdk::DragContext) + 'static>(
3280 &self,
3281 f: F,
3282 ) -> SignalHandlerId {
3283 unsafe extern "C" fn drag_begin_trampoline<P, F: Fn(&P, &gdk::DragContext) + 'static>(
3284 this: *mut gtk_sys::GtkWidget,
3285 context: *mut gdk_sys::GdkDragContext,
3286 f: glib_sys::gpointer,
3287 ) where
3288 P: IsA<Widget>,
3289 {
3290 let f: &F = &*(f as *const F);
3291 f(
3292 &Widget::from_glib_borrow(this).unsafe_cast(),
3293 &from_glib_borrow(context),
3294 )
3295 }
3296 unsafe {
3297 let f: Box_<F> = Box_::new(f);
3298 connect_raw(
3299 self.as_ptr() as *mut _,
3300 b"drag-begin\0".as_ptr() as *const _,
3301 Some(transmute(drag_begin_trampoline::<Self, F> as usize)),
3302 Box_::into_raw(f),
3303 )
3304 }
3305 }
3306
3307 fn connect_drag_data_delete<F: Fn(&Self, &gdk::DragContext) + 'static>(
3308 &self,
3309 f: F,
3310 ) -> SignalHandlerId {
3311 unsafe extern "C" fn drag_data_delete_trampoline<
3312 P,
3313 F: Fn(&P, &gdk::DragContext) + 'static,
3314 >(
3315 this: *mut gtk_sys::GtkWidget,
3316 context: *mut gdk_sys::GdkDragContext,
3317 f: glib_sys::gpointer,
3318 ) where
3319 P: IsA<Widget>,
3320 {
3321 let f: &F = &*(f as *const F);
3322 f(
3323 &Widget::from_glib_borrow(this).unsafe_cast(),
3324 &from_glib_borrow(context),
3325 )
3326 }
3327 unsafe {
3328 let f: Box_<F> = Box_::new(f);
3329 connect_raw(
3330 self.as_ptr() as *mut _,
3331 b"drag-data-delete\0".as_ptr() as *const _,
3332 Some(transmute(drag_data_delete_trampoline::<Self, F> as usize)),
3333 Box_::into_raw(f),
3334 )
3335 }
3336 }
3337
3338 fn connect_drag_data_get<
3339 F: Fn(&Self, &gdk::DragContext, &SelectionData, u32, u32) + 'static,
3340 >(
3341 &self,
3342 f: F,
3343 ) -> SignalHandlerId {
3344 unsafe extern "C" fn drag_data_get_trampoline<
3345 P,
3346 F: Fn(&P, &gdk::DragContext, &SelectionData, u32, u32) + 'static,
3347 >(
3348 this: *mut gtk_sys::GtkWidget,
3349 context: *mut gdk_sys::GdkDragContext,
3350 data: *mut gtk_sys::GtkSelectionData,
3351 info: libc::c_uint,
3352 time: libc::c_uint,
3353 f: glib_sys::gpointer,
3354 ) where
3355 P: IsA<Widget>,
3356 {
3357 let f: &F = &*(f as *const F);
3358 f(
3359 &Widget::from_glib_borrow(this).unsafe_cast(),
3360 &from_glib_borrow(context),
3361 &from_glib_borrow(data),
3362 info,
3363 time,
3364 )
3365 }
3366 unsafe {
3367 let f: Box_<F> = Box_::new(f);
3368 connect_raw(
3369 self.as_ptr() as *mut _,
3370 b"drag-data-get\0".as_ptr() as *const _,
3371 Some(transmute(drag_data_get_trampoline::<Self, F> as usize)),
3372 Box_::into_raw(f),
3373 )
3374 }
3375 }
3376
3377 fn connect_drag_data_received<
3378 F: Fn(&Self, &gdk::DragContext, i32, i32, &SelectionData, u32, u32) + 'static,
3379 >(
3380 &self,
3381 f: F,
3382 ) -> SignalHandlerId {
3383 unsafe extern "C" fn drag_data_received_trampoline<
3384 P,
3385 F: Fn(&P, &gdk::DragContext, i32, i32, &SelectionData, u32, u32) + 'static,
3386 >(
3387 this: *mut gtk_sys::GtkWidget,
3388 context: *mut gdk_sys::GdkDragContext,
3389 x: libc::c_int,
3390 y: libc::c_int,
3391 data: *mut gtk_sys::GtkSelectionData,
3392 info: libc::c_uint,
3393 time: libc::c_uint,
3394 f: glib_sys::gpointer,
3395 ) where
3396 P: IsA<Widget>,
3397 {
3398 let f: &F = &*(f as *const F);
3399 f(
3400 &Widget::from_glib_borrow(this).unsafe_cast(),
3401 &from_glib_borrow(context),
3402 x,
3403 y,
3404 &from_glib_borrow(data),
3405 info,
3406 time,
3407 )
3408 }
3409 unsafe {
3410 let f: Box_<F> = Box_::new(f);
3411 connect_raw(
3412 self.as_ptr() as *mut _,
3413 b"drag-data-received\0".as_ptr() as *const _,
3414 Some(transmute(drag_data_received_trampoline::<Self, F> as usize)),
3415 Box_::into_raw(f),
3416 )
3417 }
3418 }
3419
3420 fn connect_drag_drop<F: Fn(&Self, &gdk::DragContext, i32, i32, u32) -> Inhibit + 'static>(
3421 &self,
3422 f: F,
3423 ) -> SignalHandlerId {
3424 unsafe extern "C" fn drag_drop_trampoline<
3425 P,
3426 F: Fn(&P, &gdk::DragContext, i32, i32, u32) -> Inhibit + 'static,
3427 >(
3428 this: *mut gtk_sys::GtkWidget,
3429 context: *mut gdk_sys::GdkDragContext,
3430 x: libc::c_int,
3431 y: libc::c_int,
3432 time: libc::c_uint,
3433 f: glib_sys::gpointer,
3434 ) -> glib_sys::gboolean
3435 where
3436 P: IsA<Widget>,
3437 {
3438 let f: &F = &*(f as *const F);
3439 f(
3440 &Widget::from_glib_borrow(this).unsafe_cast(),
3441 &from_glib_borrow(context),
3442 x,
3443 y,
3444 time,
3445 )
3446 .to_glib()
3447 }
3448 unsafe {
3449 let f: Box_<F> = Box_::new(f);
3450 connect_raw(
3451 self.as_ptr() as *mut _,
3452 b"drag-drop\0".as_ptr() as *const _,
3453 Some(transmute(drag_drop_trampoline::<Self, F> as usize)),
3454 Box_::into_raw(f),
3455 )
3456 }
3457 }
3458
3459 fn connect_drag_end<F: Fn(&Self, &gdk::DragContext) + 'static>(&self, f: F) -> SignalHandlerId {
3460 unsafe extern "C" fn drag_end_trampoline<P, F: Fn(&P, &gdk::DragContext) + 'static>(
3461 this: *mut gtk_sys::GtkWidget,
3462 context: *mut gdk_sys::GdkDragContext,
3463 f: glib_sys::gpointer,
3464 ) where
3465 P: IsA<Widget>,
3466 {
3467 let f: &F = &*(f as *const F);
3468 f(
3469 &Widget::from_glib_borrow(this).unsafe_cast(),
3470 &from_glib_borrow(context),
3471 )
3472 }
3473 unsafe {
3474 let f: Box_<F> = Box_::new(f);
3475 connect_raw(
3476 self.as_ptr() as *mut _,
3477 b"drag-end\0".as_ptr() as *const _,
3478 Some(transmute(drag_end_trampoline::<Self, F> as usize)),
3479 Box_::into_raw(f),
3480 )
3481 }
3482 }
3483
3484 fn connect_drag_failed<F: Fn(&Self, &gdk::DragContext, DragResult) -> Inhibit + 'static>(
3485 &self,
3486 f: F,
3487 ) -> SignalHandlerId {
3488 unsafe extern "C" fn drag_failed_trampoline<
3489 P,
3490 F: Fn(&P, &gdk::DragContext, DragResult) -> Inhibit + 'static,
3491 >(
3492 this: *mut gtk_sys::GtkWidget,
3493 context: *mut gdk_sys::GdkDragContext,
3494 result: gtk_sys::GtkDragResult,
3495 f: glib_sys::gpointer,
3496 ) -> glib_sys::gboolean
3497 where
3498 P: IsA<Widget>,
3499 {
3500 let f: &F = &*(f as *const F);
3501 f(
3502 &Widget::from_glib_borrow(this).unsafe_cast(),
3503 &from_glib_borrow(context),
3504 from_glib(result),
3505 )
3506 .to_glib()
3507 }
3508 unsafe {
3509 let f: Box_<F> = Box_::new(f);
3510 connect_raw(
3511 self.as_ptr() as *mut _,
3512 b"drag-failed\0".as_ptr() as *const _,
3513 Some(transmute(drag_failed_trampoline::<Self, F> as usize)),
3514 Box_::into_raw(f),
3515 )
3516 }
3517 }
3518
3519 fn connect_drag_leave<F: Fn(&Self, &gdk::DragContext, u32) + 'static>(
3520 &self,
3521 f: F,
3522 ) -> SignalHandlerId {
3523 unsafe extern "C" fn drag_leave_trampoline<P, F: Fn(&P, &gdk::DragContext, u32) + 'static>(
3524 this: *mut gtk_sys::GtkWidget,
3525 context: *mut gdk_sys::GdkDragContext,
3526 time: libc::c_uint,
3527 f: glib_sys::gpointer,
3528 ) where
3529 P: IsA<Widget>,
3530 {
3531 let f: &F = &*(f as *const F);
3532 f(
3533 &Widget::from_glib_borrow(this).unsafe_cast(),
3534 &from_glib_borrow(context),
3535 time,
3536 )
3537 }
3538 unsafe {
3539 let f: Box_<F> = Box_::new(f);
3540 connect_raw(
3541 self.as_ptr() as *mut _,
3542 b"drag-leave\0".as_ptr() as *const _,
3543 Some(transmute(drag_leave_trampoline::<Self, F> as usize)),
3544 Box_::into_raw(f),
3545 )
3546 }
3547 }
3548
3549 fn connect_drag_motion<F: Fn(&Self, &gdk::DragContext, i32, i32, u32) -> Inhibit + 'static>(
3550 &self,
3551 f: F,
3552 ) -> SignalHandlerId {
3553 unsafe extern "C" fn drag_motion_trampoline<
3554 P,
3555 F: Fn(&P, &gdk::DragContext, i32, i32, u32) -> Inhibit + 'static,
3556 >(
3557 this: *mut gtk_sys::GtkWidget,
3558 context: *mut gdk_sys::GdkDragContext,
3559 x: libc::c_int,
3560 y: libc::c_int,
3561 time: libc::c_uint,
3562 f: glib_sys::gpointer,
3563 ) -> glib_sys::gboolean
3564 where
3565 P: IsA<Widget>,
3566 {
3567 let f: &F = &*(f as *const F);
3568 f(
3569 &Widget::from_glib_borrow(this).unsafe_cast(),
3570 &from_glib_borrow(context),
3571 x,
3572 y,
3573 time,
3574 )
3575 .to_glib()
3576 }
3577 unsafe {
3578 let f: Box_<F> = Box_::new(f);
3579 connect_raw(
3580 self.as_ptr() as *mut _,
3581 b"drag-motion\0".as_ptr() as *const _,
3582 Some(transmute(drag_motion_trampoline::<Self, F> as usize)),
3583 Box_::into_raw(f),
3584 )
3585 }
3586 }
3587
3588 fn connect_draw<F: Fn(&Self, &cairo::Context) -> Inhibit + 'static>(
3589 &self,
3590 f: F,
3591 ) -> SignalHandlerId {
3592 unsafe extern "C" fn draw_trampoline<P, F: Fn(&P, &cairo::Context) -> Inhibit + 'static>(
3593 this: *mut gtk_sys::GtkWidget,
3594 cr: *mut cairo_sys::cairo_t,
3595 f: glib_sys::gpointer,
3596 ) -> glib_sys::gboolean
3597 where
3598 P: IsA<Widget>,
3599 {
3600 let f: &F = &*(f as *const F);
3601 f(
3602 &Widget::from_glib_borrow(this).unsafe_cast(),
3603 &from_glib_borrow(cr),
3604 )
3605 .to_glib()
3606 }
3607 unsafe {
3608 let f: Box_<F> = Box_::new(f);
3609 connect_raw(
3610 self.as_ptr() as *mut _,
3611 b"draw\0".as_ptr() as *const _,
3612 Some(transmute(draw_trampoline::<Self, F> as usize)),
3613 Box_::into_raw(f),
3614 )
3615 }
3616 }
3617
3618 fn connect_enter_notify_event<F: Fn(&Self, &gdk::EventCrossing) -> Inhibit + 'static>(
3619 &self,
3620 f: F,
3621 ) -> SignalHandlerId {
3622 unsafe extern "C" fn enter_notify_event_trampoline<
3623 P,
3624 F: Fn(&P, &gdk::EventCrossing) -> Inhibit + 'static,
3625 >(
3626 this: *mut gtk_sys::GtkWidget,
3627 event: *mut gdk_sys::GdkEventCrossing,
3628 f: glib_sys::gpointer,
3629 ) -> glib_sys::gboolean
3630 where
3631 P: IsA<Widget>,
3632 {
3633 let f: &F = &*(f as *const F);
3634 f(
3635 &Widget::from_glib_borrow(this).unsafe_cast(),
3636 &from_glib_borrow(event),
3637 )
3638 .to_glib()
3639 }
3640 unsafe {
3641 let f: Box_<F> = Box_::new(f);
3642 connect_raw(
3643 self.as_ptr() as *mut _,
3644 b"enter-notify-event\0".as_ptr() as *const _,
3645 Some(transmute(enter_notify_event_trampoline::<Self, F> as usize)),
3646 Box_::into_raw(f),
3647 )
3648 }
3649 }
3650
3651 fn connect_event<F: Fn(&Self, &gdk::Event) -> Inhibit + 'static>(
3652 &self,
3653 f: F,
3654 ) -> SignalHandlerId {
3655 unsafe extern "C" fn event_trampoline<P, F: Fn(&P, &gdk::Event) -> Inhibit + 'static>(
3656 this: *mut gtk_sys::GtkWidget,
3657 event: *mut gdk_sys::GdkEvent,
3658 f: glib_sys::gpointer,
3659 ) -> glib_sys::gboolean
3660 where
3661 P: IsA<Widget>,
3662 {
3663 let f: &F = &*(f as *const F);
3664 f(
3665 &Widget::from_glib_borrow(this).unsafe_cast(),
3666 &from_glib_none(event),
3667 )
3668 .to_glib()
3669 }
3670 unsafe {
3671 let f: Box_<F> = Box_::new(f);
3672 connect_raw(
3673 self.as_ptr() as *mut _,
3674 b"event\0".as_ptr() as *const _,
3675 Some(transmute(event_trampoline::<Self, F> as usize)),
3676 Box_::into_raw(f),
3677 )
3678 }
3679 }
3680
3681 fn connect_event_after<F: Fn(&Self, &gdk::Event) + 'static>(&self, f: F) -> SignalHandlerId {
3682 unsafe extern "C" fn event_after_trampoline<P, F: Fn(&P, &gdk::Event) + 'static>(
3683 this: *mut gtk_sys::GtkWidget,
3684 event: *mut gdk_sys::GdkEvent,
3685 f: glib_sys::gpointer,
3686 ) where
3687 P: IsA<Widget>,
3688 {
3689 let f: &F = &*(f as *const F);
3690 f(
3691 &Widget::from_glib_borrow(this).unsafe_cast(),
3692 &from_glib_none(event),
3693 )
3694 }
3695 unsafe {
3696 let f: Box_<F> = Box_::new(f);
3697 connect_raw(
3698 self.as_ptr() as *mut _,
3699 b"event-after\0".as_ptr() as *const _,
3700 Some(transmute(event_after_trampoline::<Self, F> as usize)),
3701 Box_::into_raw(f),
3702 )
3703 }
3704 }
3705
3706 fn connect_focus<F: Fn(&Self, DirectionType) -> Inhibit + 'static>(
3707 &self,
3708 f: F,
3709 ) -> SignalHandlerId {
3710 unsafe extern "C" fn focus_trampoline<P, F: Fn(&P, DirectionType) -> Inhibit + 'static>(
3711 this: *mut gtk_sys::GtkWidget,
3712 direction: gtk_sys::GtkDirectionType,
3713 f: glib_sys::gpointer,
3714 ) -> glib_sys::gboolean
3715 where
3716 P: IsA<Widget>,
3717 {
3718 let f: &F = &*(f as *const F);
3719 f(
3720 &Widget::from_glib_borrow(this).unsafe_cast(),
3721 from_glib(direction),
3722 )
3723 .to_glib()
3724 }
3725 unsafe {
3726 let f: Box_<F> = Box_::new(f);
3727 connect_raw(
3728 self.as_ptr() as *mut _,
3729 b"focus\0".as_ptr() as *const _,
3730 Some(transmute(focus_trampoline::<Self, F> as usize)),
3731 Box_::into_raw(f),
3732 )
3733 }
3734 }
3735
3736 fn connect_focus_in_event<F: Fn(&Self, &gdk::EventFocus) -> Inhibit + 'static>(
3737 &self,
3738 f: F,
3739 ) -> SignalHandlerId {
3740 unsafe extern "C" fn focus_in_event_trampoline<
3741 P,
3742 F: Fn(&P, &gdk::EventFocus) -> Inhibit + 'static,
3743 >(
3744 this: *mut gtk_sys::GtkWidget,
3745 event: *mut gdk_sys::GdkEventFocus,
3746 f: glib_sys::gpointer,
3747 ) -> glib_sys::gboolean
3748 where
3749 P: IsA<Widget>,
3750 {
3751 let f: &F = &*(f as *const F);
3752 f(
3753 &Widget::from_glib_borrow(this).unsafe_cast(),
3754 &from_glib_borrow(event),
3755 )
3756 .to_glib()
3757 }
3758 unsafe {
3759 let f: Box_<F> = Box_::new(f);
3760 connect_raw(
3761 self.as_ptr() as *mut _,
3762 b"focus-in-event\0".as_ptr() as *const _,
3763 Some(transmute(focus_in_event_trampoline::<Self, F> as usize)),
3764 Box_::into_raw(f),
3765 )
3766 }
3767 }
3768
3769 fn connect_focus_out_event<F: Fn(&Self, &gdk::EventFocus) -> Inhibit + 'static>(
3770 &self,
3771 f: F,
3772 ) -> SignalHandlerId {
3773 unsafe extern "C" fn focus_out_event_trampoline<
3774 P,
3775 F: Fn(&P, &gdk::EventFocus) -> Inhibit + 'static,
3776 >(
3777 this: *mut gtk_sys::GtkWidget,
3778 event: *mut gdk_sys::GdkEventFocus,
3779 f: glib_sys::gpointer,
3780 ) -> glib_sys::gboolean
3781 where
3782 P: IsA<Widget>,
3783 {
3784 let f: &F = &*(f as *const F);
3785 f(
3786 &Widget::from_glib_borrow(this).unsafe_cast(),
3787 &from_glib_borrow(event),
3788 )
3789 .to_glib()
3790 }
3791 unsafe {
3792 let f: Box_<F> = Box_::new(f);
3793 connect_raw(
3794 self.as_ptr() as *mut _,
3795 b"focus-out-event\0".as_ptr() as *const _,
3796 Some(transmute(focus_out_event_trampoline::<Self, F> as usize)),
3797 Box_::into_raw(f),
3798 )
3799 }
3800 }
3801
3802 fn connect_grab_broken_event<F: Fn(&Self, &gdk::EventGrabBroken) -> Inhibit + 'static>(
3803 &self,
3804 f: F,
3805 ) -> SignalHandlerId {
3806 unsafe extern "C" fn grab_broken_event_trampoline<
3807 P,
3808 F: Fn(&P, &gdk::EventGrabBroken) -> Inhibit + 'static,
3809 >(
3810 this: *mut gtk_sys::GtkWidget,
3811 event: *mut gdk_sys::GdkEventGrabBroken,
3812 f: glib_sys::gpointer,
3813 ) -> glib_sys::gboolean
3814 where
3815 P: IsA<Widget>,
3816 {
3817 let f: &F = &*(f as *const F);
3818 f(
3819 &Widget::from_glib_borrow(this).unsafe_cast(),
3820 &from_glib_borrow(event),
3821 )
3822 .to_glib()
3823 }
3824 unsafe {
3825 let f: Box_<F> = Box_::new(f);
3826 connect_raw(
3827 self.as_ptr() as *mut _,
3828 b"grab-broken-event\0".as_ptr() as *const _,
3829 Some(transmute(grab_broken_event_trampoline::<Self, F> as usize)),
3830 Box_::into_raw(f),
3831 )
3832 }
3833 }
3834
3835 fn connect_grab_focus<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3836 unsafe extern "C" fn grab_focus_trampoline<P, F: Fn(&P) + 'static>(
3837 this: *mut gtk_sys::GtkWidget,
3838 f: glib_sys::gpointer,
3839 ) where
3840 P: IsA<Widget>,
3841 {
3842 let f: &F = &*(f as *const F);
3843 f(&Widget::from_glib_borrow(this).unsafe_cast())
3844 }
3845 unsafe {
3846 let f: Box_<F> = Box_::new(f);
3847 connect_raw(
3848 self.as_ptr() as *mut _,
3849 b"grab-focus\0".as_ptr() as *const _,
3850 Some(transmute(grab_focus_trampoline::<Self, F> as usize)),
3851 Box_::into_raw(f),
3852 )
3853 }
3854 }
3855
3856 fn emit_grab_focus(&self) {
3857 let _ = unsafe {
3858 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
3859 .emit("grab-focus", &[])
3860 .unwrap()
3861 };
3862 }
3863
3864 fn connect_grab_notify<F: Fn(&Self, bool) + 'static>(&self, f: F) -> SignalHandlerId {
3865 unsafe extern "C" fn grab_notify_trampoline<P, F: Fn(&P, bool) + 'static>(
3866 this: *mut gtk_sys::GtkWidget,
3867 was_grabbed: glib_sys::gboolean,
3868 f: glib_sys::gpointer,
3869 ) where
3870 P: IsA<Widget>,
3871 {
3872 let f: &F = &*(f as *const F);
3873 f(
3874 &Widget::from_glib_borrow(this).unsafe_cast(),
3875 from_glib(was_grabbed),
3876 )
3877 }
3878 unsafe {
3879 let f: Box_<F> = Box_::new(f);
3880 connect_raw(
3881 self.as_ptr() as *mut _,
3882 b"grab-notify\0".as_ptr() as *const _,
3883 Some(transmute(grab_notify_trampoline::<Self, F> as usize)),
3884 Box_::into_raw(f),
3885 )
3886 }
3887 }
3888
3889 fn connect_hide<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3890 unsafe extern "C" fn hide_trampoline<P, F: Fn(&P) + 'static>(
3891 this: *mut gtk_sys::GtkWidget,
3892 f: glib_sys::gpointer,
3893 ) where
3894 P: IsA<Widget>,
3895 {
3896 let f: &F = &*(f as *const F);
3897 f(&Widget::from_glib_borrow(this).unsafe_cast())
3898 }
3899 unsafe {
3900 let f: Box_<F> = Box_::new(f);
3901 connect_raw(
3902 self.as_ptr() as *mut _,
3903 b"hide\0".as_ptr() as *const _,
3904 Some(transmute(hide_trampoline::<Self, F> as usize)),
3905 Box_::into_raw(f),
3906 )
3907 }
3908 }
3909
3910 fn connect_hierarchy_changed<F: Fn(&Self, Option<&Widget>) + 'static>(
3911 &self,
3912 f: F,
3913 ) -> SignalHandlerId {
3914 unsafe extern "C" fn hierarchy_changed_trampoline<P, F: Fn(&P, Option<&Widget>) + 'static>(
3915 this: *mut gtk_sys::GtkWidget,
3916 previous_toplevel: *mut gtk_sys::GtkWidget,
3917 f: glib_sys::gpointer,
3918 ) where
3919 P: IsA<Widget>,
3920 {
3921 let f: &F = &*(f as *const F);
3922 f(
3923 &Widget::from_glib_borrow(this).unsafe_cast(),
3924 Option::<Widget>::from_glib_borrow(previous_toplevel).as_ref(),
3925 )
3926 }
3927 unsafe {
3928 let f: Box_<F> = Box_::new(f);
3929 connect_raw(
3930 self.as_ptr() as *mut _,
3931 b"hierarchy-changed\0".as_ptr() as *const _,
3932 Some(transmute(hierarchy_changed_trampoline::<Self, F> as usize)),
3933 Box_::into_raw(f),
3934 )
3935 }
3936 }
3937
3938 fn connect_key_press_event<F: Fn(&Self, &gdk::EventKey) -> Inhibit + 'static>(
3939 &self,
3940 f: F,
3941 ) -> SignalHandlerId {
3942 unsafe extern "C" fn key_press_event_trampoline<
3943 P,
3944 F: Fn(&P, &gdk::EventKey) -> Inhibit + 'static,
3945 >(
3946 this: *mut gtk_sys::GtkWidget,
3947 event: *mut gdk_sys::GdkEventKey,
3948 f: glib_sys::gpointer,
3949 ) -> glib_sys::gboolean
3950 where
3951 P: IsA<Widget>,
3952 {
3953 let f: &F = &*(f as *const F);
3954 f(
3955 &Widget::from_glib_borrow(this).unsafe_cast(),
3956 &from_glib_borrow(event),
3957 )
3958 .to_glib()
3959 }
3960 unsafe {
3961 let f: Box_<F> = Box_::new(f);
3962 connect_raw(
3963 self.as_ptr() as *mut _,
3964 b"key-press-event\0".as_ptr() as *const _,
3965 Some(transmute(key_press_event_trampoline::<Self, F> as usize)),
3966 Box_::into_raw(f),
3967 )
3968 }
3969 }
3970
3971 fn connect_key_release_event<F: Fn(&Self, &gdk::EventKey) -> Inhibit + 'static>(
3972 &self,
3973 f: F,
3974 ) -> SignalHandlerId {
3975 unsafe extern "C" fn key_release_event_trampoline<
3976 P,
3977 F: Fn(&P, &gdk::EventKey) -> Inhibit + 'static,
3978 >(
3979 this: *mut gtk_sys::GtkWidget,
3980 event: *mut gdk_sys::GdkEventKey,
3981 f: glib_sys::gpointer,
3982 ) -> glib_sys::gboolean
3983 where
3984 P: IsA<Widget>,
3985 {
3986 let f: &F = &*(f as *const F);
3987 f(
3988 &Widget::from_glib_borrow(this).unsafe_cast(),
3989 &from_glib_borrow(event),
3990 )
3991 .to_glib()
3992 }
3993 unsafe {
3994 let f: Box_<F> = Box_::new(f);
3995 connect_raw(
3996 self.as_ptr() as *mut _,
3997 b"key-release-event\0".as_ptr() as *const _,
3998 Some(transmute(key_release_event_trampoline::<Self, F> as usize)),
3999 Box_::into_raw(f),
4000 )
4001 }
4002 }
4003
4004 fn connect_keynav_failed<F: Fn(&Self, DirectionType) -> Inhibit + 'static>(
4005 &self,
4006 f: F,
4007 ) -> SignalHandlerId {
4008 unsafe extern "C" fn keynav_failed_trampoline<
4009 P,
4010 F: Fn(&P, DirectionType) -> Inhibit + 'static,
4011 >(
4012 this: *mut gtk_sys::GtkWidget,
4013 direction: gtk_sys::GtkDirectionType,
4014 f: glib_sys::gpointer,
4015 ) -> glib_sys::gboolean
4016 where
4017 P: IsA<Widget>,
4018 {
4019 let f: &F = &*(f as *const F);
4020 f(
4021 &Widget::from_glib_borrow(this).unsafe_cast(),
4022 from_glib(direction),
4023 )
4024 .to_glib()
4025 }
4026 unsafe {
4027 let f: Box_<F> = Box_::new(f);
4028 connect_raw(
4029 self.as_ptr() as *mut _,
4030 b"keynav-failed\0".as_ptr() as *const _,
4031 Some(transmute(keynav_failed_trampoline::<Self, F> as usize)),
4032 Box_::into_raw(f),
4033 )
4034 }
4035 }
4036
4037 fn connect_leave_notify_event<F: Fn(&Self, &gdk::EventCrossing) -> Inhibit + 'static>(
4038 &self,
4039 f: F,
4040 ) -> SignalHandlerId {
4041 unsafe extern "C" fn leave_notify_event_trampoline<
4042 P,
4043 F: Fn(&P, &gdk::EventCrossing) -> Inhibit + 'static,
4044 >(
4045 this: *mut gtk_sys::GtkWidget,
4046 event: *mut gdk_sys::GdkEventCrossing,
4047 f: glib_sys::gpointer,
4048 ) -> glib_sys::gboolean
4049 where
4050 P: IsA<Widget>,
4051 {
4052 let f: &F = &*(f as *const F);
4053 f(
4054 &Widget::from_glib_borrow(this).unsafe_cast(),
4055 &from_glib_borrow(event),
4056 )
4057 .to_glib()
4058 }
4059 unsafe {
4060 let f: Box_<F> = Box_::new(f);
4061 connect_raw(
4062 self.as_ptr() as *mut _,
4063 b"leave-notify-event\0".as_ptr() as *const _,
4064 Some(transmute(leave_notify_event_trampoline::<Self, F> as usize)),
4065 Box_::into_raw(f),
4066 )
4067 }
4068 }
4069
4070 fn connect_map<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4071 unsafe extern "C" fn map_trampoline<P, F: Fn(&P) + 'static>(
4072 this: *mut gtk_sys::GtkWidget,
4073 f: glib_sys::gpointer,
4074 ) where
4075 P: IsA<Widget>,
4076 {
4077 let f: &F = &*(f as *const F);
4078 f(&Widget::from_glib_borrow(this).unsafe_cast())
4079 }
4080 unsafe {
4081 let f: Box_<F> = Box_::new(f);
4082 connect_raw(
4083 self.as_ptr() as *mut _,
4084 b"map\0".as_ptr() as *const _,
4085 Some(transmute(map_trampoline::<Self, F> as usize)),
4086 Box_::into_raw(f),
4087 )
4088 }
4089 }
4090
4091 fn connect_mnemonic_activate<F: Fn(&Self, bool) -> Inhibit + 'static>(
4092 &self,
4093 f: F,
4094 ) -> SignalHandlerId {
4095 unsafe extern "C" fn mnemonic_activate_trampoline<P, F: Fn(&P, bool) -> Inhibit + 'static>(
4096 this: *mut gtk_sys::GtkWidget,
4097 group_cycling: glib_sys::gboolean,
4098 f: glib_sys::gpointer,
4099 ) -> glib_sys::gboolean
4100 where
4101 P: IsA<Widget>,
4102 {
4103 let f: &F = &*(f as *const F);
4104 f(
4105 &Widget::from_glib_borrow(this).unsafe_cast(),
4106 from_glib(group_cycling),
4107 )
4108 .to_glib()
4109 }
4110 unsafe {
4111 let f: Box_<F> = Box_::new(f);
4112 connect_raw(
4113 self.as_ptr() as *mut _,
4114 b"mnemonic-activate\0".as_ptr() as *const _,
4115 Some(transmute(mnemonic_activate_trampoline::<Self, F> as usize)),
4116 Box_::into_raw(f),
4117 )
4118 }
4119 }
4120
4121 fn connect_motion_notify_event<F: Fn(&Self, &gdk::EventMotion) -> Inhibit + 'static>(
4122 &self,
4123 f: F,
4124 ) -> SignalHandlerId {
4125 unsafe extern "C" fn motion_notify_event_trampoline<
4126 P,
4127 F: Fn(&P, &gdk::EventMotion) -> Inhibit + 'static,
4128 >(
4129 this: *mut gtk_sys::GtkWidget,
4130 event: *mut gdk_sys::GdkEventMotion,
4131 f: glib_sys::gpointer,
4132 ) -> glib_sys::gboolean
4133 where
4134 P: IsA<Widget>,
4135 {
4136 let f: &F = &*(f as *const F);
4137 f(
4138 &Widget::from_glib_borrow(this).unsafe_cast(),
4139 &from_glib_borrow(event),
4140 )
4141 .to_glib()
4142 }
4143 unsafe {
4144 let f: Box_<F> = Box_::new(f);
4145 connect_raw(
4146 self.as_ptr() as *mut _,
4147 b"motion-notify-event\0".as_ptr() as *const _,
4148 Some(transmute(
4149 motion_notify_event_trampoline::<Self, F> as usize,
4150 )),
4151 Box_::into_raw(f),
4152 )
4153 }
4154 }
4155
4156 fn connect_move_focus<F: Fn(&Self, DirectionType) + 'static>(&self, f: F) -> SignalHandlerId {
4157 unsafe extern "C" fn move_focus_trampoline<P, F: Fn(&P, DirectionType) + 'static>(
4158 this: *mut gtk_sys::GtkWidget,
4159 direction: gtk_sys::GtkDirectionType,
4160 f: glib_sys::gpointer,
4161 ) where
4162 P: IsA<Widget>,
4163 {
4164 let f: &F = &*(f as *const F);
4165 f(
4166 &Widget::from_glib_borrow(this).unsafe_cast(),
4167 from_glib(direction),
4168 )
4169 }
4170 unsafe {
4171 let f: Box_<F> = Box_::new(f);
4172 connect_raw(
4173 self.as_ptr() as *mut _,
4174 b"move-focus\0".as_ptr() as *const _,
4175 Some(transmute(move_focus_trampoline::<Self, F> as usize)),
4176 Box_::into_raw(f),
4177 )
4178 }
4179 }
4180
4181 fn emit_move_focus(&self, direction: DirectionType) {
4182 let _ = unsafe {
4183 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
4184 .emit("move-focus", &[&direction])
4185 .unwrap()
4186 };
4187 }
4188
4189 fn connect_parent_set<F: Fn(&Self, Option<&Widget>) + 'static>(&self, f: F) -> SignalHandlerId {
4190 unsafe extern "C" fn parent_set_trampoline<P, F: Fn(&P, Option<&Widget>) + 'static>(
4191 this: *mut gtk_sys::GtkWidget,
4192 old_parent: *mut gtk_sys::GtkWidget,
4193 f: glib_sys::gpointer,
4194 ) where
4195 P: IsA<Widget>,
4196 {
4197 let f: &F = &*(f as *const F);
4198 f(
4199 &Widget::from_glib_borrow(this).unsafe_cast(),
4200 Option::<Widget>::from_glib_borrow(old_parent).as_ref(),
4201 )
4202 }
4203 unsafe {
4204 let f: Box_<F> = Box_::new(f);
4205 connect_raw(
4206 self.as_ptr() as *mut _,
4207 b"parent-set\0".as_ptr() as *const _,
4208 Some(transmute(parent_set_trampoline::<Self, F> as usize)),
4209 Box_::into_raw(f),
4210 )
4211 }
4212 }
4213
4214 fn connect_popup_menu<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId {
4215 unsafe extern "C" fn popup_menu_trampoline<P, F: Fn(&P) -> bool + 'static>(
4216 this: *mut gtk_sys::GtkWidget,
4217 f: glib_sys::gpointer,
4218 ) -> glib_sys::gboolean
4219 where
4220 P: IsA<Widget>,
4221 {
4222 let f: &F = &*(f as *const F);
4223 f(&Widget::from_glib_borrow(this).unsafe_cast()).to_glib()
4224 }
4225 unsafe {
4226 let f: Box_<F> = Box_::new(f);
4227 connect_raw(
4228 self.as_ptr() as *mut _,
4229 b"popup-menu\0".as_ptr() as *const _,
4230 Some(transmute(popup_menu_trampoline::<Self, F> as usize)),
4231 Box_::into_raw(f),
4232 )
4233 }
4234 }
4235
4236 fn emit_popup_menu(&self) -> bool {
4237 let res = unsafe {
4238 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
4239 .emit("popup-menu", &[])
4240 .unwrap()
4241 };
4242 res.unwrap().get().unwrap()
4243 }
4244
4245 fn connect_property_notify_event<F: Fn(&Self, &gdk::EventProperty) -> Inhibit + 'static>(
4246 &self,
4247 f: F,
4248 ) -> SignalHandlerId {
4249 unsafe extern "C" fn property_notify_event_trampoline<
4250 P,
4251 F: Fn(&P, &gdk::EventProperty) -> Inhibit + 'static,
4252 >(
4253 this: *mut gtk_sys::GtkWidget,
4254 event: *mut gdk_sys::GdkEventProperty,
4255 f: glib_sys::gpointer,
4256 ) -> glib_sys::gboolean
4257 where
4258 P: IsA<Widget>,
4259 {
4260 let f: &F = &*(f as *const F);
4261 f(
4262 &Widget::from_glib_borrow(this).unsafe_cast(),
4263 &from_glib_borrow(event),
4264 )
4265 .to_glib()
4266 }
4267 unsafe {
4268 let f: Box_<F> = Box_::new(f);
4269 connect_raw(
4270 self.as_ptr() as *mut _,
4271 b"property-notify-event\0".as_ptr() as *const _,
4272 Some(transmute(
4273 property_notify_event_trampoline::<Self, F> as usize,
4274 )),
4275 Box_::into_raw(f),
4276 )
4277 }
4278 }
4279
4280 fn connect_proximity_in_event<F: Fn(&Self, &gdk::EventProximity) -> Inhibit + 'static>(
4281 &self,
4282 f: F,
4283 ) -> SignalHandlerId {
4284 unsafe extern "C" fn proximity_in_event_trampoline<
4285 P,
4286 F: Fn(&P, &gdk::EventProximity) -> Inhibit + 'static,
4287 >(
4288 this: *mut gtk_sys::GtkWidget,
4289 event: *mut gdk_sys::GdkEventProximity,
4290 f: glib_sys::gpointer,
4291 ) -> glib_sys::gboolean
4292 where
4293 P: IsA<Widget>,
4294 {
4295 let f: &F = &*(f as *const F);
4296 f(
4297 &Widget::from_glib_borrow(this).unsafe_cast(),
4298 &from_glib_borrow(event),
4299 )
4300 .to_glib()
4301 }
4302 unsafe {
4303 let f: Box_<F> = Box_::new(f);
4304 connect_raw(
4305 self.as_ptr() as *mut _,
4306 b"proximity-in-event\0".as_ptr() as *const _,
4307 Some(transmute(proximity_in_event_trampoline::<Self, F> as usize)),
4308 Box_::into_raw(f),
4309 )
4310 }
4311 }
4312
4313 fn connect_proximity_out_event<F: Fn(&Self, &gdk::EventProximity) -> Inhibit + 'static>(
4314 &self,
4315 f: F,
4316 ) -> SignalHandlerId {
4317 unsafe extern "C" fn proximity_out_event_trampoline<
4318 P,
4319 F: Fn(&P, &gdk::EventProximity) -> Inhibit + 'static,
4320 >(
4321 this: *mut gtk_sys::GtkWidget,
4322 event: *mut gdk_sys::GdkEventProximity,
4323 f: glib_sys::gpointer,
4324 ) -> glib_sys::gboolean
4325 where
4326 P: IsA<Widget>,
4327 {
4328 let f: &F = &*(f as *const F);
4329 f(
4330 &Widget::from_glib_borrow(this).unsafe_cast(),
4331 &from_glib_borrow(event),
4332 )
4333 .to_glib()
4334 }
4335 unsafe {
4336 let f: Box_<F> = Box_::new(f);
4337 connect_raw(
4338 self.as_ptr() as *mut _,
4339 b"proximity-out-event\0".as_ptr() as *const _,
4340 Some(transmute(
4341 proximity_out_event_trampoline::<Self, F> as usize,
4342 )),
4343 Box_::into_raw(f),
4344 )
4345 }
4346 }
4347
4348 fn connect_query_tooltip<F: Fn(&Self, i32, i32, bool, &Tooltip) -> bool + 'static>(
4349 &self,
4350 f: F,
4351 ) -> SignalHandlerId {
4352 unsafe extern "C" fn query_tooltip_trampoline<
4353 P,
4354 F: Fn(&P, i32, i32, bool, &Tooltip) -> bool + 'static,
4355 >(
4356 this: *mut gtk_sys::GtkWidget,
4357 x: libc::c_int,
4358 y: libc::c_int,
4359 keyboard_mode: glib_sys::gboolean,
4360 tooltip: *mut gtk_sys::GtkTooltip,
4361 f: glib_sys::gpointer,
4362 ) -> glib_sys::gboolean
4363 where
4364 P: IsA<Widget>,
4365 {
4366 let f: &F = &*(f as *const F);
4367 f(
4368 &Widget::from_glib_borrow(this).unsafe_cast(),
4369 x,
4370 y,
4371 from_glib(keyboard_mode),
4372 &from_glib_borrow(tooltip),
4373 )
4374 .to_glib()
4375 }
4376 unsafe {
4377 let f: Box_<F> = Box_::new(f);
4378 connect_raw(
4379 self.as_ptr() as *mut _,
4380 b"query-tooltip\0".as_ptr() as *const _,
4381 Some(transmute(query_tooltip_trampoline::<Self, F> as usize)),
4382 Box_::into_raw(f),
4383 )
4384 }
4385 }
4386
4387 fn connect_realize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4388 unsafe extern "C" fn realize_trampoline<P, F: Fn(&P) + 'static>(
4389 this: *mut gtk_sys::GtkWidget,
4390 f: glib_sys::gpointer,
4391 ) where
4392 P: IsA<Widget>,
4393 {
4394 let f: &F = &*(f as *const F);
4395 f(&Widget::from_glib_borrow(this).unsafe_cast())
4396 }
4397 unsafe {
4398 let f: Box_<F> = Box_::new(f);
4399 connect_raw(
4400 self.as_ptr() as *mut _,
4401 b"realize\0".as_ptr() as *const _,
4402 Some(transmute(realize_trampoline::<Self, F> as usize)),
4403 Box_::into_raw(f),
4404 )
4405 }
4406 }
4407
4408 fn connect_screen_changed<F: Fn(&Self, Option<&gdk::Screen>) + 'static>(
4409 &self,
4410 f: F,
4411 ) -> SignalHandlerId {
4412 unsafe extern "C" fn screen_changed_trampoline<
4413 P,
4414 F: Fn(&P, Option<&gdk::Screen>) + 'static,
4415 >(
4416 this: *mut gtk_sys::GtkWidget,
4417 previous_screen: *mut gdk_sys::GdkScreen,
4418 f: glib_sys::gpointer,
4419 ) where
4420 P: IsA<Widget>,
4421 {
4422 let f: &F = &*(f as *const F);
4423 f(
4424 &Widget::from_glib_borrow(this).unsafe_cast(),
4425 Option::<gdk::Screen>::from_glib_borrow(previous_screen).as_ref(),
4426 )
4427 }
4428 unsafe {
4429 let f: Box_<F> = Box_::new(f);
4430 connect_raw(
4431 self.as_ptr() as *mut _,
4432 b"screen-changed\0".as_ptr() as *const _,
4433 Some(transmute(screen_changed_trampoline::<Self, F> as usize)),
4434 Box_::into_raw(f),
4435 )
4436 }
4437 }
4438
4439 fn connect_scroll_event<F: Fn(&Self, &gdk::EventScroll) -> Inhibit + 'static>(
4440 &self,
4441 f: F,
4442 ) -> SignalHandlerId {
4443 unsafe extern "C" fn scroll_event_trampoline<
4444 P,
4445 F: Fn(&P, &gdk::EventScroll) -> Inhibit + 'static,
4446 >(
4447 this: *mut gtk_sys::GtkWidget,
4448 event: *mut gdk_sys::GdkEventScroll,
4449 f: glib_sys::gpointer,
4450 ) -> glib_sys::gboolean
4451 where
4452 P: IsA<Widget>,
4453 {
4454 let f: &F = &*(f as *const F);
4455 f(
4456 &Widget::from_glib_borrow(this).unsafe_cast(),
4457 &from_glib_borrow(event),
4458 )
4459 .to_glib()
4460 }
4461 unsafe {
4462 let f: Box_<F> = Box_::new(f);
4463 connect_raw(
4464 self.as_ptr() as *mut _,
4465 b"scroll-event\0".as_ptr() as *const _,
4466 Some(transmute(scroll_event_trampoline::<Self, F> as usize)),
4467 Box_::into_raw(f),
4468 )
4469 }
4470 }
4471
4472 fn connect_selection_clear_event<F: Fn(&Self, &gdk::EventSelection) -> Inhibit + 'static>(
4473 &self,
4474 f: F,
4475 ) -> SignalHandlerId {
4476 unsafe extern "C" fn selection_clear_event_trampoline<
4477 P,
4478 F: Fn(&P, &gdk::EventSelection) -> Inhibit + 'static,
4479 >(
4480 this: *mut gtk_sys::GtkWidget,
4481 event: *mut gdk_sys::GdkEventSelection,
4482 f: glib_sys::gpointer,
4483 ) -> glib_sys::gboolean
4484 where
4485 P: IsA<Widget>,
4486 {
4487 let f: &F = &*(f as *const F);
4488 f(
4489 &Widget::from_glib_borrow(this).unsafe_cast(),
4490 &from_glib_borrow(event),
4491 )
4492 .to_glib()
4493 }
4494 unsafe {
4495 let f: Box_<F> = Box_::new(f);
4496 connect_raw(
4497 self.as_ptr() as *mut _,
4498 b"selection-clear-event\0".as_ptr() as *const _,
4499 Some(transmute(
4500 selection_clear_event_trampoline::<Self, F> as usize,
4501 )),
4502 Box_::into_raw(f),
4503 )
4504 }
4505 }
4506
4507 fn connect_selection_get<F: Fn(&Self, &SelectionData, u32, u32) + 'static>(
4508 &self,
4509 f: F,
4510 ) -> SignalHandlerId {
4511 unsafe extern "C" fn selection_get_trampoline<
4512 P,
4513 F: Fn(&P, &SelectionData, u32, u32) + 'static,
4514 >(
4515 this: *mut gtk_sys::GtkWidget,
4516 data: *mut gtk_sys::GtkSelectionData,
4517 info: libc::c_uint,
4518 time: libc::c_uint,
4519 f: glib_sys::gpointer,
4520 ) where
4521 P: IsA<Widget>,
4522 {
4523 let f: &F = &*(f as *const F);
4524 f(
4525 &Widget::from_glib_borrow(this).unsafe_cast(),
4526 &from_glib_borrow(data),
4527 info,
4528 time,
4529 )
4530 }
4531 unsafe {
4532 let f: Box_<F> = Box_::new(f);
4533 connect_raw(
4534 self.as_ptr() as *mut _,
4535 b"selection-get\0".as_ptr() as *const _,
4536 Some(transmute(selection_get_trampoline::<Self, F> as usize)),
4537 Box_::into_raw(f),
4538 )
4539 }
4540 }
4541
4542 fn connect_selection_notify_event<F: Fn(&Self, &gdk::EventSelection) -> Inhibit + 'static>(
4543 &self,
4544 f: F,
4545 ) -> SignalHandlerId {
4546 unsafe extern "C" fn selection_notify_event_trampoline<
4547 P,
4548 F: Fn(&P, &gdk::EventSelection) -> Inhibit + 'static,
4549 >(
4550 this: *mut gtk_sys::GtkWidget,
4551 event: *mut gdk_sys::GdkEventSelection,
4552 f: glib_sys::gpointer,
4553 ) -> glib_sys::gboolean
4554 where
4555 P: IsA<Widget>,
4556 {
4557 let f: &F = &*(f as *const F);
4558 f(
4559 &Widget::from_glib_borrow(this).unsafe_cast(),
4560 &from_glib_borrow(event),
4561 )
4562 .to_glib()
4563 }
4564 unsafe {
4565 let f: Box_<F> = Box_::new(f);
4566 connect_raw(
4567 self.as_ptr() as *mut _,
4568 b"selection-notify-event\0".as_ptr() as *const _,
4569 Some(transmute(
4570 selection_notify_event_trampoline::<Self, F> as usize,
4571 )),
4572 Box_::into_raw(f),
4573 )
4574 }
4575 }
4576
4577 fn connect_selection_received<F: Fn(&Self, &SelectionData, u32) + 'static>(
4578 &self,
4579 f: F,
4580 ) -> SignalHandlerId {
4581 unsafe extern "C" fn selection_received_trampoline<
4582 P,
4583 F: Fn(&P, &SelectionData, u32) + 'static,
4584 >(
4585 this: *mut gtk_sys::GtkWidget,
4586 data: *mut gtk_sys::GtkSelectionData,
4587 time: libc::c_uint,
4588 f: glib_sys::gpointer,
4589 ) where
4590 P: IsA<Widget>,
4591 {
4592 let f: &F = &*(f as *const F);
4593 f(
4594 &Widget::from_glib_borrow(this).unsafe_cast(),
4595 &from_glib_borrow(data),
4596 time,
4597 )
4598 }
4599 unsafe {
4600 let f: Box_<F> = Box_::new(f);
4601 connect_raw(
4602 self.as_ptr() as *mut _,
4603 b"selection-received\0".as_ptr() as *const _,
4604 Some(transmute(selection_received_trampoline::<Self, F> as usize)),
4605 Box_::into_raw(f),
4606 )
4607 }
4608 }
4609
4610 fn connect_selection_request_event<F: Fn(&Self, &gdk::EventSelection) -> Inhibit + 'static>(
4611 &self,
4612 f: F,
4613 ) -> SignalHandlerId {
4614 unsafe extern "C" fn selection_request_event_trampoline<
4615 P,
4616 F: Fn(&P, &gdk::EventSelection) -> Inhibit + 'static,
4617 >(
4618 this: *mut gtk_sys::GtkWidget,
4619 event: *mut gdk_sys::GdkEventSelection,
4620 f: glib_sys::gpointer,
4621 ) -> glib_sys::gboolean
4622 where
4623 P: IsA<Widget>,
4624 {
4625 let f: &F = &*(f as *const F);
4626 f(
4627 &Widget::from_glib_borrow(this).unsafe_cast(),
4628 &from_glib_borrow(event),
4629 )
4630 .to_glib()
4631 }
4632 unsafe {
4633 let f: Box_<F> = Box_::new(f);
4634 connect_raw(
4635 self.as_ptr() as *mut _,
4636 b"selection-request-event\0".as_ptr() as *const _,
4637 Some(transmute(
4638 selection_request_event_trampoline::<Self, F> as usize,
4639 )),
4640 Box_::into_raw(f),
4641 )
4642 }
4643 }
4644
4645 fn connect_show<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4646 unsafe extern "C" fn show_trampoline<P, F: Fn(&P) + 'static>(
4647 this: *mut gtk_sys::GtkWidget,
4648 f: glib_sys::gpointer,
4649 ) where
4650 P: IsA<Widget>,
4651 {
4652 let f: &F = &*(f as *const F);
4653 f(&Widget::from_glib_borrow(this).unsafe_cast())
4654 }
4655 unsafe {
4656 let f: Box_<F> = Box_::new(f);
4657 connect_raw(
4658 self.as_ptr() as *mut _,
4659 b"show\0".as_ptr() as *const _,
4660 Some(transmute(show_trampoline::<Self, F> as usize)),
4661 Box_::into_raw(f),
4662 )
4663 }
4664 }
4665
4666 fn connect_show_help<F: Fn(&Self, WidgetHelpType) -> bool + 'static>(
4667 &self,
4668 f: F,
4669 ) -> SignalHandlerId {
4670 unsafe extern "C" fn show_help_trampoline<P, F: Fn(&P, WidgetHelpType) -> bool + 'static>(
4671 this: *mut gtk_sys::GtkWidget,
4672 help_type: gtk_sys::GtkWidgetHelpType,
4673 f: glib_sys::gpointer,
4674 ) -> glib_sys::gboolean
4675 where
4676 P: IsA<Widget>,
4677 {
4678 let f: &F = &*(f as *const F);
4679 f(
4680 &Widget::from_glib_borrow(this).unsafe_cast(),
4681 from_glib(help_type),
4682 )
4683 .to_glib()
4684 }
4685 unsafe {
4686 let f: Box_<F> = Box_::new(f);
4687 connect_raw(
4688 self.as_ptr() as *mut _,
4689 b"show-help\0".as_ptr() as *const _,
4690 Some(transmute(show_help_trampoline::<Self, F> as usize)),
4691 Box_::into_raw(f),
4692 )
4693 }
4694 }
4695
4696 fn emit_show_help(&self, help_type: WidgetHelpType) -> bool {
4697 let res = unsafe {
4698 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject)
4699 .emit("show-help", &[&help_type])
4700 .unwrap()
4701 };
4702 res.unwrap().get().unwrap()
4703 }
4704
4705 fn connect_size_allocate<F: Fn(&Self, &Allocation) + 'static>(&self, f: F) -> SignalHandlerId {
4706 unsafe extern "C" fn size_allocate_trampoline<P, F: Fn(&P, &Allocation) + 'static>(
4707 this: *mut gtk_sys::GtkWidget,
4708 allocation: *mut gtk_sys::GtkAllocation,
4709 f: glib_sys::gpointer,
4710 ) where
4711 P: IsA<Widget>,
4712 {
4713 let f: &F = &*(f as *const F);
4714 f(
4715 &Widget::from_glib_borrow(this).unsafe_cast(),
4716 &from_glib_none(allocation),
4717 )
4718 }
4719 unsafe {
4720 let f: Box_<F> = Box_::new(f);
4721 connect_raw(
4722 self.as_ptr() as *mut _,
4723 b"size-allocate\0".as_ptr() as *const _,
4724 Some(transmute(size_allocate_trampoline::<Self, F> as usize)),
4725 Box_::into_raw(f),
4726 )
4727 }
4728 }
4729
4730 fn connect_state_flags_changed<F: Fn(&Self, StateFlags) + 'static>(
4731 &self,
4732 f: F,
4733 ) -> SignalHandlerId {
4734 unsafe extern "C" fn state_flags_changed_trampoline<P, F: Fn(&P, StateFlags) + 'static>(
4735 this: *mut gtk_sys::GtkWidget,
4736 flags: gtk_sys::GtkStateFlags,
4737 f: glib_sys::gpointer,
4738 ) where
4739 P: IsA<Widget>,
4740 {
4741 let f: &F = &*(f as *const F);
4742 f(
4743 &Widget::from_glib_borrow(this).unsafe_cast(),
4744 from_glib(flags),
4745 )
4746 }
4747 unsafe {
4748 let f: Box_<F> = Box_::new(f);
4749 connect_raw(
4750 self.as_ptr() as *mut _,
4751 b"state-flags-changed\0".as_ptr() as *const _,
4752 Some(transmute(
4753 state_flags_changed_trampoline::<Self, F> as usize,
4754 )),
4755 Box_::into_raw(f),
4756 )
4757 }
4758 }
4759
4760 fn connect_style_updated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4761 unsafe extern "C" fn style_updated_trampoline<P, F: Fn(&P) + 'static>(
4762 this: *mut gtk_sys::GtkWidget,
4763 f: glib_sys::gpointer,
4764 ) where
4765 P: IsA<Widget>,
4766 {
4767 let f: &F = &*(f as *const F);
4768 f(&Widget::from_glib_borrow(this).unsafe_cast())
4769 }
4770 unsafe {
4771 let f: Box_<F> = Box_::new(f);
4772 connect_raw(
4773 self.as_ptr() as *mut _,
4774 b"style-updated\0".as_ptr() as *const _,
4775 Some(transmute(style_updated_trampoline::<Self, F> as usize)),
4776 Box_::into_raw(f),
4777 )
4778 }
4779 }
4780
4781 fn connect_touch_event<F: Fn(&Self, &gdk::Event) -> Inhibit + 'static>(
4782 &self,
4783 f: F,
4784 ) -> SignalHandlerId {
4785 unsafe extern "C" fn touch_event_trampoline<
4786 P,
4787 F: Fn(&P, &gdk::Event) -> Inhibit + 'static,
4788 >(
4789 this: *mut gtk_sys::GtkWidget,
4790 object: *mut gdk_sys::GdkEvent,
4791 f: glib_sys::gpointer,
4792 ) -> glib_sys::gboolean
4793 where
4794 P: IsA<Widget>,
4795 {
4796 let f: &F = &*(f as *const F);
4797 f(
4798 &Widget::from_glib_borrow(this).unsafe_cast(),
4799 &from_glib_none(object),
4800 )
4801 .to_glib()
4802 }
4803 unsafe {
4804 let f: Box_<F> = Box_::new(f);
4805 connect_raw(
4806 self.as_ptr() as *mut _,
4807 b"touch-event\0".as_ptr() as *const _,
4808 Some(transmute(touch_event_trampoline::<Self, F> as usize)),
4809 Box_::into_raw(f),
4810 )
4811 }
4812 }
4813
4814 fn connect_unmap<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4815 unsafe extern "C" fn unmap_trampoline<P, F: Fn(&P) + 'static>(
4816 this: *mut gtk_sys::GtkWidget,
4817 f: glib_sys::gpointer,
4818 ) where
4819 P: IsA<Widget>,
4820 {
4821 let f: &F = &*(f as *const F);
4822 f(&Widget::from_glib_borrow(this).unsafe_cast())
4823 }
4824 unsafe {
4825 let f: Box_<F> = Box_::new(f);
4826 connect_raw(
4827 self.as_ptr() as *mut _,
4828 b"unmap\0".as_ptr() as *const _,
4829 Some(transmute(unmap_trampoline::<Self, F> as usize)),
4830 Box_::into_raw(f),
4831 )
4832 }
4833 }
4834
4835 fn connect_unrealize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4836 unsafe extern "C" fn unrealize_trampoline<P, F: Fn(&P) + 'static>(
4837 this: *mut gtk_sys::GtkWidget,
4838 f: glib_sys::gpointer,
4839 ) where
4840 P: IsA<Widget>,
4841 {
4842 let f: &F = &*(f as *const F);
4843 f(&Widget::from_glib_borrow(this).unsafe_cast())
4844 }
4845 unsafe {
4846 let f: Box_<F> = Box_::new(f);
4847 connect_raw(
4848 self.as_ptr() as *mut _,
4849 b"unrealize\0".as_ptr() as *const _,
4850 Some(transmute(unrealize_trampoline::<Self, F> as usize)),
4851 Box_::into_raw(f),
4852 )
4853 }
4854 }
4855
4856 fn connect_window_state_event<F: Fn(&Self, &gdk::EventWindowState) -> Inhibit + 'static>(
4857 &self,
4858 f: F,
4859 ) -> SignalHandlerId {
4860 unsafe extern "C" fn window_state_event_trampoline<
4861 P,
4862 F: Fn(&P, &gdk::EventWindowState) -> Inhibit + 'static,
4863 >(
4864 this: *mut gtk_sys::GtkWidget,
4865 event: *mut gdk_sys::GdkEventWindowState,
4866 f: glib_sys::gpointer,
4867 ) -> glib_sys::gboolean
4868 where
4869 P: IsA<Widget>,
4870 {
4871 let f: &F = &*(f as *const F);
4872 f(
4873 &Widget::from_glib_borrow(this).unsafe_cast(),
4874 &from_glib_borrow(event),
4875 )
4876 .to_glib()
4877 }
4878 unsafe {
4879 let f: Box_<F> = Box_::new(f);
4880 connect_raw(
4881 self.as_ptr() as *mut _,
4882 b"window-state-event\0".as_ptr() as *const _,
4883 Some(transmute(window_state_event_trampoline::<Self, F> as usize)),
4884 Box_::into_raw(f),
4885 )
4886 }
4887 }
4888
4889 fn connect_property_app_paintable_notify<F: Fn(&Self) + 'static>(
4890 &self,
4891 f: F,
4892 ) -> SignalHandlerId {
4893 unsafe extern "C" fn notify_app_paintable_trampoline<P, F: Fn(&P) + 'static>(
4894 this: *mut gtk_sys::GtkWidget,
4895 _param_spec: glib_sys::gpointer,
4896 f: glib_sys::gpointer,
4897 ) where
4898 P: IsA<Widget>,
4899 {
4900 let f: &F = &*(f as *const F);
4901 f(&Widget::from_glib_borrow(this).unsafe_cast())
4902 }
4903 unsafe {
4904 let f: Box_<F> = Box_::new(f);
4905 connect_raw(
4906 self.as_ptr() as *mut _,
4907 b"notify::app-paintable\0".as_ptr() as *const _,
4908 Some(transmute(
4909 notify_app_paintable_trampoline::<Self, F> as usize,
4910 )),
4911 Box_::into_raw(f),
4912 )
4913 }
4914 }
4915
4916 fn connect_property_can_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4917 unsafe extern "C" fn notify_can_default_trampoline<P, F: Fn(&P) + 'static>(
4918 this: *mut gtk_sys::GtkWidget,
4919 _param_spec: glib_sys::gpointer,
4920 f: glib_sys::gpointer,
4921 ) where
4922 P: IsA<Widget>,
4923 {
4924 let f: &F = &*(f as *const F);
4925 f(&Widget::from_glib_borrow(this).unsafe_cast())
4926 }
4927 unsafe {
4928 let f: Box_<F> = Box_::new(f);
4929 connect_raw(
4930 self.as_ptr() as *mut _,
4931 b"notify::can-default\0".as_ptr() as *const _,
4932 Some(transmute(notify_can_default_trampoline::<Self, F> as usize)),
4933 Box_::into_raw(f),
4934 )
4935 }
4936 }
4937
4938 fn connect_property_can_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4939 unsafe extern "C" fn notify_can_focus_trampoline<P, F: Fn(&P) + 'static>(
4940 this: *mut gtk_sys::GtkWidget,
4941 _param_spec: glib_sys::gpointer,
4942 f: glib_sys::gpointer,
4943 ) where
4944 P: IsA<Widget>,
4945 {
4946 let f: &F = &*(f as *const F);
4947 f(&Widget::from_glib_borrow(this).unsafe_cast())
4948 }
4949 unsafe {
4950 let f: Box_<F> = Box_::new(f);
4951 connect_raw(
4952 self.as_ptr() as *mut _,
4953 b"notify::can-focus\0".as_ptr() as *const _,
4954 Some(transmute(notify_can_focus_trampoline::<Self, F> as usize)),
4955 Box_::into_raw(f),
4956 )
4957 }
4958 }
4959
4960 fn connect_property_composite_child_notify<F: Fn(&Self) + 'static>(
4961 &self,
4962 f: F,
4963 ) -> SignalHandlerId {
4964 unsafe extern "C" fn notify_composite_child_trampoline<P, F: Fn(&P) + 'static>(
4965 this: *mut gtk_sys::GtkWidget,
4966 _param_spec: glib_sys::gpointer,
4967 f: glib_sys::gpointer,
4968 ) where
4969 P: IsA<Widget>,
4970 {
4971 let f: &F = &*(f as *const F);
4972 f(&Widget::from_glib_borrow(this).unsafe_cast())
4973 }
4974 unsafe {
4975 let f: Box_<F> = Box_::new(f);
4976 connect_raw(
4977 self.as_ptr() as *mut _,
4978 b"notify::composite-child\0".as_ptr() as *const _,
4979 Some(transmute(
4980 notify_composite_child_trampoline::<Self, F> as usize,
4981 )),
4982 Box_::into_raw(f),
4983 )
4984 }
4985 }
4986
4987 fn connect_property_events_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4988 unsafe extern "C" fn notify_events_trampoline<P, F: Fn(&P) + 'static>(
4989 this: *mut gtk_sys::GtkWidget,
4990 _param_spec: glib_sys::gpointer,
4991 f: glib_sys::gpointer,
4992 ) where
4993 P: IsA<Widget>,
4994 {
4995 let f: &F = &*(f as *const F);
4996 f(&Widget::from_glib_borrow(this).unsafe_cast())
4997 }
4998 unsafe {
4999 let f: Box_<F> = Box_::new(f);
5000 connect_raw(
5001 self.as_ptr() as *mut _,
5002 b"notify::events\0".as_ptr() as *const _,
5003 Some(transmute(notify_events_trampoline::<Self, F> as usize)),
5004 Box_::into_raw(f),
5005 )
5006 }
5007 }
5008
5009 fn connect_property_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5010 unsafe extern "C" fn notify_expand_trampoline<P, F: Fn(&P) + 'static>(
5011 this: *mut gtk_sys::GtkWidget,
5012 _param_spec: glib_sys::gpointer,
5013 f: glib_sys::gpointer,
5014 ) where
5015 P: IsA<Widget>,
5016 {
5017 let f: &F = &*(f as *const F);
5018 f(&Widget::from_glib_borrow(this).unsafe_cast())
5019 }
5020 unsafe {
5021 let f: Box_<F> = Box_::new(f);
5022 connect_raw(
5023 self.as_ptr() as *mut _,
5024 b"notify::expand\0".as_ptr() as *const _,
5025 Some(transmute(notify_expand_trampoline::<Self, F> as usize)),
5026 Box_::into_raw(f),
5027 )
5028 }
5029 }
5030
5031 #[cfg(any(feature = "v3_20", feature = "dox"))]
5032 fn connect_property_focus_on_click_notify<F: Fn(&Self) + 'static>(
5033 &self,
5034 f: F,
5035 ) -> SignalHandlerId {
5036 unsafe extern "C" fn notify_focus_on_click_trampoline<P, F: Fn(&P) + 'static>(
5037 this: *mut gtk_sys::GtkWidget,
5038 _param_spec: glib_sys::gpointer,
5039 f: glib_sys::gpointer,
5040 ) where
5041 P: IsA<Widget>,
5042 {
5043 let f: &F = &*(f as *const F);
5044 f(&Widget::from_glib_borrow(this).unsafe_cast())
5045 }
5046 unsafe {
5047 let f: Box_<F> = Box_::new(f);
5048 connect_raw(
5049 self.as_ptr() as *mut _,
5050 b"notify::focus-on-click\0".as_ptr() as *const _,
5051 Some(transmute(
5052 notify_focus_on_click_trampoline::<Self, F> as usize,
5053 )),
5054 Box_::into_raw(f),
5055 )
5056 }
5057 }
5058
5059 fn connect_property_halign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5060 unsafe extern "C" fn notify_halign_trampoline<P, F: Fn(&P) + 'static>(
5061 this: *mut gtk_sys::GtkWidget,
5062 _param_spec: glib_sys::gpointer,
5063 f: glib_sys::gpointer,
5064 ) where
5065 P: IsA<Widget>,
5066 {
5067 let f: &F = &*(f as *const F);
5068 f(&Widget::from_glib_borrow(this).unsafe_cast())
5069 }
5070 unsafe {
5071 let f: Box_<F> = Box_::new(f);
5072 connect_raw(
5073 self.as_ptr() as *mut _,
5074 b"notify::halign\0".as_ptr() as *const _,
5075 Some(transmute(notify_halign_trampoline::<Self, F> as usize)),
5076 Box_::into_raw(f),
5077 )
5078 }
5079 }
5080
5081 fn connect_property_has_default_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5082 unsafe extern "C" fn notify_has_default_trampoline<P, F: Fn(&P) + 'static>(
5083 this: *mut gtk_sys::GtkWidget,
5084 _param_spec: glib_sys::gpointer,
5085 f: glib_sys::gpointer,
5086 ) where
5087 P: IsA<Widget>,
5088 {
5089 let f: &F = &*(f as *const F);
5090 f(&Widget::from_glib_borrow(this).unsafe_cast())
5091 }
5092 unsafe {
5093 let f: Box_<F> = Box_::new(f);
5094 connect_raw(
5095 self.as_ptr() as *mut _,
5096 b"notify::has-default\0".as_ptr() as *const _,
5097 Some(transmute(notify_has_default_trampoline::<Self, F> as usize)),
5098 Box_::into_raw(f),
5099 )
5100 }
5101 }
5102
5103 fn connect_property_has_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5104 unsafe extern "C" fn notify_has_focus_trampoline<P, F: Fn(&P) + 'static>(
5105 this: *mut gtk_sys::GtkWidget,
5106 _param_spec: glib_sys::gpointer,
5107 f: glib_sys::gpointer,
5108 ) where
5109 P: IsA<Widget>,
5110 {
5111 let f: &F = &*(f as *const F);
5112 f(&Widget::from_glib_borrow(this).unsafe_cast())
5113 }
5114 unsafe {
5115 let f: Box_<F> = Box_::new(f);
5116 connect_raw(
5117 self.as_ptr() as *mut _,
5118 b"notify::has-focus\0".as_ptr() as *const _,
5119 Some(transmute(notify_has_focus_trampoline::<Self, F> as usize)),
5120 Box_::into_raw(f),
5121 )
5122 }
5123 }
5124
5125 fn connect_property_has_tooltip_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5126 unsafe extern "C" fn notify_has_tooltip_trampoline<P, F: Fn(&P) + 'static>(
5127 this: *mut gtk_sys::GtkWidget,
5128 _param_spec: glib_sys::gpointer,
5129 f: glib_sys::gpointer,
5130 ) where
5131 P: IsA<Widget>,
5132 {
5133 let f: &F = &*(f as *const F);
5134 f(&Widget::from_glib_borrow(this).unsafe_cast())
5135 }
5136 unsafe {
5137 let f: Box_<F> = Box_::new(f);
5138 connect_raw(
5139 self.as_ptr() as *mut _,
5140 b"notify::has-tooltip\0".as_ptr() as *const _,
5141 Some(transmute(notify_has_tooltip_trampoline::<Self, F> as usize)),
5142 Box_::into_raw(f),
5143 )
5144 }
5145 }
5146
5147 fn connect_property_height_request_notify<F: Fn(&Self) + 'static>(
5148 &self,
5149 f: F,
5150 ) -> SignalHandlerId {
5151 unsafe extern "C" fn notify_height_request_trampoline<P, F: Fn(&P) + 'static>(
5152 this: *mut gtk_sys::GtkWidget,
5153 _param_spec: glib_sys::gpointer,
5154 f: glib_sys::gpointer,
5155 ) where
5156 P: IsA<Widget>,
5157 {
5158 let f: &F = &*(f as *const F);
5159 f(&Widget::from_glib_borrow(this).unsafe_cast())
5160 }
5161 unsafe {
5162 let f: Box_<F> = Box_::new(f);
5163 connect_raw(
5164 self.as_ptr() as *mut _,
5165 b"notify::height-request\0".as_ptr() as *const _,
5166 Some(transmute(
5167 notify_height_request_trampoline::<Self, F> as usize,
5168 )),
5169 Box_::into_raw(f),
5170 )
5171 }
5172 }
5173
5174 fn connect_property_hexpand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5175 unsafe extern "C" fn notify_hexpand_trampoline<P, F: Fn(&P) + 'static>(
5176 this: *mut gtk_sys::GtkWidget,
5177 _param_spec: glib_sys::gpointer,
5178 f: glib_sys::gpointer,
5179 ) where
5180 P: IsA<Widget>,
5181 {
5182 let f: &F = &*(f as *const F);
5183 f(&Widget::from_glib_borrow(this).unsafe_cast())
5184 }
5185 unsafe {
5186 let f: Box_<F> = Box_::new(f);
5187 connect_raw(
5188 self.as_ptr() as *mut _,
5189 b"notify::hexpand\0".as_ptr() as *const _,
5190 Some(transmute(notify_hexpand_trampoline::<Self, F> as usize)),
5191 Box_::into_raw(f),
5192 )
5193 }
5194 }
5195
5196 fn connect_property_hexpand_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5197 unsafe extern "C" fn notify_hexpand_set_trampoline<P, F: Fn(&P) + 'static>(
5198 this: *mut gtk_sys::GtkWidget,
5199 _param_spec: glib_sys::gpointer,
5200 f: glib_sys::gpointer,
5201 ) where
5202 P: IsA<Widget>,
5203 {
5204 let f: &F = &*(f as *const F);
5205 f(&Widget::from_glib_borrow(this).unsafe_cast())
5206 }
5207 unsafe {
5208 let f: Box_<F> = Box_::new(f);
5209 connect_raw(
5210 self.as_ptr() as *mut _,
5211 b"notify::hexpand-set\0".as_ptr() as *const _,
5212 Some(transmute(notify_hexpand_set_trampoline::<Self, F> as usize)),
5213 Box_::into_raw(f),
5214 )
5215 }
5216 }
5217
5218 fn connect_property_is_focus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5219 unsafe extern "C" fn notify_is_focus_trampoline<P, F: Fn(&P) + 'static>(
5220 this: *mut gtk_sys::GtkWidget,
5221 _param_spec: glib_sys::gpointer,
5222 f: glib_sys::gpointer,
5223 ) where
5224 P: IsA<Widget>,
5225 {
5226 let f: &F = &*(f as *const F);
5227 f(&Widget::from_glib_borrow(this).unsafe_cast())
5228 }
5229 unsafe {
5230 let f: Box_<F> = Box_::new(f);
5231 connect_raw(
5232 self.as_ptr() as *mut _,
5233 b"notify::is-focus\0".as_ptr() as *const _,
5234 Some(transmute(notify_is_focus_trampoline::<Self, F> as usize)),
5235 Box_::into_raw(f),
5236 )
5237 }
5238 }
5239
5240 fn connect_property_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5241 unsafe extern "C" fn notify_margin_trampoline<P, F: Fn(&P) + 'static>(
5242 this: *mut gtk_sys::GtkWidget,
5243 _param_spec: glib_sys::gpointer,
5244 f: glib_sys::gpointer,
5245 ) where
5246 P: IsA<Widget>,
5247 {
5248 let f: &F = &*(f as *const F);
5249 f(&Widget::from_glib_borrow(this).unsafe_cast())
5250 }
5251 unsafe {
5252 let f: Box_<F> = Box_::new(f);
5253 connect_raw(
5254 self.as_ptr() as *mut _,
5255 b"notify::margin\0".as_ptr() as *const _,
5256 Some(transmute(notify_margin_trampoline::<Self, F> as usize)),
5257 Box_::into_raw(f),
5258 )
5259 }
5260 }
5261
5262 fn connect_property_margin_bottom_notify<F: Fn(&Self) + 'static>(
5263 &self,
5264 f: F,
5265 ) -> SignalHandlerId {
5266 unsafe extern "C" fn notify_margin_bottom_trampoline<P, F: Fn(&P) + 'static>(
5267 this: *mut gtk_sys::GtkWidget,
5268 _param_spec: glib_sys::gpointer,
5269 f: glib_sys::gpointer,
5270 ) where
5271 P: IsA<Widget>,
5272 {
5273 let f: &F = &*(f as *const F);
5274 f(&Widget::from_glib_borrow(this).unsafe_cast())
5275 }
5276 unsafe {
5277 let f: Box_<F> = Box_::new(f);
5278 connect_raw(
5279 self.as_ptr() as *mut _,
5280 b"notify::margin-bottom\0".as_ptr() as *const _,
5281 Some(transmute(
5282 notify_margin_bottom_trampoline::<Self, F> as usize,
5283 )),
5284 Box_::into_raw(f),
5285 )
5286 }
5287 }
5288
5289 fn connect_property_margin_end_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5290 unsafe extern "C" fn notify_margin_end_trampoline<P, F: Fn(&P) + 'static>(
5291 this: *mut gtk_sys::GtkWidget,
5292 _param_spec: glib_sys::gpointer,
5293 f: glib_sys::gpointer,
5294 ) where
5295 P: IsA<Widget>,
5296 {
5297 let f: &F = &*(f as *const F);
5298 f(&Widget::from_glib_borrow(this).unsafe_cast())
5299 }
5300 unsafe {
5301 let f: Box_<F> = Box_::new(f);
5302 connect_raw(
5303 self.as_ptr() as *mut _,
5304 b"notify::margin-end\0".as_ptr() as *const _,
5305 Some(transmute(notify_margin_end_trampoline::<Self, F> as usize)),
5306 Box_::into_raw(f),
5307 )
5308 }
5309 }
5310
5311 fn connect_property_margin_start_notify<F: Fn(&Self) + 'static>(
5312 &self,
5313 f: F,
5314 ) -> SignalHandlerId {
5315 unsafe extern "C" fn notify_margin_start_trampoline<P, F: Fn(&P) + 'static>(
5316 this: *mut gtk_sys::GtkWidget,
5317 _param_spec: glib_sys::gpointer,
5318 f: glib_sys::gpointer,
5319 ) where
5320 P: IsA<Widget>,
5321 {
5322 let f: &F = &*(f as *const F);
5323 f(&Widget::from_glib_borrow(this).unsafe_cast())
5324 }
5325 unsafe {
5326 let f: Box_<F> = Box_::new(f);
5327 connect_raw(
5328 self.as_ptr() as *mut _,
5329 b"notify::margin-start\0".as_ptr() as *const _,
5330 Some(transmute(
5331 notify_margin_start_trampoline::<Self, F> as usize,
5332 )),
5333 Box_::into_raw(f),
5334 )
5335 }
5336 }
5337
5338 fn connect_property_margin_top_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5339 unsafe extern "C" fn notify_margin_top_trampoline<P, F: Fn(&P) + 'static>(
5340 this: *mut gtk_sys::GtkWidget,
5341 _param_spec: glib_sys::gpointer,
5342 f: glib_sys::gpointer,
5343 ) where
5344 P: IsA<Widget>,
5345 {
5346 let f: &F = &*(f as *const F);
5347 f(&Widget::from_glib_borrow(this).unsafe_cast())
5348 }
5349 unsafe {
5350 let f: Box_<F> = Box_::new(f);
5351 connect_raw(
5352 self.as_ptr() as *mut _,
5353 b"notify::margin-top\0".as_ptr() as *const _,
5354 Some(transmute(notify_margin_top_trampoline::<Self, F> as usize)),
5355 Box_::into_raw(f),
5356 )
5357 }
5358 }
5359
5360 fn connect_property_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5361 unsafe extern "C" fn notify_name_trampoline<P, F: Fn(&P) + 'static>(
5362 this: *mut gtk_sys::GtkWidget,
5363 _param_spec: glib_sys::gpointer,
5364 f: glib_sys::gpointer,
5365 ) where
5366 P: IsA<Widget>,
5367 {
5368 let f: &F = &*(f as *const F);
5369 f(&Widget::from_glib_borrow(this).unsafe_cast())
5370 }
5371 unsafe {
5372 let f: Box_<F> = Box_::new(f);
5373 connect_raw(
5374 self.as_ptr() as *mut _,
5375 b"notify::name\0".as_ptr() as *const _,
5376 Some(transmute(notify_name_trampoline::<Self, F> as usize)),
5377 Box_::into_raw(f),
5378 )
5379 }
5380 }
5381
5382 fn connect_property_no_show_all_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5383 unsafe extern "C" fn notify_no_show_all_trampoline<P, F: Fn(&P) + 'static>(
5384 this: *mut gtk_sys::GtkWidget,
5385 _param_spec: glib_sys::gpointer,
5386 f: glib_sys::gpointer,
5387 ) where
5388 P: IsA<Widget>,
5389 {
5390 let f: &F = &*(f as *const F);
5391 f(&Widget::from_glib_borrow(this).unsafe_cast())
5392 }
5393 unsafe {
5394 let f: Box_<F> = Box_::new(f);
5395 connect_raw(
5396 self.as_ptr() as *mut _,
5397 b"notify::no-show-all\0".as_ptr() as *const _,
5398 Some(transmute(notify_no_show_all_trampoline::<Self, F> as usize)),
5399 Box_::into_raw(f),
5400 )
5401 }
5402 }
5403
5404 fn connect_property_opacity_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5405 unsafe extern "C" fn notify_opacity_trampoline<P, F: Fn(&P) + 'static>(
5406 this: *mut gtk_sys::GtkWidget,
5407 _param_spec: glib_sys::gpointer,
5408 f: glib_sys::gpointer,
5409 ) where
5410 P: IsA<Widget>,
5411 {
5412 let f: &F = &*(f as *const F);
5413 f(&Widget::from_glib_borrow(this).unsafe_cast())
5414 }
5415 unsafe {
5416 let f: Box_<F> = Box_::new(f);
5417 connect_raw(
5418 self.as_ptr() as *mut _,
5419 b"notify::opacity\0".as_ptr() as *const _,
5420 Some(transmute(notify_opacity_trampoline::<Self, F> as usize)),
5421 Box_::into_raw(f),
5422 )
5423 }
5424 }
5425
5426 fn connect_property_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5427 unsafe extern "C" fn notify_parent_trampoline<P, F: Fn(&P) + 'static>(
5428 this: *mut gtk_sys::GtkWidget,
5429 _param_spec: glib_sys::gpointer,
5430 f: glib_sys::gpointer,
5431 ) where
5432 P: IsA<Widget>,
5433 {
5434 let f: &F = &*(f as *const F);
5435 f(&Widget::from_glib_borrow(this).unsafe_cast())
5436 }
5437 unsafe {
5438 let f: Box_<F> = Box_::new(f);
5439 connect_raw(
5440 self.as_ptr() as *mut _,
5441 b"notify::parent\0".as_ptr() as *const _,
5442 Some(transmute(notify_parent_trampoline::<Self, F> as usize)),
5443 Box_::into_raw(f),
5444 )
5445 }
5446 }
5447
5448 fn connect_property_receives_default_notify<F: Fn(&Self) + 'static>(
5449 &self,
5450 f: F,
5451 ) -> SignalHandlerId {
5452 unsafe extern "C" fn notify_receives_default_trampoline<P, F: Fn(&P) + 'static>(
5453 this: *mut gtk_sys::GtkWidget,
5454 _param_spec: glib_sys::gpointer,
5455 f: glib_sys::gpointer,
5456 ) where
5457 P: IsA<Widget>,
5458 {
5459 let f: &F = &*(f as *const F);
5460 f(&Widget::from_glib_borrow(this).unsafe_cast())
5461 }
5462 unsafe {
5463 let f: Box_<F> = Box_::new(f);
5464 connect_raw(
5465 self.as_ptr() as *mut _,
5466 b"notify::receives-default\0".as_ptr() as *const _,
5467 Some(transmute(
5468 notify_receives_default_trampoline::<Self, F> as usize,
5469 )),
5470 Box_::into_raw(f),
5471 )
5472 }
5473 }
5474
5475 fn connect_property_scale_factor_notify<F: Fn(&Self) + 'static>(
5476 &self,
5477 f: F,
5478 ) -> SignalHandlerId {
5479 unsafe extern "C" fn notify_scale_factor_trampoline<P, F: Fn(&P) + 'static>(
5480 this: *mut gtk_sys::GtkWidget,
5481 _param_spec: glib_sys::gpointer,
5482 f: glib_sys::gpointer,
5483 ) where
5484 P: IsA<Widget>,
5485 {
5486 let f: &F = &*(f as *const F);
5487 f(&Widget::from_glib_borrow(this).unsafe_cast())
5488 }
5489 unsafe {
5490 let f: Box_<F> = Box_::new(f);
5491 connect_raw(
5492 self.as_ptr() as *mut _,
5493 b"notify::scale-factor\0".as_ptr() as *const _,
5494 Some(transmute(
5495 notify_scale_factor_trampoline::<Self, F> as usize,
5496 )),
5497 Box_::into_raw(f),
5498 )
5499 }
5500 }
5501
5502 fn connect_property_sensitive_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5503 unsafe extern "C" fn notify_sensitive_trampoline<P, F: Fn(&P) + 'static>(
5504 this: *mut gtk_sys::GtkWidget,
5505 _param_spec: glib_sys::gpointer,
5506 f: glib_sys::gpointer,
5507 ) where
5508 P: IsA<Widget>,
5509 {
5510 let f: &F = &*(f as *const F);
5511 f(&Widget::from_glib_borrow(this).unsafe_cast())
5512 }
5513 unsafe {
5514 let f: Box_<F> = Box_::new(f);
5515 connect_raw(
5516 self.as_ptr() as *mut _,
5517 b"notify::sensitive\0".as_ptr() as *const _,
5518 Some(transmute(notify_sensitive_trampoline::<Self, F> as usize)),
5519 Box_::into_raw(f),
5520 )
5521 }
5522 }
5523
5524 fn connect_property_tooltip_markup_notify<F: Fn(&Self) + 'static>(
5525 &self,
5526 f: F,
5527 ) -> SignalHandlerId {
5528 unsafe extern "C" fn notify_tooltip_markup_trampoline<P, F: Fn(&P) + 'static>(
5529 this: *mut gtk_sys::GtkWidget,
5530 _param_spec: glib_sys::gpointer,
5531 f: glib_sys::gpointer,
5532 ) where
5533 P: IsA<Widget>,
5534 {
5535 let f: &F = &*(f as *const F);
5536 f(&Widget::from_glib_borrow(this).unsafe_cast())
5537 }
5538 unsafe {
5539 let f: Box_<F> = Box_::new(f);
5540 connect_raw(
5541 self.as_ptr() as *mut _,
5542 b"notify::tooltip-markup\0".as_ptr() as *const _,
5543 Some(transmute(
5544 notify_tooltip_markup_trampoline::<Self, F> as usize,
5545 )),
5546 Box_::into_raw(f),
5547 )
5548 }
5549 }
5550
5551 fn connect_property_tooltip_text_notify<F: Fn(&Self) + 'static>(
5552 &self,
5553 f: F,
5554 ) -> SignalHandlerId {
5555 unsafe extern "C" fn notify_tooltip_text_trampoline<P, F: Fn(&P) + 'static>(
5556 this: *mut gtk_sys::GtkWidget,
5557 _param_spec: glib_sys::gpointer,
5558 f: glib_sys::gpointer,
5559 ) where
5560 P: IsA<Widget>,
5561 {
5562 let f: &F = &*(f as *const F);
5563 f(&Widget::from_glib_borrow(this).unsafe_cast())
5564 }
5565 unsafe {
5566 let f: Box_<F> = Box_::new(f);
5567 connect_raw(
5568 self.as_ptr() as *mut _,
5569 b"notify::tooltip-text\0".as_ptr() as *const _,
5570 Some(transmute(
5571 notify_tooltip_text_trampoline::<Self, F> as usize,
5572 )),
5573 Box_::into_raw(f),
5574 )
5575 }
5576 }
5577
5578 fn connect_property_valign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5579 unsafe extern "C" fn notify_valign_trampoline<P, F: Fn(&P) + 'static>(
5580 this: *mut gtk_sys::GtkWidget,
5581 _param_spec: glib_sys::gpointer,
5582 f: glib_sys::gpointer,
5583 ) where
5584 P: IsA<Widget>,
5585 {
5586 let f: &F = &*(f as *const F);
5587 f(&Widget::from_glib_borrow(this).unsafe_cast())
5588 }
5589 unsafe {
5590 let f: Box_<F> = Box_::new(f);
5591 connect_raw(
5592 self.as_ptr() as *mut _,
5593 b"notify::valign\0".as_ptr() as *const _,
5594 Some(transmute(notify_valign_trampoline::<Self, F> as usize)),
5595 Box_::into_raw(f),
5596 )
5597 }
5598 }
5599
5600 fn connect_property_vexpand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5601 unsafe extern "C" fn notify_vexpand_trampoline<P, F: Fn(&P) + 'static>(
5602 this: *mut gtk_sys::GtkWidget,
5603 _param_spec: glib_sys::gpointer,
5604 f: glib_sys::gpointer,
5605 ) where
5606 P: IsA<Widget>,
5607 {
5608 let f: &F = &*(f as *const F);
5609 f(&Widget::from_glib_borrow(this).unsafe_cast())
5610 }
5611 unsafe {
5612 let f: Box_<F> = Box_::new(f);
5613 connect_raw(
5614 self.as_ptr() as *mut _,
5615 b"notify::vexpand\0".as_ptr() as *const _,
5616 Some(transmute(notify_vexpand_trampoline::<Self, F> as usize)),
5617 Box_::into_raw(f),
5618 )
5619 }
5620 }
5621
5622 fn connect_property_vexpand_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5623 unsafe extern "C" fn notify_vexpand_set_trampoline<P, F: Fn(&P) + 'static>(
5624 this: *mut gtk_sys::GtkWidget,
5625 _param_spec: glib_sys::gpointer,
5626 f: glib_sys::gpointer,
5627 ) where
5628 P: IsA<Widget>,
5629 {
5630 let f: &F = &*(f as *const F);
5631 f(&Widget::from_glib_borrow(this).unsafe_cast())
5632 }
5633 unsafe {
5634 let f: Box_<F> = Box_::new(f);
5635 connect_raw(
5636 self.as_ptr() as *mut _,
5637 b"notify::vexpand-set\0".as_ptr() as *const _,
5638 Some(transmute(notify_vexpand_set_trampoline::<Self, F> as usize)),
5639 Box_::into_raw(f),
5640 )
5641 }
5642 }
5643
5644 fn connect_property_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5645 unsafe extern "C" fn notify_visible_trampoline<P, F: Fn(&P) + 'static>(
5646 this: *mut gtk_sys::GtkWidget,
5647 _param_spec: glib_sys::gpointer,
5648 f: glib_sys::gpointer,
5649 ) where
5650 P: IsA<Widget>,
5651 {
5652 let f: &F = &*(f as *const F);
5653 f(&Widget::from_glib_borrow(this).unsafe_cast())
5654 }
5655 unsafe {
5656 let f: Box_<F> = Box_::new(f);
5657 connect_raw(
5658 self.as_ptr() as *mut _,
5659 b"notify::visible\0".as_ptr() as *const _,
5660 Some(transmute(notify_visible_trampoline::<Self, F> as usize)),
5661 Box_::into_raw(f),
5662 )
5663 }
5664 }
5665
5666 fn connect_property_width_request_notify<F: Fn(&Self) + 'static>(
5667 &self,
5668 f: F,
5669 ) -> SignalHandlerId {
5670 unsafe extern "C" fn notify_width_request_trampoline<P, F: Fn(&P) + 'static>(
5671 this: *mut gtk_sys::GtkWidget,
5672 _param_spec: glib_sys::gpointer,
5673 f: glib_sys::gpointer,
5674 ) where
5675 P: IsA<Widget>,
5676 {
5677 let f: &F = &*(f as *const F);
5678 f(&Widget::from_glib_borrow(this).unsafe_cast())
5679 }
5680 unsafe {
5681 let f: Box_<F> = Box_::new(f);
5682 connect_raw(
5683 self.as_ptr() as *mut _,
5684 b"notify::width-request\0".as_ptr() as *const _,
5685 Some(transmute(
5686 notify_width_request_trampoline::<Self, F> as usize,
5687 )),
5688 Box_::into_raw(f),
5689 )
5690 }
5691 }
5692
5693 fn connect_property_window_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
5694 unsafe extern "C" fn notify_window_trampoline<P, F: Fn(&P) + 'static>(
5695 this: *mut gtk_sys::GtkWidget,
5696 _param_spec: glib_sys::gpointer,
5697 f: glib_sys::gpointer,
5698 ) where
5699 P: IsA<Widget>,
5700 {
5701 let f: &F = &*(f as *const F);
5702 f(&Widget::from_glib_borrow(this).unsafe_cast())
5703 }
5704 unsafe {
5705 let f: Box_<F> = Box_::new(f);
5706 connect_raw(
5707 self.as_ptr() as *mut _,
5708 b"notify::window\0".as_ptr() as *const _,
5709 Some(transmute(notify_window_trampoline::<Self, F> as usize)),
5710 Box_::into_raw(f),
5711 )
5712 }
5713 }
5714}
5715
5716impl fmt::Display for Widget {
5717 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5718 write!(f, "Widget")
5719 }
5720}