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