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 atk; 6 use gdk; 7 use glib; 8 use glib::object::Cast; 9 use glib::object::IsA; 10 use glib::object::ObjectExt; 11 use glib::signal::connect_raw; 12 use glib::signal::SignalHandlerId; 13 use glib::translate::*; 14 use glib::GString; 15 use glib::StaticType; 16 use glib::ToValue; 17 use glib::Value; 18 use glib_sys; 19 use gobject_sys; 20 use gtk_sys; 21 use libc; 22 use std::boxed::Box as Box_; 23 use std::fmt; 24 use std::mem::transmute; 25 use Align; 26 use Bin; 27 use Buildable; 28 use CellArea; 29 use CellEditable; 30 use CellLayout; 31 use Container; 32 use ResizeMode; 33 use ScrollType; 34 use SensitivityType; 35 use TreeIter; 36 use TreeModel; 37 use Widget; 38 39 glib_wrapper! { 40 pub struct ComboBox(Object<gtk_sys::GtkComboBox, gtk_sys::GtkComboBoxClass, ComboBoxClass>) @extends Bin, Container, Widget, @implements Buildable, CellEditable, CellLayout; 41 42 match fn { 43 get_type => || gtk_sys::gtk_combo_box_get_type(), 44 } 45 } 46 47 impl ComboBox { new() -> ComboBox48 pub fn new() -> ComboBox { 49 assert_initialized_main_thread!(); 50 unsafe { Widget::from_glib_none(gtk_sys::gtk_combo_box_new()).unsafe_cast() } 51 } 52 new_with_area<P: IsA<CellArea>>(area: &P) -> ComboBox53 pub fn new_with_area<P: IsA<CellArea>>(area: &P) -> ComboBox { 54 skip_assert_initialized!(); 55 unsafe { 56 Widget::from_glib_none(gtk_sys::gtk_combo_box_new_with_area( 57 area.as_ref().to_glib_none().0, 58 )) 59 .unsafe_cast() 60 } 61 } 62 new_with_area_and_entry<P: IsA<CellArea>>(area: &P) -> ComboBox63 pub fn new_with_area_and_entry<P: IsA<CellArea>>(area: &P) -> ComboBox { 64 skip_assert_initialized!(); 65 unsafe { 66 Widget::from_glib_none(gtk_sys::gtk_combo_box_new_with_area_and_entry( 67 area.as_ref().to_glib_none().0, 68 )) 69 .unsafe_cast() 70 } 71 } 72 new_with_entry() -> ComboBox73 pub fn new_with_entry() -> ComboBox { 74 assert_initialized_main_thread!(); 75 unsafe { Widget::from_glib_none(gtk_sys::gtk_combo_box_new_with_entry()).unsafe_cast() } 76 } 77 new_with_model<P: IsA<TreeModel>>(model: &P) -> ComboBox78 pub fn new_with_model<P: IsA<TreeModel>>(model: &P) -> ComboBox { 79 skip_assert_initialized!(); 80 unsafe { 81 Widget::from_glib_none(gtk_sys::gtk_combo_box_new_with_model( 82 model.as_ref().to_glib_none().0, 83 )) 84 .unsafe_cast() 85 } 86 } 87 new_with_model_and_entry<P: IsA<TreeModel>>(model: &P) -> ComboBox88 pub fn new_with_model_and_entry<P: IsA<TreeModel>>(model: &P) -> ComboBox { 89 skip_assert_initialized!(); 90 unsafe { 91 Widget::from_glib_none(gtk_sys::gtk_combo_box_new_with_model_and_entry( 92 model.as_ref().to_glib_none().0, 93 )) 94 .unsafe_cast() 95 } 96 } 97 } 98 99 impl Default for ComboBox { default() -> Self100 fn default() -> Self { 101 Self::new() 102 } 103 } 104 105 pub struct ComboBoxBuilder { 106 active: Option<i32>, 107 active_id: Option<String>, 108 button_sensitivity: Option<SensitivityType>, 109 cell_area: Option<CellArea>, 110 column_span_column: Option<i32>, 111 entry_text_column: Option<i32>, 112 has_entry: Option<bool>, 113 has_frame: Option<bool>, 114 id_column: Option<i32>, 115 model: Option<TreeModel>, 116 popup_fixed_width: Option<bool>, 117 row_span_column: Option<i32>, 118 wrap_width: Option<i32>, 119 border_width: Option<u32>, 120 child: Option<Widget>, 121 resize_mode: Option<ResizeMode>, 122 app_paintable: Option<bool>, 123 can_default: Option<bool>, 124 can_focus: Option<bool>, 125 events: Option<gdk::EventMask>, 126 expand: Option<bool>, 127 #[cfg(any(feature = "v3_20", feature = "dox"))] 128 focus_on_click: Option<bool>, 129 halign: Option<Align>, 130 has_default: Option<bool>, 131 has_focus: Option<bool>, 132 has_tooltip: Option<bool>, 133 height_request: Option<i32>, 134 hexpand: Option<bool>, 135 hexpand_set: Option<bool>, 136 is_focus: Option<bool>, 137 margin: Option<i32>, 138 margin_bottom: Option<i32>, 139 margin_end: Option<i32>, 140 margin_start: Option<i32>, 141 margin_top: Option<i32>, 142 name: Option<String>, 143 no_show_all: Option<bool>, 144 opacity: Option<f64>, 145 parent: Option<Container>, 146 receives_default: Option<bool>, 147 sensitive: Option<bool>, 148 //style: /*Unknown type*/, 149 tooltip_markup: Option<String>, 150 tooltip_text: Option<String>, 151 valign: Option<Align>, 152 vexpand: Option<bool>, 153 vexpand_set: Option<bool>, 154 visible: Option<bool>, 155 width_request: Option<i32>, 156 } 157 158 impl ComboBoxBuilder { new() -> Self159 pub fn new() -> Self { 160 Self { 161 active: None, 162 active_id: None, 163 button_sensitivity: None, 164 cell_area: None, 165 column_span_column: None, 166 entry_text_column: None, 167 has_entry: None, 168 has_frame: None, 169 id_column: None, 170 model: None, 171 popup_fixed_width: None, 172 row_span_column: None, 173 wrap_width: None, 174 border_width: None, 175 child: None, 176 resize_mode: None, 177 app_paintable: None, 178 can_default: None, 179 can_focus: None, 180 events: None, 181 expand: None, 182 #[cfg(any(feature = "v3_20", feature = "dox"))] 183 focus_on_click: None, 184 halign: None, 185 has_default: None, 186 has_focus: None, 187 has_tooltip: None, 188 height_request: None, 189 hexpand: None, 190 hexpand_set: None, 191 is_focus: None, 192 margin: None, 193 margin_bottom: None, 194 margin_end: None, 195 margin_start: None, 196 margin_top: None, 197 name: None, 198 no_show_all: None, 199 opacity: None, 200 parent: None, 201 receives_default: None, 202 sensitive: None, 203 tooltip_markup: None, 204 tooltip_text: None, 205 valign: None, 206 vexpand: None, 207 vexpand_set: None, 208 visible: None, 209 width_request: None, 210 } 211 } 212 build(self) -> ComboBox213 pub fn build(self) -> ComboBox { 214 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 215 if let Some(ref active) = self.active { 216 properties.push(("active", active)); 217 } 218 if let Some(ref active_id) = self.active_id { 219 properties.push(("active-id", active_id)); 220 } 221 if let Some(ref button_sensitivity) = self.button_sensitivity { 222 properties.push(("button-sensitivity", button_sensitivity)); 223 } 224 if let Some(ref cell_area) = self.cell_area { 225 properties.push(("cell-area", cell_area)); 226 } 227 if let Some(ref column_span_column) = self.column_span_column { 228 properties.push(("column-span-column", column_span_column)); 229 } 230 if let Some(ref entry_text_column) = self.entry_text_column { 231 properties.push(("entry-text-column", entry_text_column)); 232 } 233 if let Some(ref has_entry) = self.has_entry { 234 properties.push(("has-entry", has_entry)); 235 } 236 if let Some(ref has_frame) = self.has_frame { 237 properties.push(("has-frame", has_frame)); 238 } 239 if let Some(ref id_column) = self.id_column { 240 properties.push(("id-column", id_column)); 241 } 242 if let Some(ref model) = self.model { 243 properties.push(("model", model)); 244 } 245 if let Some(ref popup_fixed_width) = self.popup_fixed_width { 246 properties.push(("popup-fixed-width", popup_fixed_width)); 247 } 248 if let Some(ref row_span_column) = self.row_span_column { 249 properties.push(("row-span-column", row_span_column)); 250 } 251 if let Some(ref wrap_width) = self.wrap_width { 252 properties.push(("wrap-width", wrap_width)); 253 } 254 if let Some(ref border_width) = self.border_width { 255 properties.push(("border-width", border_width)); 256 } 257 if let Some(ref child) = self.child { 258 properties.push(("child", child)); 259 } 260 if let Some(ref resize_mode) = self.resize_mode { 261 properties.push(("resize-mode", resize_mode)); 262 } 263 if let Some(ref app_paintable) = self.app_paintable { 264 properties.push(("app-paintable", app_paintable)); 265 } 266 if let Some(ref can_default) = self.can_default { 267 properties.push(("can-default", can_default)); 268 } 269 if let Some(ref can_focus) = self.can_focus { 270 properties.push(("can-focus", can_focus)); 271 } 272 if let Some(ref events) = self.events { 273 properties.push(("events", events)); 274 } 275 if let Some(ref expand) = self.expand { 276 properties.push(("expand", expand)); 277 } 278 #[cfg(any(feature = "v3_20", feature = "dox"))] 279 { 280 if let Some(ref focus_on_click) = self.focus_on_click { 281 properties.push(("focus-on-click", focus_on_click)); 282 } 283 } 284 if let Some(ref halign) = self.halign { 285 properties.push(("halign", halign)); 286 } 287 if let Some(ref has_default) = self.has_default { 288 properties.push(("has-default", has_default)); 289 } 290 if let Some(ref has_focus) = self.has_focus { 291 properties.push(("has-focus", has_focus)); 292 } 293 if let Some(ref has_tooltip) = self.has_tooltip { 294 properties.push(("has-tooltip", has_tooltip)); 295 } 296 if let Some(ref height_request) = self.height_request { 297 properties.push(("height-request", height_request)); 298 } 299 if let Some(ref hexpand) = self.hexpand { 300 properties.push(("hexpand", hexpand)); 301 } 302 if let Some(ref hexpand_set) = self.hexpand_set { 303 properties.push(("hexpand-set", hexpand_set)); 304 } 305 if let Some(ref is_focus) = self.is_focus { 306 properties.push(("is-focus", is_focus)); 307 } 308 if let Some(ref margin) = self.margin { 309 properties.push(("margin", margin)); 310 } 311 if let Some(ref margin_bottom) = self.margin_bottom { 312 properties.push(("margin-bottom", margin_bottom)); 313 } 314 if let Some(ref margin_end) = self.margin_end { 315 properties.push(("margin-end", margin_end)); 316 } 317 if let Some(ref margin_start) = self.margin_start { 318 properties.push(("margin-start", margin_start)); 319 } 320 if let Some(ref margin_top) = self.margin_top { 321 properties.push(("margin-top", margin_top)); 322 } 323 if let Some(ref name) = self.name { 324 properties.push(("name", name)); 325 } 326 if let Some(ref no_show_all) = self.no_show_all { 327 properties.push(("no-show-all", no_show_all)); 328 } 329 if let Some(ref opacity) = self.opacity { 330 properties.push(("opacity", opacity)); 331 } 332 if let Some(ref parent) = self.parent { 333 properties.push(("parent", parent)); 334 } 335 if let Some(ref receives_default) = self.receives_default { 336 properties.push(("receives-default", receives_default)); 337 } 338 if let Some(ref sensitive) = self.sensitive { 339 properties.push(("sensitive", sensitive)); 340 } 341 if let Some(ref tooltip_markup) = self.tooltip_markup { 342 properties.push(("tooltip-markup", tooltip_markup)); 343 } 344 if let Some(ref tooltip_text) = self.tooltip_text { 345 properties.push(("tooltip-text", tooltip_text)); 346 } 347 if let Some(ref valign) = self.valign { 348 properties.push(("valign", valign)); 349 } 350 if let Some(ref vexpand) = self.vexpand { 351 properties.push(("vexpand", vexpand)); 352 } 353 if let Some(ref vexpand_set) = self.vexpand_set { 354 properties.push(("vexpand-set", vexpand_set)); 355 } 356 if let Some(ref visible) = self.visible { 357 properties.push(("visible", visible)); 358 } 359 if let Some(ref width_request) = self.width_request { 360 properties.push(("width-request", width_request)); 361 } 362 glib::Object::new(ComboBox::static_type(), &properties) 363 .expect("object new") 364 .downcast() 365 .expect("downcast") 366 } 367 active(mut self, active: i32) -> Self368 pub fn active(mut self, active: i32) -> Self { 369 self.active = Some(active); 370 self 371 } 372 active_id(mut self, active_id: &str) -> Self373 pub fn active_id(mut self, active_id: &str) -> Self { 374 self.active_id = Some(active_id.to_string()); 375 self 376 } 377 button_sensitivity(mut self, button_sensitivity: SensitivityType) -> Self378 pub fn button_sensitivity(mut self, button_sensitivity: SensitivityType) -> Self { 379 self.button_sensitivity = Some(button_sensitivity); 380 self 381 } 382 cell_area(mut self, cell_area: &CellArea) -> Self383 pub fn cell_area(mut self, cell_area: &CellArea) -> Self { 384 self.cell_area = Some(cell_area.clone()); 385 self 386 } 387 column_span_column(mut self, column_span_column: i32) -> Self388 pub fn column_span_column(mut self, column_span_column: i32) -> Self { 389 self.column_span_column = Some(column_span_column); 390 self 391 } 392 entry_text_column(mut self, entry_text_column: i32) -> Self393 pub fn entry_text_column(mut self, entry_text_column: i32) -> Self { 394 self.entry_text_column = Some(entry_text_column); 395 self 396 } 397 has_entry(mut self, has_entry: bool) -> Self398 pub fn has_entry(mut self, has_entry: bool) -> Self { 399 self.has_entry = Some(has_entry); 400 self 401 } 402 has_frame(mut self, has_frame: bool) -> Self403 pub fn has_frame(mut self, has_frame: bool) -> Self { 404 self.has_frame = Some(has_frame); 405 self 406 } 407 id_column(mut self, id_column: i32) -> Self408 pub fn id_column(mut self, id_column: i32) -> Self { 409 self.id_column = Some(id_column); 410 self 411 } 412 model(mut self, model: &TreeModel) -> Self413 pub fn model(mut self, model: &TreeModel) -> Self { 414 self.model = Some(model.clone()); 415 self 416 } 417 popup_fixed_width(mut self, popup_fixed_width: bool) -> Self418 pub fn popup_fixed_width(mut self, popup_fixed_width: bool) -> Self { 419 self.popup_fixed_width = Some(popup_fixed_width); 420 self 421 } 422 row_span_column(mut self, row_span_column: i32) -> Self423 pub fn row_span_column(mut self, row_span_column: i32) -> Self { 424 self.row_span_column = Some(row_span_column); 425 self 426 } 427 wrap_width(mut self, wrap_width: i32) -> Self428 pub fn wrap_width(mut self, wrap_width: i32) -> Self { 429 self.wrap_width = Some(wrap_width); 430 self 431 } 432 border_width(mut self, border_width: u32) -> Self433 pub fn border_width(mut self, border_width: u32) -> Self { 434 self.border_width = Some(border_width); 435 self 436 } 437 child(mut self, child: &Widget) -> Self438 pub fn child(mut self, child: &Widget) -> Self { 439 self.child = Some(child.clone()); 440 self 441 } 442 resize_mode(mut self, resize_mode: ResizeMode) -> Self443 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self { 444 self.resize_mode = Some(resize_mode); 445 self 446 } 447 app_paintable(mut self, app_paintable: bool) -> Self448 pub fn app_paintable(mut self, app_paintable: bool) -> Self { 449 self.app_paintable = Some(app_paintable); 450 self 451 } 452 can_default(mut self, can_default: bool) -> Self453 pub fn can_default(mut self, can_default: bool) -> Self { 454 self.can_default = Some(can_default); 455 self 456 } 457 can_focus(mut self, can_focus: bool) -> Self458 pub fn can_focus(mut self, can_focus: bool) -> Self { 459 self.can_focus = Some(can_focus); 460 self 461 } 462 events(mut self, events: gdk::EventMask) -> Self463 pub fn events(mut self, events: gdk::EventMask) -> Self { 464 self.events = Some(events); 465 self 466 } 467 expand(mut self, expand: bool) -> Self468 pub fn expand(mut self, expand: bool) -> Self { 469 self.expand = Some(expand); 470 self 471 } 472 473 #[cfg(any(feature = "v3_20", feature = "dox"))] focus_on_click(mut self, focus_on_click: bool) -> Self474 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self { 475 self.focus_on_click = Some(focus_on_click); 476 self 477 } 478 halign(mut self, halign: Align) -> Self479 pub fn halign(mut self, halign: Align) -> Self { 480 self.halign = Some(halign); 481 self 482 } 483 has_default(mut self, has_default: bool) -> Self484 pub fn has_default(mut self, has_default: bool) -> Self { 485 self.has_default = Some(has_default); 486 self 487 } 488 has_focus(mut self, has_focus: bool) -> Self489 pub fn has_focus(mut self, has_focus: bool) -> Self { 490 self.has_focus = Some(has_focus); 491 self 492 } 493 has_tooltip(mut self, has_tooltip: bool) -> Self494 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self { 495 self.has_tooltip = Some(has_tooltip); 496 self 497 } 498 height_request(mut self, height_request: i32) -> Self499 pub fn height_request(mut self, height_request: i32) -> Self { 500 self.height_request = Some(height_request); 501 self 502 } 503 hexpand(mut self, hexpand: bool) -> Self504 pub fn hexpand(mut self, hexpand: bool) -> Self { 505 self.hexpand = Some(hexpand); 506 self 507 } 508 hexpand_set(mut self, hexpand_set: bool) -> Self509 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self { 510 self.hexpand_set = Some(hexpand_set); 511 self 512 } 513 is_focus(mut self, is_focus: bool) -> Self514 pub fn is_focus(mut self, is_focus: bool) -> Self { 515 self.is_focus = Some(is_focus); 516 self 517 } 518 margin(mut self, margin: i32) -> Self519 pub fn margin(mut self, margin: i32) -> Self { 520 self.margin = Some(margin); 521 self 522 } 523 margin_bottom(mut self, margin_bottom: i32) -> Self524 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self { 525 self.margin_bottom = Some(margin_bottom); 526 self 527 } 528 margin_end(mut self, margin_end: i32) -> Self529 pub fn margin_end(mut self, margin_end: i32) -> Self { 530 self.margin_end = Some(margin_end); 531 self 532 } 533 margin_start(mut self, margin_start: i32) -> Self534 pub fn margin_start(mut self, margin_start: i32) -> Self { 535 self.margin_start = Some(margin_start); 536 self 537 } 538 margin_top(mut self, margin_top: i32) -> Self539 pub fn margin_top(mut self, margin_top: i32) -> Self { 540 self.margin_top = Some(margin_top); 541 self 542 } 543 name(mut self, name: &str) -> Self544 pub fn name(mut self, name: &str) -> Self { 545 self.name = Some(name.to_string()); 546 self 547 } 548 no_show_all(mut self, no_show_all: bool) -> Self549 pub fn no_show_all(mut self, no_show_all: bool) -> Self { 550 self.no_show_all = Some(no_show_all); 551 self 552 } 553 opacity(mut self, opacity: f64) -> Self554 pub fn opacity(mut self, opacity: f64) -> Self { 555 self.opacity = Some(opacity); 556 self 557 } 558 parent(mut self, parent: &Container) -> Self559 pub fn parent(mut self, parent: &Container) -> Self { 560 self.parent = Some(parent.clone()); 561 self 562 } 563 receives_default(mut self, receives_default: bool) -> Self564 pub fn receives_default(mut self, receives_default: bool) -> Self { 565 self.receives_default = Some(receives_default); 566 self 567 } 568 sensitive(mut self, sensitive: bool) -> Self569 pub fn sensitive(mut self, sensitive: bool) -> Self { 570 self.sensitive = Some(sensitive); 571 self 572 } 573 tooltip_markup(mut self, tooltip_markup: &str) -> Self574 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self { 575 self.tooltip_markup = Some(tooltip_markup.to_string()); 576 self 577 } 578 tooltip_text(mut self, tooltip_text: &str) -> Self579 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self { 580 self.tooltip_text = Some(tooltip_text.to_string()); 581 self 582 } 583 valign(mut self, valign: Align) -> Self584 pub fn valign(mut self, valign: Align) -> Self { 585 self.valign = Some(valign); 586 self 587 } 588 vexpand(mut self, vexpand: bool) -> Self589 pub fn vexpand(mut self, vexpand: bool) -> Self { 590 self.vexpand = Some(vexpand); 591 self 592 } 593 vexpand_set(mut self, vexpand_set: bool) -> Self594 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self { 595 self.vexpand_set = Some(vexpand_set); 596 self 597 } 598 visible(mut self, visible: bool) -> Self599 pub fn visible(mut self, visible: bool) -> Self { 600 self.visible = Some(visible); 601 self 602 } 603 width_request(mut self, width_request: i32) -> Self604 pub fn width_request(mut self, width_request: i32) -> Self { 605 self.width_request = Some(width_request); 606 self 607 } 608 } 609 610 pub const NONE_COMBO_BOX: Option<&ComboBox> = None; 611 612 pub trait ComboBoxExt: 'static { get_active_id(&self) -> Option<GString>613 fn get_active_id(&self) -> Option<GString>; 614 get_active_iter(&self) -> Option<TreeIter>615 fn get_active_iter(&self) -> Option<TreeIter>; 616 get_button_sensitivity(&self) -> SensitivityType617 fn get_button_sensitivity(&self) -> SensitivityType; 618 get_column_span_column(&self) -> i32619 fn get_column_span_column(&self) -> i32; 620 get_entry_text_column(&self) -> i32621 fn get_entry_text_column(&self) -> i32; 622 623 #[cfg_attr(feature = "v3_20", deprecated)] 624 #[cfg(any(not(feature = "v3_20"), feature = "dox"))] get_focus_on_click(&self) -> bool625 fn get_focus_on_click(&self) -> bool; 626 get_has_entry(&self) -> bool627 fn get_has_entry(&self) -> bool; 628 get_id_column(&self) -> i32629 fn get_id_column(&self) -> i32; 630 get_model(&self) -> Option<TreeModel>631 fn get_model(&self) -> Option<TreeModel>; 632 get_popup_accessible(&self) -> Option<atk::Object>633 fn get_popup_accessible(&self) -> Option<atk::Object>; 634 get_popup_fixed_width(&self) -> bool635 fn get_popup_fixed_width(&self) -> bool; 636 637 //fn get_row_separator_func(&self) -> Option<Box<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>; 638 get_row_span_column(&self) -> i32639 fn get_row_span_column(&self) -> i32; 640 get_wrap_width(&self) -> i32641 fn get_wrap_width(&self) -> i32; 642 popdown(&self)643 fn popdown(&self); 644 popup(&self)645 fn popup(&self); 646 popup_for_device(&self, device: &gdk::Device)647 fn popup_for_device(&self, device: &gdk::Device); 648 set_active_id(&self, active_id: Option<&str>) -> bool649 fn set_active_id(&self, active_id: Option<&str>) -> bool; 650 set_active_iter(&self, iter: Option<&TreeIter>)651 fn set_active_iter(&self, iter: Option<&TreeIter>); 652 set_button_sensitivity(&self, sensitivity: SensitivityType)653 fn set_button_sensitivity(&self, sensitivity: SensitivityType); 654 set_column_span_column(&self, column_span: i32)655 fn set_column_span_column(&self, column_span: i32); 656 set_entry_text_column(&self, text_column: i32)657 fn set_entry_text_column(&self, text_column: i32); 658 659 #[cfg_attr(feature = "v3_20", deprecated)] 660 #[cfg(any(not(feature = "v3_20"), feature = "dox"))] set_focus_on_click(&self, focus_on_click: bool)661 fn set_focus_on_click(&self, focus_on_click: bool); 662 set_id_column(&self, id_column: i32)663 fn set_id_column(&self, id_column: i32); 664 set_model<P: IsA<TreeModel>>(&self, model: Option<&P>)665 fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>); 666 set_popup_fixed_width(&self, fixed: bool)667 fn set_popup_fixed_width(&self, fixed: bool); 668 set_row_separator_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(&self, func: P)669 fn set_row_separator_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(&self, func: P); 670 set_row_span_column(&self, row_span: i32)671 fn set_row_span_column(&self, row_span: i32); 672 set_wrap_width(&self, width: i32)673 fn set_wrap_width(&self, width: i32); 674 get_property_cell_area(&self) -> Option<CellArea>675 fn get_property_cell_area(&self) -> Option<CellArea>; 676 get_property_has_frame(&self) -> bool677 fn get_property_has_frame(&self) -> bool; 678 set_property_has_frame(&self, has_frame: bool)679 fn set_property_has_frame(&self, has_frame: bool); 680 get_property_popup_shown(&self) -> bool681 fn get_property_popup_shown(&self) -> bool; 682 connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId683 fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 684 connect_format_entry_text<F: Fn(&Self, &str) -> String + 'static>( &self, f: F, ) -> SignalHandlerId685 fn connect_format_entry_text<F: Fn(&Self, &str) -> String + 'static>( 686 &self, 687 f: F, 688 ) -> SignalHandlerId; 689 connect_move_active<F: Fn(&Self, ScrollType) + 'static>(&self, f: F) -> SignalHandlerId690 fn connect_move_active<F: Fn(&Self, ScrollType) + 'static>(&self, f: F) -> SignalHandlerId; 691 emit_move_active(&self, scroll_type: ScrollType)692 fn emit_move_active(&self, scroll_type: ScrollType); 693 connect_popdown<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId694 fn connect_popdown<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId; 695 emit_popdown(&self) -> bool696 fn emit_popdown(&self) -> bool; 697 connect_popup<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId698 fn connect_popup<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 699 emit_popup(&self)700 fn emit_popup(&self); 701 connect_property_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId702 fn connect_property_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 703 connect_property_active_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId704 fn connect_property_active_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 705 connect_property_button_sensitivity_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId706 fn connect_property_button_sensitivity_notify<F: Fn(&Self) + 'static>( 707 &self, 708 f: F, 709 ) -> SignalHandlerId; 710 connect_property_column_span_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId711 fn connect_property_column_span_column_notify<F: Fn(&Self) + 'static>( 712 &self, 713 f: F, 714 ) -> SignalHandlerId; 715 connect_property_entry_text_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId716 fn connect_property_entry_text_column_notify<F: Fn(&Self) + 'static>( 717 &self, 718 f: F, 719 ) -> SignalHandlerId; 720 connect_property_has_frame_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId721 fn connect_property_has_frame_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 722 connect_property_id_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId723 fn connect_property_id_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 724 connect_property_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId725 fn connect_property_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 726 connect_property_popup_fixed_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId727 fn connect_property_popup_fixed_width_notify<F: Fn(&Self) + 'static>( 728 &self, 729 f: F, 730 ) -> SignalHandlerId; 731 connect_property_popup_shown_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId732 fn connect_property_popup_shown_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 733 connect_property_row_span_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId734 fn connect_property_row_span_column_notify<F: Fn(&Self) + 'static>( 735 &self, 736 f: F, 737 ) -> SignalHandlerId; 738 connect_property_wrap_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId739 fn connect_property_wrap_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 740 } 741 742 impl<O: IsA<ComboBox>> ComboBoxExt for O { get_active_id(&self) -> Option<GString>743 fn get_active_id(&self) -> Option<GString> { 744 unsafe { 745 from_glib_none(gtk_sys::gtk_combo_box_get_active_id( 746 self.as_ref().to_glib_none().0, 747 )) 748 } 749 } 750 get_active_iter(&self) -> Option<TreeIter>751 fn get_active_iter(&self) -> Option<TreeIter> { 752 unsafe { 753 let mut iter = TreeIter::uninitialized(); 754 let ret = from_glib(gtk_sys::gtk_combo_box_get_active_iter( 755 self.as_ref().to_glib_none().0, 756 iter.to_glib_none_mut().0, 757 )); 758 if ret { 759 Some(iter) 760 } else { 761 None 762 } 763 } 764 } 765 get_button_sensitivity(&self) -> SensitivityType766 fn get_button_sensitivity(&self) -> SensitivityType { 767 unsafe { 768 from_glib(gtk_sys::gtk_combo_box_get_button_sensitivity( 769 self.as_ref().to_glib_none().0, 770 )) 771 } 772 } 773 get_column_span_column(&self) -> i32774 fn get_column_span_column(&self) -> i32 { 775 unsafe { gtk_sys::gtk_combo_box_get_column_span_column(self.as_ref().to_glib_none().0) } 776 } 777 get_entry_text_column(&self) -> i32778 fn get_entry_text_column(&self) -> i32 { 779 unsafe { gtk_sys::gtk_combo_box_get_entry_text_column(self.as_ref().to_glib_none().0) } 780 } 781 782 #[cfg(any(not(feature = "v3_20"), feature = "dox"))] get_focus_on_click(&self) -> bool783 fn get_focus_on_click(&self) -> bool { 784 unsafe { 785 from_glib(gtk_sys::gtk_combo_box_get_focus_on_click( 786 self.as_ref().to_glib_none().0, 787 )) 788 } 789 } 790 get_has_entry(&self) -> bool791 fn get_has_entry(&self) -> bool { 792 unsafe { 793 from_glib(gtk_sys::gtk_combo_box_get_has_entry( 794 self.as_ref().to_glib_none().0, 795 )) 796 } 797 } 798 get_id_column(&self) -> i32799 fn get_id_column(&self) -> i32 { 800 unsafe { gtk_sys::gtk_combo_box_get_id_column(self.as_ref().to_glib_none().0) } 801 } 802 get_model(&self) -> Option<TreeModel>803 fn get_model(&self) -> Option<TreeModel> { 804 unsafe { 805 from_glib_none(gtk_sys::gtk_combo_box_get_model( 806 self.as_ref().to_glib_none().0, 807 )) 808 } 809 } 810 get_popup_accessible(&self) -> Option<atk::Object>811 fn get_popup_accessible(&self) -> Option<atk::Object> { 812 unsafe { 813 from_glib_none(gtk_sys::gtk_combo_box_get_popup_accessible( 814 self.as_ref().to_glib_none().0, 815 )) 816 } 817 } 818 get_popup_fixed_width(&self) -> bool819 fn get_popup_fixed_width(&self) -> bool { 820 unsafe { 821 from_glib(gtk_sys::gtk_combo_box_get_popup_fixed_width( 822 self.as_ref().to_glib_none().0, 823 )) 824 } 825 } 826 827 //fn get_row_separator_func(&self) -> Option<Box<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>> { 828 // unsafe { TODO: call gtk_sys:gtk_combo_box_get_row_separator_func() } 829 //} 830 get_row_span_column(&self) -> i32831 fn get_row_span_column(&self) -> i32 { 832 unsafe { gtk_sys::gtk_combo_box_get_row_span_column(self.as_ref().to_glib_none().0) } 833 } 834 get_wrap_width(&self) -> i32835 fn get_wrap_width(&self) -> i32 { 836 unsafe { gtk_sys::gtk_combo_box_get_wrap_width(self.as_ref().to_glib_none().0) } 837 } 838 popdown(&self)839 fn popdown(&self) { 840 unsafe { 841 gtk_sys::gtk_combo_box_popdown(self.as_ref().to_glib_none().0); 842 } 843 } 844 popup(&self)845 fn popup(&self) { 846 unsafe { 847 gtk_sys::gtk_combo_box_popup(self.as_ref().to_glib_none().0); 848 } 849 } 850 popup_for_device(&self, device: &gdk::Device)851 fn popup_for_device(&self, device: &gdk::Device) { 852 unsafe { 853 gtk_sys::gtk_combo_box_popup_for_device( 854 self.as_ref().to_glib_none().0, 855 device.to_glib_none().0, 856 ); 857 } 858 } 859 set_active_id(&self, active_id: Option<&str>) -> bool860 fn set_active_id(&self, active_id: Option<&str>) -> bool { 861 unsafe { 862 from_glib(gtk_sys::gtk_combo_box_set_active_id( 863 self.as_ref().to_glib_none().0, 864 active_id.to_glib_none().0, 865 )) 866 } 867 } 868 set_active_iter(&self, iter: Option<&TreeIter>)869 fn set_active_iter(&self, iter: Option<&TreeIter>) { 870 unsafe { 871 gtk_sys::gtk_combo_box_set_active_iter( 872 self.as_ref().to_glib_none().0, 873 mut_override(iter.to_glib_none().0), 874 ); 875 } 876 } 877 set_button_sensitivity(&self, sensitivity: SensitivityType)878 fn set_button_sensitivity(&self, sensitivity: SensitivityType) { 879 unsafe { 880 gtk_sys::gtk_combo_box_set_button_sensitivity( 881 self.as_ref().to_glib_none().0, 882 sensitivity.to_glib(), 883 ); 884 } 885 } 886 set_column_span_column(&self, column_span: i32)887 fn set_column_span_column(&self, column_span: i32) { 888 unsafe { 889 gtk_sys::gtk_combo_box_set_column_span_column( 890 self.as_ref().to_glib_none().0, 891 column_span, 892 ); 893 } 894 } 895 set_entry_text_column(&self, text_column: i32)896 fn set_entry_text_column(&self, text_column: i32) { 897 unsafe { 898 gtk_sys::gtk_combo_box_set_entry_text_column( 899 self.as_ref().to_glib_none().0, 900 text_column, 901 ); 902 } 903 } 904 905 #[cfg(any(not(feature = "v3_20"), feature = "dox"))] set_focus_on_click(&self, focus_on_click: bool)906 fn set_focus_on_click(&self, focus_on_click: bool) { 907 unsafe { 908 gtk_sys::gtk_combo_box_set_focus_on_click( 909 self.as_ref().to_glib_none().0, 910 focus_on_click.to_glib(), 911 ); 912 } 913 } 914 set_id_column(&self, id_column: i32)915 fn set_id_column(&self, id_column: i32) { 916 unsafe { 917 gtk_sys::gtk_combo_box_set_id_column(self.as_ref().to_glib_none().0, id_column); 918 } 919 } 920 set_model<P: IsA<TreeModel>>(&self, model: Option<&P>)921 fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>) { 922 unsafe { 923 gtk_sys::gtk_combo_box_set_model( 924 self.as_ref().to_glib_none().0, 925 model.map(|p| p.as_ref()).to_glib_none().0, 926 ); 927 } 928 } 929 set_popup_fixed_width(&self, fixed: bool)930 fn set_popup_fixed_width(&self, fixed: bool) { 931 unsafe { 932 gtk_sys::gtk_combo_box_set_popup_fixed_width( 933 self.as_ref().to_glib_none().0, 934 fixed.to_glib(), 935 ); 936 } 937 } 938 set_row_separator_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(&self, func: P)939 fn set_row_separator_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(&self, func: P) { 940 let func_data: Box_<P> = Box::new(func); 941 unsafe extern "C" fn func_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>( 942 model: *mut gtk_sys::GtkTreeModel, 943 iter: *mut gtk_sys::GtkTreeIter, 944 data: glib_sys::gpointer, 945 ) -> glib_sys::gboolean { 946 let model = from_glib_borrow(model); 947 let iter = from_glib_borrow(iter); 948 let callback: &P = &*(data as *mut _); 949 let res = (*callback)(&model, &iter); 950 res.to_glib() 951 } 952 let func = Some(func_func::<P> as _); 953 unsafe extern "C" fn destroy_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>( 954 data: glib_sys::gpointer, 955 ) { 956 let _callback: Box_<P> = Box_::from_raw(data as *mut _); 957 } 958 let destroy_call3 = Some(destroy_func::<P> as _); 959 let super_callback0: Box_<P> = func_data; 960 unsafe { 961 gtk_sys::gtk_combo_box_set_row_separator_func( 962 self.as_ref().to_glib_none().0, 963 func, 964 Box::into_raw(super_callback0) as *mut _, 965 destroy_call3, 966 ); 967 } 968 } 969 set_row_span_column(&self, row_span: i32)970 fn set_row_span_column(&self, row_span: i32) { 971 unsafe { 972 gtk_sys::gtk_combo_box_set_row_span_column(self.as_ref().to_glib_none().0, row_span); 973 } 974 } 975 set_wrap_width(&self, width: i32)976 fn set_wrap_width(&self, width: i32) { 977 unsafe { 978 gtk_sys::gtk_combo_box_set_wrap_width(self.as_ref().to_glib_none().0, width); 979 } 980 } 981 get_property_cell_area(&self) -> Option<CellArea>982 fn get_property_cell_area(&self) -> Option<CellArea> { 983 unsafe { 984 let mut value = Value::from_type(<CellArea as StaticType>::static_type()); 985 gobject_sys::g_object_get_property( 986 self.to_glib_none().0 as *mut gobject_sys::GObject, 987 b"cell-area\0".as_ptr() as *const _, 988 value.to_glib_none_mut().0, 989 ); 990 value.get() 991 } 992 } 993 get_property_has_frame(&self) -> bool994 fn get_property_has_frame(&self) -> bool { 995 unsafe { 996 let mut value = Value::from_type(<bool as StaticType>::static_type()); 997 gobject_sys::g_object_get_property( 998 self.to_glib_none().0 as *mut gobject_sys::GObject, 999 b"has-frame\0".as_ptr() as *const _, 1000 value.to_glib_none_mut().0, 1001 ); 1002 value.get().unwrap() 1003 } 1004 } 1005 set_property_has_frame(&self, has_frame: bool)1006 fn set_property_has_frame(&self, has_frame: bool) { 1007 unsafe { 1008 gobject_sys::g_object_set_property( 1009 self.to_glib_none().0 as *mut gobject_sys::GObject, 1010 b"has-frame\0".as_ptr() as *const _, 1011 Value::from(&has_frame).to_glib_none().0, 1012 ); 1013 } 1014 } 1015 get_property_popup_shown(&self) -> bool1016 fn get_property_popup_shown(&self) -> bool { 1017 unsafe { 1018 let mut value = Value::from_type(<bool as StaticType>::static_type()); 1019 gobject_sys::g_object_get_property( 1020 self.to_glib_none().0 as *mut gobject_sys::GObject, 1021 b"popup-shown\0".as_ptr() as *const _, 1022 value.to_glib_none_mut().0, 1023 ); 1024 value.get().unwrap() 1025 } 1026 } 1027 connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1028 fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1029 unsafe extern "C" fn changed_trampoline<P, F: Fn(&P) + 'static>( 1030 this: *mut gtk_sys::GtkComboBox, 1031 f: glib_sys::gpointer, 1032 ) where 1033 P: IsA<ComboBox>, 1034 { 1035 let f: &F = &*(f as *const F); 1036 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1037 } 1038 unsafe { 1039 let f: Box_<F> = Box_::new(f); 1040 connect_raw( 1041 self.as_ptr() as *mut _, 1042 b"changed\0".as_ptr() as *const _, 1043 Some(transmute(changed_trampoline::<Self, F> as usize)), 1044 Box_::into_raw(f), 1045 ) 1046 } 1047 } 1048 connect_format_entry_text<F: Fn(&Self, &str) -> String + 'static>( &self, f: F, ) -> SignalHandlerId1049 fn connect_format_entry_text<F: Fn(&Self, &str) -> String + 'static>( 1050 &self, 1051 f: F, 1052 ) -> SignalHandlerId { 1053 unsafe extern "C" fn format_entry_text_trampoline<P, F: Fn(&P, &str) -> String + 'static>( 1054 this: *mut gtk_sys::GtkComboBox, 1055 path: *mut libc::c_char, 1056 f: glib_sys::gpointer, 1057 ) -> *mut libc::c_char 1058 where 1059 P: IsA<ComboBox>, 1060 { 1061 let f: &F = &*(f as *const F); 1062 f( 1063 &ComboBox::from_glib_borrow(this).unsafe_cast(), 1064 &GString::from_glib_borrow(path), 1065 ) 1066 .to_glib_full() 1067 } 1068 unsafe { 1069 let f: Box_<F> = Box_::new(f); 1070 connect_raw( 1071 self.as_ptr() as *mut _, 1072 b"format-entry-text\0".as_ptr() as *const _, 1073 Some(transmute(format_entry_text_trampoline::<Self, F> as usize)), 1074 Box_::into_raw(f), 1075 ) 1076 } 1077 } 1078 connect_move_active<F: Fn(&Self, ScrollType) + 'static>(&self, f: F) -> SignalHandlerId1079 fn connect_move_active<F: Fn(&Self, ScrollType) + 'static>(&self, f: F) -> SignalHandlerId { 1080 unsafe extern "C" fn move_active_trampoline<P, F: Fn(&P, ScrollType) + 'static>( 1081 this: *mut gtk_sys::GtkComboBox, 1082 scroll_type: gtk_sys::GtkScrollType, 1083 f: glib_sys::gpointer, 1084 ) where 1085 P: IsA<ComboBox>, 1086 { 1087 let f: &F = &*(f as *const F); 1088 f( 1089 &ComboBox::from_glib_borrow(this).unsafe_cast(), 1090 from_glib(scroll_type), 1091 ) 1092 } 1093 unsafe { 1094 let f: Box_<F> = Box_::new(f); 1095 connect_raw( 1096 self.as_ptr() as *mut _, 1097 b"move-active\0".as_ptr() as *const _, 1098 Some(transmute(move_active_trampoline::<Self, F> as usize)), 1099 Box_::into_raw(f), 1100 ) 1101 } 1102 } 1103 emit_move_active(&self, scroll_type: ScrollType)1104 fn emit_move_active(&self, scroll_type: ScrollType) { 1105 let _ = unsafe { 1106 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 1107 .emit("move-active", &[&scroll_type]) 1108 .unwrap() 1109 }; 1110 } 1111 connect_popdown<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId1112 fn connect_popdown<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId { 1113 unsafe extern "C" fn popdown_trampoline<P, F: Fn(&P) -> bool + 'static>( 1114 this: *mut gtk_sys::GtkComboBox, 1115 f: glib_sys::gpointer, 1116 ) -> glib_sys::gboolean 1117 where 1118 P: IsA<ComboBox>, 1119 { 1120 let f: &F = &*(f as *const F); 1121 f(&ComboBox::from_glib_borrow(this).unsafe_cast()).to_glib() 1122 } 1123 unsafe { 1124 let f: Box_<F> = Box_::new(f); 1125 connect_raw( 1126 self.as_ptr() as *mut _, 1127 b"popdown\0".as_ptr() as *const _, 1128 Some(transmute(popdown_trampoline::<Self, F> as usize)), 1129 Box_::into_raw(f), 1130 ) 1131 } 1132 } 1133 emit_popdown(&self) -> bool1134 fn emit_popdown(&self) -> bool { 1135 let res = unsafe { 1136 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 1137 .emit("popdown", &[]) 1138 .unwrap() 1139 }; 1140 res.unwrap().get().unwrap() 1141 } 1142 connect_popup<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1143 fn connect_popup<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1144 unsafe extern "C" fn popup_trampoline<P, F: Fn(&P) + 'static>( 1145 this: *mut gtk_sys::GtkComboBox, 1146 f: glib_sys::gpointer, 1147 ) where 1148 P: IsA<ComboBox>, 1149 { 1150 let f: &F = &*(f as *const F); 1151 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1152 } 1153 unsafe { 1154 let f: Box_<F> = Box_::new(f); 1155 connect_raw( 1156 self.as_ptr() as *mut _, 1157 b"popup\0".as_ptr() as *const _, 1158 Some(transmute(popup_trampoline::<Self, F> as usize)), 1159 Box_::into_raw(f), 1160 ) 1161 } 1162 } 1163 emit_popup(&self)1164 fn emit_popup(&self) { 1165 let _ = unsafe { 1166 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 1167 .emit("popup", &[]) 1168 .unwrap() 1169 }; 1170 } 1171 connect_property_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1172 fn connect_property_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1173 unsafe extern "C" fn notify_active_trampoline<P, F: Fn(&P) + 'static>( 1174 this: *mut gtk_sys::GtkComboBox, 1175 _param_spec: glib_sys::gpointer, 1176 f: glib_sys::gpointer, 1177 ) where 1178 P: IsA<ComboBox>, 1179 { 1180 let f: &F = &*(f as *const F); 1181 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1182 } 1183 unsafe { 1184 let f: Box_<F> = Box_::new(f); 1185 connect_raw( 1186 self.as_ptr() as *mut _, 1187 b"notify::active\0".as_ptr() as *const _, 1188 Some(transmute(notify_active_trampoline::<Self, F> as usize)), 1189 Box_::into_raw(f), 1190 ) 1191 } 1192 } 1193 connect_property_active_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1194 fn connect_property_active_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1195 unsafe extern "C" fn notify_active_id_trampoline<P, F: Fn(&P) + 'static>( 1196 this: *mut gtk_sys::GtkComboBox, 1197 _param_spec: glib_sys::gpointer, 1198 f: glib_sys::gpointer, 1199 ) where 1200 P: IsA<ComboBox>, 1201 { 1202 let f: &F = &*(f as *const F); 1203 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1204 } 1205 unsafe { 1206 let f: Box_<F> = Box_::new(f); 1207 connect_raw( 1208 self.as_ptr() as *mut _, 1209 b"notify::active-id\0".as_ptr() as *const _, 1210 Some(transmute(notify_active_id_trampoline::<Self, F> as usize)), 1211 Box_::into_raw(f), 1212 ) 1213 } 1214 } 1215 connect_property_button_sensitivity_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1216 fn connect_property_button_sensitivity_notify<F: Fn(&Self) + 'static>( 1217 &self, 1218 f: F, 1219 ) -> SignalHandlerId { 1220 unsafe extern "C" fn notify_button_sensitivity_trampoline<P, F: Fn(&P) + 'static>( 1221 this: *mut gtk_sys::GtkComboBox, 1222 _param_spec: glib_sys::gpointer, 1223 f: glib_sys::gpointer, 1224 ) where 1225 P: IsA<ComboBox>, 1226 { 1227 let f: &F = &*(f as *const F); 1228 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1229 } 1230 unsafe { 1231 let f: Box_<F> = Box_::new(f); 1232 connect_raw( 1233 self.as_ptr() as *mut _, 1234 b"notify::button-sensitivity\0".as_ptr() as *const _, 1235 Some(transmute( 1236 notify_button_sensitivity_trampoline::<Self, F> as usize, 1237 )), 1238 Box_::into_raw(f), 1239 ) 1240 } 1241 } 1242 connect_property_column_span_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1243 fn connect_property_column_span_column_notify<F: Fn(&Self) + 'static>( 1244 &self, 1245 f: F, 1246 ) -> SignalHandlerId { 1247 unsafe extern "C" fn notify_column_span_column_trampoline<P, F: Fn(&P) + 'static>( 1248 this: *mut gtk_sys::GtkComboBox, 1249 _param_spec: glib_sys::gpointer, 1250 f: glib_sys::gpointer, 1251 ) where 1252 P: IsA<ComboBox>, 1253 { 1254 let f: &F = &*(f as *const F); 1255 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1256 } 1257 unsafe { 1258 let f: Box_<F> = Box_::new(f); 1259 connect_raw( 1260 self.as_ptr() as *mut _, 1261 b"notify::column-span-column\0".as_ptr() as *const _, 1262 Some(transmute( 1263 notify_column_span_column_trampoline::<Self, F> as usize, 1264 )), 1265 Box_::into_raw(f), 1266 ) 1267 } 1268 } 1269 connect_property_entry_text_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1270 fn connect_property_entry_text_column_notify<F: Fn(&Self) + 'static>( 1271 &self, 1272 f: F, 1273 ) -> SignalHandlerId { 1274 unsafe extern "C" fn notify_entry_text_column_trampoline<P, F: Fn(&P) + 'static>( 1275 this: *mut gtk_sys::GtkComboBox, 1276 _param_spec: glib_sys::gpointer, 1277 f: glib_sys::gpointer, 1278 ) where 1279 P: IsA<ComboBox>, 1280 { 1281 let f: &F = &*(f as *const F); 1282 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1283 } 1284 unsafe { 1285 let f: Box_<F> = Box_::new(f); 1286 connect_raw( 1287 self.as_ptr() as *mut _, 1288 b"notify::entry-text-column\0".as_ptr() as *const _, 1289 Some(transmute( 1290 notify_entry_text_column_trampoline::<Self, F> as usize, 1291 )), 1292 Box_::into_raw(f), 1293 ) 1294 } 1295 } 1296 connect_property_has_frame_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1297 fn connect_property_has_frame_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1298 unsafe extern "C" fn notify_has_frame_trampoline<P, F: Fn(&P) + 'static>( 1299 this: *mut gtk_sys::GtkComboBox, 1300 _param_spec: glib_sys::gpointer, 1301 f: glib_sys::gpointer, 1302 ) where 1303 P: IsA<ComboBox>, 1304 { 1305 let f: &F = &*(f as *const F); 1306 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1307 } 1308 unsafe { 1309 let f: Box_<F> = Box_::new(f); 1310 connect_raw( 1311 self.as_ptr() as *mut _, 1312 b"notify::has-frame\0".as_ptr() as *const _, 1313 Some(transmute(notify_has_frame_trampoline::<Self, F> as usize)), 1314 Box_::into_raw(f), 1315 ) 1316 } 1317 } 1318 connect_property_id_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1319 fn connect_property_id_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1320 unsafe extern "C" fn notify_id_column_trampoline<P, F: Fn(&P) + 'static>( 1321 this: *mut gtk_sys::GtkComboBox, 1322 _param_spec: glib_sys::gpointer, 1323 f: glib_sys::gpointer, 1324 ) where 1325 P: IsA<ComboBox>, 1326 { 1327 let f: &F = &*(f as *const F); 1328 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1329 } 1330 unsafe { 1331 let f: Box_<F> = Box_::new(f); 1332 connect_raw( 1333 self.as_ptr() as *mut _, 1334 b"notify::id-column\0".as_ptr() as *const _, 1335 Some(transmute(notify_id_column_trampoline::<Self, F> as usize)), 1336 Box_::into_raw(f), 1337 ) 1338 } 1339 } 1340 connect_property_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1341 fn connect_property_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1342 unsafe extern "C" fn notify_model_trampoline<P, F: Fn(&P) + 'static>( 1343 this: *mut gtk_sys::GtkComboBox, 1344 _param_spec: glib_sys::gpointer, 1345 f: glib_sys::gpointer, 1346 ) where 1347 P: IsA<ComboBox>, 1348 { 1349 let f: &F = &*(f as *const F); 1350 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1351 } 1352 unsafe { 1353 let f: Box_<F> = Box_::new(f); 1354 connect_raw( 1355 self.as_ptr() as *mut _, 1356 b"notify::model\0".as_ptr() as *const _, 1357 Some(transmute(notify_model_trampoline::<Self, F> as usize)), 1358 Box_::into_raw(f), 1359 ) 1360 } 1361 } 1362 connect_property_popup_fixed_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1363 fn connect_property_popup_fixed_width_notify<F: Fn(&Self) + 'static>( 1364 &self, 1365 f: F, 1366 ) -> SignalHandlerId { 1367 unsafe extern "C" fn notify_popup_fixed_width_trampoline<P, F: Fn(&P) + 'static>( 1368 this: *mut gtk_sys::GtkComboBox, 1369 _param_spec: glib_sys::gpointer, 1370 f: glib_sys::gpointer, 1371 ) where 1372 P: IsA<ComboBox>, 1373 { 1374 let f: &F = &*(f as *const F); 1375 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1376 } 1377 unsafe { 1378 let f: Box_<F> = Box_::new(f); 1379 connect_raw( 1380 self.as_ptr() as *mut _, 1381 b"notify::popup-fixed-width\0".as_ptr() as *const _, 1382 Some(transmute( 1383 notify_popup_fixed_width_trampoline::<Self, F> as usize, 1384 )), 1385 Box_::into_raw(f), 1386 ) 1387 } 1388 } 1389 connect_property_popup_shown_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1390 fn connect_property_popup_shown_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1391 unsafe extern "C" fn notify_popup_shown_trampoline<P, F: Fn(&P) + 'static>( 1392 this: *mut gtk_sys::GtkComboBox, 1393 _param_spec: glib_sys::gpointer, 1394 f: glib_sys::gpointer, 1395 ) where 1396 P: IsA<ComboBox>, 1397 { 1398 let f: &F = &*(f as *const F); 1399 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1400 } 1401 unsafe { 1402 let f: Box_<F> = Box_::new(f); 1403 connect_raw( 1404 self.as_ptr() as *mut _, 1405 b"notify::popup-shown\0".as_ptr() as *const _, 1406 Some(transmute(notify_popup_shown_trampoline::<Self, F> as usize)), 1407 Box_::into_raw(f), 1408 ) 1409 } 1410 } 1411 connect_property_row_span_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1412 fn connect_property_row_span_column_notify<F: Fn(&Self) + 'static>( 1413 &self, 1414 f: F, 1415 ) -> SignalHandlerId { 1416 unsafe extern "C" fn notify_row_span_column_trampoline<P, F: Fn(&P) + 'static>( 1417 this: *mut gtk_sys::GtkComboBox, 1418 _param_spec: glib_sys::gpointer, 1419 f: glib_sys::gpointer, 1420 ) where 1421 P: IsA<ComboBox>, 1422 { 1423 let f: &F = &*(f as *const F); 1424 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1425 } 1426 unsafe { 1427 let f: Box_<F> = Box_::new(f); 1428 connect_raw( 1429 self.as_ptr() as *mut _, 1430 b"notify::row-span-column\0".as_ptr() as *const _, 1431 Some(transmute( 1432 notify_row_span_column_trampoline::<Self, F> as usize, 1433 )), 1434 Box_::into_raw(f), 1435 ) 1436 } 1437 } 1438 connect_property_wrap_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1439 fn connect_property_wrap_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1440 unsafe extern "C" fn notify_wrap_width_trampoline<P, F: Fn(&P) + 'static>( 1441 this: *mut gtk_sys::GtkComboBox, 1442 _param_spec: glib_sys::gpointer, 1443 f: glib_sys::gpointer, 1444 ) where 1445 P: IsA<ComboBox>, 1446 { 1447 let f: &F = &*(f as *const F); 1448 f(&ComboBox::from_glib_borrow(this).unsafe_cast()) 1449 } 1450 unsafe { 1451 let f: Box_<F> = Box_::new(f); 1452 connect_raw( 1453 self.as_ptr() as *mut _, 1454 b"notify::wrap-width\0".as_ptr() as *const _, 1455 Some(transmute(notify_wrap_width_trampoline::<Self, F> as usize)), 1456 Box_::into_raw(f), 1457 ) 1458 } 1459 } 1460 } 1461 1462 impl fmt::Display for ComboBox { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1463 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 1464 write!(f, "ComboBox") 1465 } 1466 } 1467