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 gdk; 6 use glib::object::Cast; 7 use glib::object::IsA; 8 use glib::signal::connect_raw; 9 use glib::signal::SignalHandlerId; 10 use glib::translate::*; 11 use glib::StaticType; 12 use glib::ToValue; 13 use glib_sys; 14 use gtk_sys; 15 use std::boxed::Box as Box_; 16 use std::fmt; 17 use std::mem::transmute; 18 use AccelGroup; 19 use Align; 20 use Buildable; 21 use Container; 22 use Menu; 23 use MenuShell; 24 use RecentChooser; 25 use RecentFilter; 26 use RecentManager; 27 use RecentSortType; 28 use ResizeMode; 29 use Widget; 30 31 glib_wrapper! { 32 pub struct RecentChooserMenu(Object<gtk_sys::GtkRecentChooserMenu, gtk_sys::GtkRecentChooserMenuClass, RecentChooserMenuClass>) @extends Menu, MenuShell, Container, Widget, @implements Buildable, RecentChooser; 33 34 match fn { 35 get_type => || gtk_sys::gtk_recent_chooser_menu_get_type(), 36 } 37 } 38 39 impl RecentChooserMenu { new() -> RecentChooserMenu40 pub fn new() -> RecentChooserMenu { 41 assert_initialized_main_thread!(); 42 unsafe { Widget::from_glib_none(gtk_sys::gtk_recent_chooser_menu_new()).unsafe_cast() } 43 } 44 new_for_manager<P: IsA<RecentManager>>(manager: &P) -> RecentChooserMenu45 pub fn new_for_manager<P: IsA<RecentManager>>(manager: &P) -> RecentChooserMenu { 46 skip_assert_initialized!(); 47 unsafe { 48 Widget::from_glib_none(gtk_sys::gtk_recent_chooser_menu_new_for_manager( 49 manager.as_ref().to_glib_none().0, 50 )) 51 .unsafe_cast() 52 } 53 } 54 } 55 56 impl Default for RecentChooserMenu { default() -> Self57 fn default() -> Self { 58 Self::new() 59 } 60 } 61 62 #[derive(Clone, Default)] 63 pub struct RecentChooserMenuBuilder { 64 show_numbers: Option<bool>, 65 accel_group: Option<AccelGroup>, 66 accel_path: Option<String>, 67 active: Option<i32>, 68 #[cfg(any(feature = "v3_22", feature = "dox"))] 69 anchor_hints: Option<gdk::AnchorHints>, 70 attach_widget: Option<Widget>, 71 #[cfg(any(feature = "v3_22", feature = "dox"))] 72 menu_type_hint: Option<gdk::WindowTypeHint>, 73 monitor: Option<i32>, 74 #[cfg(any(feature = "v3_22", feature = "dox"))] 75 rect_anchor_dx: Option<i32>, 76 #[cfg(any(feature = "v3_22", feature = "dox"))] 77 rect_anchor_dy: Option<i32>, 78 reserve_toggle_size: Option<bool>, 79 take_focus: Option<bool>, 80 border_width: Option<u32>, 81 child: Option<Widget>, 82 resize_mode: Option<ResizeMode>, 83 app_paintable: Option<bool>, 84 can_default: Option<bool>, 85 can_focus: Option<bool>, 86 events: Option<gdk::EventMask>, 87 expand: Option<bool>, 88 #[cfg(any(feature = "v3_20", feature = "dox"))] 89 focus_on_click: Option<bool>, 90 halign: Option<Align>, 91 has_default: Option<bool>, 92 has_focus: Option<bool>, 93 has_tooltip: Option<bool>, 94 height_request: Option<i32>, 95 hexpand: Option<bool>, 96 hexpand_set: Option<bool>, 97 is_focus: Option<bool>, 98 margin: Option<i32>, 99 margin_bottom: Option<i32>, 100 margin_end: Option<i32>, 101 margin_start: Option<i32>, 102 margin_top: Option<i32>, 103 name: Option<String>, 104 no_show_all: Option<bool>, 105 opacity: Option<f64>, 106 parent: Option<Container>, 107 receives_default: Option<bool>, 108 sensitive: Option<bool>, 109 tooltip_markup: Option<String>, 110 tooltip_text: Option<String>, 111 valign: Option<Align>, 112 vexpand: Option<bool>, 113 vexpand_set: Option<bool>, 114 visible: Option<bool>, 115 width_request: Option<i32>, 116 filter: Option<RecentFilter>, 117 limit: Option<i32>, 118 local_only: Option<bool>, 119 recent_manager: Option<RecentManager>, 120 select_multiple: Option<bool>, 121 show_icons: Option<bool>, 122 show_not_found: Option<bool>, 123 show_private: Option<bool>, 124 show_tips: Option<bool>, 125 sort_type: Option<RecentSortType>, 126 } 127 128 impl RecentChooserMenuBuilder { new() -> Self129 pub fn new() -> Self { 130 Self::default() 131 } 132 build(self) -> RecentChooserMenu133 pub fn build(self) -> RecentChooserMenu { 134 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 135 if let Some(ref show_numbers) = self.show_numbers { 136 properties.push(("show-numbers", show_numbers)); 137 } 138 if let Some(ref accel_group) = self.accel_group { 139 properties.push(("accel-group", accel_group)); 140 } 141 if let Some(ref accel_path) = self.accel_path { 142 properties.push(("accel-path", accel_path)); 143 } 144 if let Some(ref active) = self.active { 145 properties.push(("active", active)); 146 } 147 #[cfg(any(feature = "v3_22", feature = "dox"))] 148 { 149 if let Some(ref anchor_hints) = self.anchor_hints { 150 properties.push(("anchor-hints", anchor_hints)); 151 } 152 } 153 if let Some(ref attach_widget) = self.attach_widget { 154 properties.push(("attach-widget", attach_widget)); 155 } 156 #[cfg(any(feature = "v3_22", feature = "dox"))] 157 { 158 if let Some(ref menu_type_hint) = self.menu_type_hint { 159 properties.push(("menu-type-hint", menu_type_hint)); 160 } 161 } 162 if let Some(ref monitor) = self.monitor { 163 properties.push(("monitor", monitor)); 164 } 165 #[cfg(any(feature = "v3_22", feature = "dox"))] 166 { 167 if let Some(ref rect_anchor_dx) = self.rect_anchor_dx { 168 properties.push(("rect-anchor-dx", rect_anchor_dx)); 169 } 170 } 171 #[cfg(any(feature = "v3_22", feature = "dox"))] 172 { 173 if let Some(ref rect_anchor_dy) = self.rect_anchor_dy { 174 properties.push(("rect-anchor-dy", rect_anchor_dy)); 175 } 176 } 177 if let Some(ref reserve_toggle_size) = self.reserve_toggle_size { 178 properties.push(("reserve-toggle-size", reserve_toggle_size)); 179 } 180 if let Some(ref take_focus) = self.take_focus { 181 properties.push(("take-focus", take_focus)); 182 } 183 if let Some(ref border_width) = self.border_width { 184 properties.push(("border-width", border_width)); 185 } 186 if let Some(ref child) = self.child { 187 properties.push(("child", child)); 188 } 189 if let Some(ref resize_mode) = self.resize_mode { 190 properties.push(("resize-mode", resize_mode)); 191 } 192 if let Some(ref app_paintable) = self.app_paintable { 193 properties.push(("app-paintable", app_paintable)); 194 } 195 if let Some(ref can_default) = self.can_default { 196 properties.push(("can-default", can_default)); 197 } 198 if let Some(ref can_focus) = self.can_focus { 199 properties.push(("can-focus", can_focus)); 200 } 201 if let Some(ref events) = self.events { 202 properties.push(("events", events)); 203 } 204 if let Some(ref expand) = self.expand { 205 properties.push(("expand", expand)); 206 } 207 #[cfg(any(feature = "v3_20", feature = "dox"))] 208 { 209 if let Some(ref focus_on_click) = self.focus_on_click { 210 properties.push(("focus-on-click", focus_on_click)); 211 } 212 } 213 if let Some(ref halign) = self.halign { 214 properties.push(("halign", halign)); 215 } 216 if let Some(ref has_default) = self.has_default { 217 properties.push(("has-default", has_default)); 218 } 219 if let Some(ref has_focus) = self.has_focus { 220 properties.push(("has-focus", has_focus)); 221 } 222 if let Some(ref has_tooltip) = self.has_tooltip { 223 properties.push(("has-tooltip", has_tooltip)); 224 } 225 if let Some(ref height_request) = self.height_request { 226 properties.push(("height-request", height_request)); 227 } 228 if let Some(ref hexpand) = self.hexpand { 229 properties.push(("hexpand", hexpand)); 230 } 231 if let Some(ref hexpand_set) = self.hexpand_set { 232 properties.push(("hexpand-set", hexpand_set)); 233 } 234 if let Some(ref is_focus) = self.is_focus { 235 properties.push(("is-focus", is_focus)); 236 } 237 if let Some(ref margin) = self.margin { 238 properties.push(("margin", margin)); 239 } 240 if let Some(ref margin_bottom) = self.margin_bottom { 241 properties.push(("margin-bottom", margin_bottom)); 242 } 243 if let Some(ref margin_end) = self.margin_end { 244 properties.push(("margin-end", margin_end)); 245 } 246 if let Some(ref margin_start) = self.margin_start { 247 properties.push(("margin-start", margin_start)); 248 } 249 if let Some(ref margin_top) = self.margin_top { 250 properties.push(("margin-top", margin_top)); 251 } 252 if let Some(ref name) = self.name { 253 properties.push(("name", name)); 254 } 255 if let Some(ref no_show_all) = self.no_show_all { 256 properties.push(("no-show-all", no_show_all)); 257 } 258 if let Some(ref opacity) = self.opacity { 259 properties.push(("opacity", opacity)); 260 } 261 if let Some(ref parent) = self.parent { 262 properties.push(("parent", parent)); 263 } 264 if let Some(ref receives_default) = self.receives_default { 265 properties.push(("receives-default", receives_default)); 266 } 267 if let Some(ref sensitive) = self.sensitive { 268 properties.push(("sensitive", sensitive)); 269 } 270 if let Some(ref tooltip_markup) = self.tooltip_markup { 271 properties.push(("tooltip-markup", tooltip_markup)); 272 } 273 if let Some(ref tooltip_text) = self.tooltip_text { 274 properties.push(("tooltip-text", tooltip_text)); 275 } 276 if let Some(ref valign) = self.valign { 277 properties.push(("valign", valign)); 278 } 279 if let Some(ref vexpand) = self.vexpand { 280 properties.push(("vexpand", vexpand)); 281 } 282 if let Some(ref vexpand_set) = self.vexpand_set { 283 properties.push(("vexpand-set", vexpand_set)); 284 } 285 if let Some(ref visible) = self.visible { 286 properties.push(("visible", visible)); 287 } 288 if let Some(ref width_request) = self.width_request { 289 properties.push(("width-request", width_request)); 290 } 291 if let Some(ref filter) = self.filter { 292 properties.push(("filter", filter)); 293 } 294 if let Some(ref limit) = self.limit { 295 properties.push(("limit", limit)); 296 } 297 if let Some(ref local_only) = self.local_only { 298 properties.push(("local-only", local_only)); 299 } 300 if let Some(ref recent_manager) = self.recent_manager { 301 properties.push(("recent-manager", recent_manager)); 302 } 303 if let Some(ref select_multiple) = self.select_multiple { 304 properties.push(("select-multiple", select_multiple)); 305 } 306 if let Some(ref show_icons) = self.show_icons { 307 properties.push(("show-icons", show_icons)); 308 } 309 if let Some(ref show_not_found) = self.show_not_found { 310 properties.push(("show-not-found", show_not_found)); 311 } 312 if let Some(ref show_private) = self.show_private { 313 properties.push(("show-private", show_private)); 314 } 315 if let Some(ref show_tips) = self.show_tips { 316 properties.push(("show-tips", show_tips)); 317 } 318 if let Some(ref sort_type) = self.sort_type { 319 properties.push(("sort-type", sort_type)); 320 } 321 glib::Object::new(RecentChooserMenu::static_type(), &properties) 322 .expect("object new") 323 .downcast() 324 .expect("downcast") 325 } 326 show_numbers(mut self, show_numbers: bool) -> Self327 pub fn show_numbers(mut self, show_numbers: bool) -> Self { 328 self.show_numbers = Some(show_numbers); 329 self 330 } 331 accel_group<P: IsA<AccelGroup>>(mut self, accel_group: &P) -> Self332 pub fn accel_group<P: IsA<AccelGroup>>(mut self, accel_group: &P) -> Self { 333 self.accel_group = Some(accel_group.clone().upcast()); 334 self 335 } 336 accel_path(mut self, accel_path: &str) -> Self337 pub fn accel_path(mut self, accel_path: &str) -> Self { 338 self.accel_path = Some(accel_path.to_string()); 339 self 340 } 341 active(mut self, active: i32) -> Self342 pub fn active(mut self, active: i32) -> Self { 343 self.active = Some(active); 344 self 345 } 346 347 #[cfg(any(feature = "v3_22", feature = "dox"))] anchor_hints(mut self, anchor_hints: gdk::AnchorHints) -> Self348 pub fn anchor_hints(mut self, anchor_hints: gdk::AnchorHints) -> Self { 349 self.anchor_hints = Some(anchor_hints); 350 self 351 } 352 attach_widget<P: IsA<Widget>>(mut self, attach_widget: &P) -> Self353 pub fn attach_widget<P: IsA<Widget>>(mut self, attach_widget: &P) -> Self { 354 self.attach_widget = Some(attach_widget.clone().upcast()); 355 self 356 } 357 358 #[cfg(any(feature = "v3_22", feature = "dox"))] menu_type_hint(mut self, menu_type_hint: gdk::WindowTypeHint) -> Self359 pub fn menu_type_hint(mut self, menu_type_hint: gdk::WindowTypeHint) -> Self { 360 self.menu_type_hint = Some(menu_type_hint); 361 self 362 } 363 monitor(mut self, monitor: i32) -> Self364 pub fn monitor(mut self, monitor: i32) -> Self { 365 self.monitor = Some(monitor); 366 self 367 } 368 369 #[cfg(any(feature = "v3_22", feature = "dox"))] rect_anchor_dx(mut self, rect_anchor_dx: i32) -> Self370 pub fn rect_anchor_dx(mut self, rect_anchor_dx: i32) -> Self { 371 self.rect_anchor_dx = Some(rect_anchor_dx); 372 self 373 } 374 375 #[cfg(any(feature = "v3_22", feature = "dox"))] rect_anchor_dy(mut self, rect_anchor_dy: i32) -> Self376 pub fn rect_anchor_dy(mut self, rect_anchor_dy: i32) -> Self { 377 self.rect_anchor_dy = Some(rect_anchor_dy); 378 self 379 } 380 reserve_toggle_size(mut self, reserve_toggle_size: bool) -> Self381 pub fn reserve_toggle_size(mut self, reserve_toggle_size: bool) -> Self { 382 self.reserve_toggle_size = Some(reserve_toggle_size); 383 self 384 } 385 take_focus(mut self, take_focus: bool) -> Self386 pub fn take_focus(mut self, take_focus: bool) -> Self { 387 self.take_focus = Some(take_focus); 388 self 389 } 390 border_width(mut self, border_width: u32) -> Self391 pub fn border_width(mut self, border_width: u32) -> Self { 392 self.border_width = Some(border_width); 393 self 394 } 395 child<P: IsA<Widget>>(mut self, child: &P) -> Self396 pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self { 397 self.child = Some(child.clone().upcast()); 398 self 399 } 400 resize_mode(mut self, resize_mode: ResizeMode) -> Self401 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self { 402 self.resize_mode = Some(resize_mode); 403 self 404 } 405 app_paintable(mut self, app_paintable: bool) -> Self406 pub fn app_paintable(mut self, app_paintable: bool) -> Self { 407 self.app_paintable = Some(app_paintable); 408 self 409 } 410 can_default(mut self, can_default: bool) -> Self411 pub fn can_default(mut self, can_default: bool) -> Self { 412 self.can_default = Some(can_default); 413 self 414 } 415 can_focus(mut self, can_focus: bool) -> Self416 pub fn can_focus(mut self, can_focus: bool) -> Self { 417 self.can_focus = Some(can_focus); 418 self 419 } 420 events(mut self, events: gdk::EventMask) -> Self421 pub fn events(mut self, events: gdk::EventMask) -> Self { 422 self.events = Some(events); 423 self 424 } 425 expand(mut self, expand: bool) -> Self426 pub fn expand(mut self, expand: bool) -> Self { 427 self.expand = Some(expand); 428 self 429 } 430 431 #[cfg(any(feature = "v3_20", feature = "dox"))] focus_on_click(mut self, focus_on_click: bool) -> Self432 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self { 433 self.focus_on_click = Some(focus_on_click); 434 self 435 } 436 halign(mut self, halign: Align) -> Self437 pub fn halign(mut self, halign: Align) -> Self { 438 self.halign = Some(halign); 439 self 440 } 441 has_default(mut self, has_default: bool) -> Self442 pub fn has_default(mut self, has_default: bool) -> Self { 443 self.has_default = Some(has_default); 444 self 445 } 446 has_focus(mut self, has_focus: bool) -> Self447 pub fn has_focus(mut self, has_focus: bool) -> Self { 448 self.has_focus = Some(has_focus); 449 self 450 } 451 has_tooltip(mut self, has_tooltip: bool) -> Self452 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self { 453 self.has_tooltip = Some(has_tooltip); 454 self 455 } 456 height_request(mut self, height_request: i32) -> Self457 pub fn height_request(mut self, height_request: i32) -> Self { 458 self.height_request = Some(height_request); 459 self 460 } 461 hexpand(mut self, hexpand: bool) -> Self462 pub fn hexpand(mut self, hexpand: bool) -> Self { 463 self.hexpand = Some(hexpand); 464 self 465 } 466 hexpand_set(mut self, hexpand_set: bool) -> Self467 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self { 468 self.hexpand_set = Some(hexpand_set); 469 self 470 } 471 is_focus(mut self, is_focus: bool) -> Self472 pub fn is_focus(mut self, is_focus: bool) -> Self { 473 self.is_focus = Some(is_focus); 474 self 475 } 476 margin(mut self, margin: i32) -> Self477 pub fn margin(mut self, margin: i32) -> Self { 478 self.margin = Some(margin); 479 self 480 } 481 margin_bottom(mut self, margin_bottom: i32) -> Self482 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self { 483 self.margin_bottom = Some(margin_bottom); 484 self 485 } 486 margin_end(mut self, margin_end: i32) -> Self487 pub fn margin_end(mut self, margin_end: i32) -> Self { 488 self.margin_end = Some(margin_end); 489 self 490 } 491 margin_start(mut self, margin_start: i32) -> Self492 pub fn margin_start(mut self, margin_start: i32) -> Self { 493 self.margin_start = Some(margin_start); 494 self 495 } 496 margin_top(mut self, margin_top: i32) -> Self497 pub fn margin_top(mut self, margin_top: i32) -> Self { 498 self.margin_top = Some(margin_top); 499 self 500 } 501 name(mut self, name: &str) -> Self502 pub fn name(mut self, name: &str) -> Self { 503 self.name = Some(name.to_string()); 504 self 505 } 506 no_show_all(mut self, no_show_all: bool) -> Self507 pub fn no_show_all(mut self, no_show_all: bool) -> Self { 508 self.no_show_all = Some(no_show_all); 509 self 510 } 511 opacity(mut self, opacity: f64) -> Self512 pub fn opacity(mut self, opacity: f64) -> Self { 513 self.opacity = Some(opacity); 514 self 515 } 516 parent<P: IsA<Container>>(mut self, parent: &P) -> Self517 pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self { 518 self.parent = Some(parent.clone().upcast()); 519 self 520 } 521 receives_default(mut self, receives_default: bool) -> Self522 pub fn receives_default(mut self, receives_default: bool) -> Self { 523 self.receives_default = Some(receives_default); 524 self 525 } 526 sensitive(mut self, sensitive: bool) -> Self527 pub fn sensitive(mut self, sensitive: bool) -> Self { 528 self.sensitive = Some(sensitive); 529 self 530 } 531 tooltip_markup(mut self, tooltip_markup: &str) -> Self532 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self { 533 self.tooltip_markup = Some(tooltip_markup.to_string()); 534 self 535 } 536 tooltip_text(mut self, tooltip_text: &str) -> Self537 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self { 538 self.tooltip_text = Some(tooltip_text.to_string()); 539 self 540 } 541 valign(mut self, valign: Align) -> Self542 pub fn valign(mut self, valign: Align) -> Self { 543 self.valign = Some(valign); 544 self 545 } 546 vexpand(mut self, vexpand: bool) -> Self547 pub fn vexpand(mut self, vexpand: bool) -> Self { 548 self.vexpand = Some(vexpand); 549 self 550 } 551 vexpand_set(mut self, vexpand_set: bool) -> Self552 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self { 553 self.vexpand_set = Some(vexpand_set); 554 self 555 } 556 visible(mut self, visible: bool) -> Self557 pub fn visible(mut self, visible: bool) -> Self { 558 self.visible = Some(visible); 559 self 560 } 561 width_request(mut self, width_request: i32) -> Self562 pub fn width_request(mut self, width_request: i32) -> Self { 563 self.width_request = Some(width_request); 564 self 565 } 566 filter(mut self, filter: &RecentFilter) -> Self567 pub fn filter(mut self, filter: &RecentFilter) -> Self { 568 self.filter = Some(filter.clone()); 569 self 570 } 571 limit(mut self, limit: i32) -> Self572 pub fn limit(mut self, limit: i32) -> Self { 573 self.limit = Some(limit); 574 self 575 } 576 local_only(mut self, local_only: bool) -> Self577 pub fn local_only(mut self, local_only: bool) -> Self { 578 self.local_only = Some(local_only); 579 self 580 } 581 recent_manager<P: IsA<RecentManager>>(mut self, recent_manager: &P) -> Self582 pub fn recent_manager<P: IsA<RecentManager>>(mut self, recent_manager: &P) -> Self { 583 self.recent_manager = Some(recent_manager.clone().upcast()); 584 self 585 } 586 select_multiple(mut self, select_multiple: bool) -> Self587 pub fn select_multiple(mut self, select_multiple: bool) -> Self { 588 self.select_multiple = Some(select_multiple); 589 self 590 } 591 show_icons(mut self, show_icons: bool) -> Self592 pub fn show_icons(mut self, show_icons: bool) -> Self { 593 self.show_icons = Some(show_icons); 594 self 595 } 596 show_not_found(mut self, show_not_found: bool) -> Self597 pub fn show_not_found(mut self, show_not_found: bool) -> Self { 598 self.show_not_found = Some(show_not_found); 599 self 600 } 601 show_private(mut self, show_private: bool) -> Self602 pub fn show_private(mut self, show_private: bool) -> Self { 603 self.show_private = Some(show_private); 604 self 605 } 606 show_tips(mut self, show_tips: bool) -> Self607 pub fn show_tips(mut self, show_tips: bool) -> Self { 608 self.show_tips = Some(show_tips); 609 self 610 } 611 sort_type(mut self, sort_type: RecentSortType) -> Self612 pub fn sort_type(mut self, sort_type: RecentSortType) -> Self { 613 self.sort_type = Some(sort_type); 614 self 615 } 616 } 617 618 pub const NONE_RECENT_CHOOSER_MENU: Option<&RecentChooserMenu> = None; 619 620 pub trait RecentChooserMenuExt: 'static { get_show_numbers(&self) -> bool621 fn get_show_numbers(&self) -> bool; 622 set_show_numbers(&self, show_numbers: bool)623 fn set_show_numbers(&self, show_numbers: bool); 624 connect_property_show_numbers_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId625 fn connect_property_show_numbers_notify<F: Fn(&Self) + 'static>(&self, f: F) 626 -> SignalHandlerId; 627 } 628 629 impl<O: IsA<RecentChooserMenu>> RecentChooserMenuExt for O { get_show_numbers(&self) -> bool630 fn get_show_numbers(&self) -> bool { 631 unsafe { 632 from_glib(gtk_sys::gtk_recent_chooser_menu_get_show_numbers( 633 self.as_ref().to_glib_none().0, 634 )) 635 } 636 } 637 set_show_numbers(&self, show_numbers: bool)638 fn set_show_numbers(&self, show_numbers: bool) { 639 unsafe { 640 gtk_sys::gtk_recent_chooser_menu_set_show_numbers( 641 self.as_ref().to_glib_none().0, 642 show_numbers.to_glib(), 643 ); 644 } 645 } 646 connect_property_show_numbers_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId647 fn connect_property_show_numbers_notify<F: Fn(&Self) + 'static>( 648 &self, 649 f: F, 650 ) -> SignalHandlerId { 651 unsafe extern "C" fn notify_show_numbers_trampoline<P, F: Fn(&P) + 'static>( 652 this: *mut gtk_sys::GtkRecentChooserMenu, 653 _param_spec: glib_sys::gpointer, 654 f: glib_sys::gpointer, 655 ) where 656 P: IsA<RecentChooserMenu>, 657 { 658 let f: &F = &*(f as *const F); 659 f(&RecentChooserMenu::from_glib_borrow(this).unsafe_cast()) 660 } 661 unsafe { 662 let f: Box_<F> = Box_::new(f); 663 connect_raw( 664 self.as_ptr() as *mut _, 665 b"notify::show-numbers\0".as_ptr() as *const _, 666 Some(transmute( 667 notify_show_numbers_trampoline::<Self, F> as usize, 668 )), 669 Box_::into_raw(f), 670 ) 671 } 672 } 673 } 674 675 impl fmt::Display for RecentChooserMenu { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result676 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 677 write!(f, "RecentChooserMenu") 678 } 679 } 680