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::GString; 12 use glib::StaticType; 13 use glib::ToValue; 14 use glib::Value; 15 use glib_sys; 16 use gtk_sys; 17 use pango; 18 use std::boxed::Box as Box_; 19 use std::fmt; 20 use std::mem::transmute; 21 use Align; 22 use Buildable; 23 use Container; 24 use ReliefStyle; 25 use ResizeMode; 26 use ToolItem; 27 use ToolShell; 28 use Widget; 29 30 glib_wrapper! { 31 pub struct ToolItemGroup(Object<gtk_sys::GtkToolItemGroup, gtk_sys::GtkToolItemGroupClass, ToolItemGroupClass>) @extends Container, Widget, @implements Buildable, ToolShell; 32 33 match fn { 34 get_type => || gtk_sys::gtk_tool_item_group_get_type(), 35 } 36 } 37 38 impl ToolItemGroup { new(label: &str) -> ToolItemGroup39 pub fn new(label: &str) -> ToolItemGroup { 40 assert_initialized_main_thread!(); 41 unsafe { 42 Widget::from_glib_none(gtk_sys::gtk_tool_item_group_new(label.to_glib_none().0)) 43 .unsafe_cast() 44 } 45 } 46 } 47 48 #[derive(Clone, Default)] 49 pub struct ToolItemGroupBuilder { 50 collapsed: Option<bool>, 51 ellipsize: Option<pango::EllipsizeMode>, 52 header_relief: Option<ReliefStyle>, 53 label: Option<String>, 54 label_widget: Option<Widget>, 55 border_width: Option<u32>, 56 child: Option<Widget>, 57 resize_mode: Option<ResizeMode>, 58 app_paintable: Option<bool>, 59 can_default: Option<bool>, 60 can_focus: Option<bool>, 61 events: Option<gdk::EventMask>, 62 expand: Option<bool>, 63 #[cfg(any(feature = "v3_20", feature = "dox"))] 64 focus_on_click: Option<bool>, 65 halign: Option<Align>, 66 has_default: Option<bool>, 67 has_focus: Option<bool>, 68 has_tooltip: Option<bool>, 69 height_request: Option<i32>, 70 hexpand: Option<bool>, 71 hexpand_set: Option<bool>, 72 is_focus: Option<bool>, 73 margin: Option<i32>, 74 margin_bottom: Option<i32>, 75 margin_end: Option<i32>, 76 margin_start: Option<i32>, 77 margin_top: Option<i32>, 78 name: Option<String>, 79 no_show_all: Option<bool>, 80 opacity: Option<f64>, 81 parent: Option<Container>, 82 receives_default: Option<bool>, 83 sensitive: Option<bool>, 84 tooltip_markup: Option<String>, 85 tooltip_text: Option<String>, 86 valign: Option<Align>, 87 vexpand: Option<bool>, 88 vexpand_set: Option<bool>, 89 visible: Option<bool>, 90 width_request: Option<i32>, 91 } 92 93 impl ToolItemGroupBuilder { new() -> Self94 pub fn new() -> Self { 95 Self::default() 96 } 97 build(self) -> ToolItemGroup98 pub fn build(self) -> ToolItemGroup { 99 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 100 if let Some(ref collapsed) = self.collapsed { 101 properties.push(("collapsed", collapsed)); 102 } 103 if let Some(ref ellipsize) = self.ellipsize { 104 properties.push(("ellipsize", ellipsize)); 105 } 106 if let Some(ref header_relief) = self.header_relief { 107 properties.push(("header-relief", header_relief)); 108 } 109 if let Some(ref label) = self.label { 110 properties.push(("label", label)); 111 } 112 if let Some(ref label_widget) = self.label_widget { 113 properties.push(("label-widget", label_widget)); 114 } 115 if let Some(ref border_width) = self.border_width { 116 properties.push(("border-width", border_width)); 117 } 118 if let Some(ref child) = self.child { 119 properties.push(("child", child)); 120 } 121 if let Some(ref resize_mode) = self.resize_mode { 122 properties.push(("resize-mode", resize_mode)); 123 } 124 if let Some(ref app_paintable) = self.app_paintable { 125 properties.push(("app-paintable", app_paintable)); 126 } 127 if let Some(ref can_default) = self.can_default { 128 properties.push(("can-default", can_default)); 129 } 130 if let Some(ref can_focus) = self.can_focus { 131 properties.push(("can-focus", can_focus)); 132 } 133 if let Some(ref events) = self.events { 134 properties.push(("events", events)); 135 } 136 if let Some(ref expand) = self.expand { 137 properties.push(("expand", expand)); 138 } 139 #[cfg(any(feature = "v3_20", feature = "dox"))] 140 { 141 if let Some(ref focus_on_click) = self.focus_on_click { 142 properties.push(("focus-on-click", focus_on_click)); 143 } 144 } 145 if let Some(ref halign) = self.halign { 146 properties.push(("halign", halign)); 147 } 148 if let Some(ref has_default) = self.has_default { 149 properties.push(("has-default", has_default)); 150 } 151 if let Some(ref has_focus) = self.has_focus { 152 properties.push(("has-focus", has_focus)); 153 } 154 if let Some(ref has_tooltip) = self.has_tooltip { 155 properties.push(("has-tooltip", has_tooltip)); 156 } 157 if let Some(ref height_request) = self.height_request { 158 properties.push(("height-request", height_request)); 159 } 160 if let Some(ref hexpand) = self.hexpand { 161 properties.push(("hexpand", hexpand)); 162 } 163 if let Some(ref hexpand_set) = self.hexpand_set { 164 properties.push(("hexpand-set", hexpand_set)); 165 } 166 if let Some(ref is_focus) = self.is_focus { 167 properties.push(("is-focus", is_focus)); 168 } 169 if let Some(ref margin) = self.margin { 170 properties.push(("margin", margin)); 171 } 172 if let Some(ref margin_bottom) = self.margin_bottom { 173 properties.push(("margin-bottom", margin_bottom)); 174 } 175 if let Some(ref margin_end) = self.margin_end { 176 properties.push(("margin-end", margin_end)); 177 } 178 if let Some(ref margin_start) = self.margin_start { 179 properties.push(("margin-start", margin_start)); 180 } 181 if let Some(ref margin_top) = self.margin_top { 182 properties.push(("margin-top", margin_top)); 183 } 184 if let Some(ref name) = self.name { 185 properties.push(("name", name)); 186 } 187 if let Some(ref no_show_all) = self.no_show_all { 188 properties.push(("no-show-all", no_show_all)); 189 } 190 if let Some(ref opacity) = self.opacity { 191 properties.push(("opacity", opacity)); 192 } 193 if let Some(ref parent) = self.parent { 194 properties.push(("parent", parent)); 195 } 196 if let Some(ref receives_default) = self.receives_default { 197 properties.push(("receives-default", receives_default)); 198 } 199 if let Some(ref sensitive) = self.sensitive { 200 properties.push(("sensitive", sensitive)); 201 } 202 if let Some(ref tooltip_markup) = self.tooltip_markup { 203 properties.push(("tooltip-markup", tooltip_markup)); 204 } 205 if let Some(ref tooltip_text) = self.tooltip_text { 206 properties.push(("tooltip-text", tooltip_text)); 207 } 208 if let Some(ref valign) = self.valign { 209 properties.push(("valign", valign)); 210 } 211 if let Some(ref vexpand) = self.vexpand { 212 properties.push(("vexpand", vexpand)); 213 } 214 if let Some(ref vexpand_set) = self.vexpand_set { 215 properties.push(("vexpand-set", vexpand_set)); 216 } 217 if let Some(ref visible) = self.visible { 218 properties.push(("visible", visible)); 219 } 220 if let Some(ref width_request) = self.width_request { 221 properties.push(("width-request", width_request)); 222 } 223 glib::Object::new(ToolItemGroup::static_type(), &properties) 224 .expect("object new") 225 .downcast() 226 .expect("downcast") 227 } 228 collapsed(mut self, collapsed: bool) -> Self229 pub fn collapsed(mut self, collapsed: bool) -> Self { 230 self.collapsed = Some(collapsed); 231 self 232 } 233 ellipsize(mut self, ellipsize: pango::EllipsizeMode) -> Self234 pub fn ellipsize(mut self, ellipsize: pango::EllipsizeMode) -> Self { 235 self.ellipsize = Some(ellipsize); 236 self 237 } 238 header_relief(mut self, header_relief: ReliefStyle) -> Self239 pub fn header_relief(mut self, header_relief: ReliefStyle) -> Self { 240 self.header_relief = Some(header_relief); 241 self 242 } 243 label(mut self, label: &str) -> Self244 pub fn label(mut self, label: &str) -> Self { 245 self.label = Some(label.to_string()); 246 self 247 } 248 label_widget<P: IsA<Widget>>(mut self, label_widget: &P) -> Self249 pub fn label_widget<P: IsA<Widget>>(mut self, label_widget: &P) -> Self { 250 self.label_widget = Some(label_widget.clone().upcast()); 251 self 252 } 253 border_width(mut self, border_width: u32) -> Self254 pub fn border_width(mut self, border_width: u32) -> Self { 255 self.border_width = Some(border_width); 256 self 257 } 258 child<P: IsA<Widget>>(mut self, child: &P) -> Self259 pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self { 260 self.child = Some(child.clone().upcast()); 261 self 262 } 263 resize_mode(mut self, resize_mode: ResizeMode) -> Self264 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self { 265 self.resize_mode = Some(resize_mode); 266 self 267 } 268 app_paintable(mut self, app_paintable: bool) -> Self269 pub fn app_paintable(mut self, app_paintable: bool) -> Self { 270 self.app_paintable = Some(app_paintable); 271 self 272 } 273 can_default(mut self, can_default: bool) -> Self274 pub fn can_default(mut self, can_default: bool) -> Self { 275 self.can_default = Some(can_default); 276 self 277 } 278 can_focus(mut self, can_focus: bool) -> Self279 pub fn can_focus(mut self, can_focus: bool) -> Self { 280 self.can_focus = Some(can_focus); 281 self 282 } 283 events(mut self, events: gdk::EventMask) -> Self284 pub fn events(mut self, events: gdk::EventMask) -> Self { 285 self.events = Some(events); 286 self 287 } 288 expand(mut self, expand: bool) -> Self289 pub fn expand(mut self, expand: bool) -> Self { 290 self.expand = Some(expand); 291 self 292 } 293 294 #[cfg(any(feature = "v3_20", feature = "dox"))] focus_on_click(mut self, focus_on_click: bool) -> Self295 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self { 296 self.focus_on_click = Some(focus_on_click); 297 self 298 } 299 halign(mut self, halign: Align) -> Self300 pub fn halign(mut self, halign: Align) -> Self { 301 self.halign = Some(halign); 302 self 303 } 304 has_default(mut self, has_default: bool) -> Self305 pub fn has_default(mut self, has_default: bool) -> Self { 306 self.has_default = Some(has_default); 307 self 308 } 309 has_focus(mut self, has_focus: bool) -> Self310 pub fn has_focus(mut self, has_focus: bool) -> Self { 311 self.has_focus = Some(has_focus); 312 self 313 } 314 has_tooltip(mut self, has_tooltip: bool) -> Self315 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self { 316 self.has_tooltip = Some(has_tooltip); 317 self 318 } 319 height_request(mut self, height_request: i32) -> Self320 pub fn height_request(mut self, height_request: i32) -> Self { 321 self.height_request = Some(height_request); 322 self 323 } 324 hexpand(mut self, hexpand: bool) -> Self325 pub fn hexpand(mut self, hexpand: bool) -> Self { 326 self.hexpand = Some(hexpand); 327 self 328 } 329 hexpand_set(mut self, hexpand_set: bool) -> Self330 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self { 331 self.hexpand_set = Some(hexpand_set); 332 self 333 } 334 is_focus(mut self, is_focus: bool) -> Self335 pub fn is_focus(mut self, is_focus: bool) -> Self { 336 self.is_focus = Some(is_focus); 337 self 338 } 339 margin(mut self, margin: i32) -> Self340 pub fn margin(mut self, margin: i32) -> Self { 341 self.margin = Some(margin); 342 self 343 } 344 margin_bottom(mut self, margin_bottom: i32) -> Self345 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self { 346 self.margin_bottom = Some(margin_bottom); 347 self 348 } 349 margin_end(mut self, margin_end: i32) -> Self350 pub fn margin_end(mut self, margin_end: i32) -> Self { 351 self.margin_end = Some(margin_end); 352 self 353 } 354 margin_start(mut self, margin_start: i32) -> Self355 pub fn margin_start(mut self, margin_start: i32) -> Self { 356 self.margin_start = Some(margin_start); 357 self 358 } 359 margin_top(mut self, margin_top: i32) -> Self360 pub fn margin_top(mut self, margin_top: i32) -> Self { 361 self.margin_top = Some(margin_top); 362 self 363 } 364 name(mut self, name: &str) -> Self365 pub fn name(mut self, name: &str) -> Self { 366 self.name = Some(name.to_string()); 367 self 368 } 369 no_show_all(mut self, no_show_all: bool) -> Self370 pub fn no_show_all(mut self, no_show_all: bool) -> Self { 371 self.no_show_all = Some(no_show_all); 372 self 373 } 374 opacity(mut self, opacity: f64) -> Self375 pub fn opacity(mut self, opacity: f64) -> Self { 376 self.opacity = Some(opacity); 377 self 378 } 379 parent<P: IsA<Container>>(mut self, parent: &P) -> Self380 pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self { 381 self.parent = Some(parent.clone().upcast()); 382 self 383 } 384 receives_default(mut self, receives_default: bool) -> Self385 pub fn receives_default(mut self, receives_default: bool) -> Self { 386 self.receives_default = Some(receives_default); 387 self 388 } 389 sensitive(mut self, sensitive: bool) -> Self390 pub fn sensitive(mut self, sensitive: bool) -> Self { 391 self.sensitive = Some(sensitive); 392 self 393 } 394 tooltip_markup(mut self, tooltip_markup: &str) -> Self395 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self { 396 self.tooltip_markup = Some(tooltip_markup.to_string()); 397 self 398 } 399 tooltip_text(mut self, tooltip_text: &str) -> Self400 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self { 401 self.tooltip_text = Some(tooltip_text.to_string()); 402 self 403 } 404 valign(mut self, valign: Align) -> Self405 pub fn valign(mut self, valign: Align) -> Self { 406 self.valign = Some(valign); 407 self 408 } 409 vexpand(mut self, vexpand: bool) -> Self410 pub fn vexpand(mut self, vexpand: bool) -> Self { 411 self.vexpand = Some(vexpand); 412 self 413 } 414 vexpand_set(mut self, vexpand_set: bool) -> Self415 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self { 416 self.vexpand_set = Some(vexpand_set); 417 self 418 } 419 visible(mut self, visible: bool) -> Self420 pub fn visible(mut self, visible: bool) -> Self { 421 self.visible = Some(visible); 422 self 423 } 424 width_request(mut self, width_request: i32) -> Self425 pub fn width_request(mut self, width_request: i32) -> Self { 426 self.width_request = Some(width_request); 427 self 428 } 429 } 430 431 pub const NONE_TOOL_ITEM_GROUP: Option<&ToolItemGroup> = None; 432 433 pub trait ToolItemGroupExt: 'static { get_collapsed(&self) -> bool434 fn get_collapsed(&self) -> bool; 435 get_drop_item(&self, x: i32, y: i32) -> Option<ToolItem>436 fn get_drop_item(&self, x: i32, y: i32) -> Option<ToolItem>; 437 get_ellipsize(&self) -> pango::EllipsizeMode438 fn get_ellipsize(&self) -> pango::EllipsizeMode; 439 get_header_relief(&self) -> ReliefStyle440 fn get_header_relief(&self) -> ReliefStyle; 441 get_item_position<P: IsA<ToolItem>>(&self, item: &P) -> i32442 fn get_item_position<P: IsA<ToolItem>>(&self, item: &P) -> i32; 443 get_label(&self) -> Option<GString>444 fn get_label(&self) -> Option<GString>; 445 get_label_widget(&self) -> Option<Widget>446 fn get_label_widget(&self) -> Option<Widget>; 447 get_n_items(&self) -> u32448 fn get_n_items(&self) -> u32; 449 get_nth_item(&self, index: u32) -> Option<ToolItem>450 fn get_nth_item(&self, index: u32) -> Option<ToolItem>; 451 insert<P: IsA<ToolItem>>(&self, item: &P, position: i32)452 fn insert<P: IsA<ToolItem>>(&self, item: &P, position: i32); 453 set_collapsed(&self, collapsed: bool)454 fn set_collapsed(&self, collapsed: bool); 455 set_ellipsize(&self, ellipsize: pango::EllipsizeMode)456 fn set_ellipsize(&self, ellipsize: pango::EllipsizeMode); 457 set_header_relief(&self, style: ReliefStyle)458 fn set_header_relief(&self, style: ReliefStyle); 459 set_item_position<P: IsA<ToolItem>>(&self, item: &P, position: i32)460 fn set_item_position<P: IsA<ToolItem>>(&self, item: &P, position: i32); 461 set_label(&self, label: &str)462 fn set_label(&self, label: &str); 463 set_label_widget<P: IsA<Widget>>(&self, label_widget: &P)464 fn set_label_widget<P: IsA<Widget>>(&self, label_widget: &P); 465 get_item_expand<T: IsA<ToolItem>>(&self, item: &T) -> bool466 fn get_item_expand<T: IsA<ToolItem>>(&self, item: &T) -> bool; 467 set_item_expand<T: IsA<ToolItem>>(&self, item: &T, expand: bool)468 fn set_item_expand<T: IsA<ToolItem>>(&self, item: &T, expand: bool); 469 get_item_fill<T: IsA<ToolItem>>(&self, item: &T) -> bool470 fn get_item_fill<T: IsA<ToolItem>>(&self, item: &T) -> bool; 471 set_item_fill<T: IsA<ToolItem>>(&self, item: &T, fill: bool)472 fn set_item_fill<T: IsA<ToolItem>>(&self, item: &T, fill: bool); 473 get_item_homogeneous<T: IsA<ToolItem>>(&self, item: &T) -> bool474 fn get_item_homogeneous<T: IsA<ToolItem>>(&self, item: &T) -> bool; 475 set_item_homogeneous<T: IsA<ToolItem>>(&self, item: &T, homogeneous: bool)476 fn set_item_homogeneous<T: IsA<ToolItem>>(&self, item: &T, homogeneous: bool); 477 get_item_new_row<T: IsA<ToolItem>>(&self, item: &T) -> bool478 fn get_item_new_row<T: IsA<ToolItem>>(&self, item: &T) -> bool; 479 set_item_new_row<T: IsA<ToolItem>>(&self, item: &T, new_row: bool)480 fn set_item_new_row<T: IsA<ToolItem>>(&self, item: &T, new_row: bool); 481 connect_property_collapsed_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId482 fn connect_property_collapsed_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 483 connect_property_ellipsize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId484 fn connect_property_ellipsize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 485 connect_property_header_relief_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId486 fn connect_property_header_relief_notify<F: Fn(&Self) + 'static>( 487 &self, 488 f: F, 489 ) -> SignalHandlerId; 490 connect_property_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId491 fn connect_property_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 492 connect_property_label_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId493 fn connect_property_label_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) 494 -> SignalHandlerId; 495 } 496 497 impl<O: IsA<ToolItemGroup>> ToolItemGroupExt for O { get_collapsed(&self) -> bool498 fn get_collapsed(&self) -> bool { 499 unsafe { 500 from_glib(gtk_sys::gtk_tool_item_group_get_collapsed( 501 self.as_ref().to_glib_none().0, 502 )) 503 } 504 } 505 get_drop_item(&self, x: i32, y: i32) -> Option<ToolItem>506 fn get_drop_item(&self, x: i32, y: i32) -> Option<ToolItem> { 507 unsafe { 508 from_glib_none(gtk_sys::gtk_tool_item_group_get_drop_item( 509 self.as_ref().to_glib_none().0, 510 x, 511 y, 512 )) 513 } 514 } 515 get_ellipsize(&self) -> pango::EllipsizeMode516 fn get_ellipsize(&self) -> pango::EllipsizeMode { 517 unsafe { 518 from_glib(gtk_sys::gtk_tool_item_group_get_ellipsize( 519 self.as_ref().to_glib_none().0, 520 )) 521 } 522 } 523 get_header_relief(&self) -> ReliefStyle524 fn get_header_relief(&self) -> ReliefStyle { 525 unsafe { 526 from_glib(gtk_sys::gtk_tool_item_group_get_header_relief( 527 self.as_ref().to_glib_none().0, 528 )) 529 } 530 } 531 get_item_position<P: IsA<ToolItem>>(&self, item: &P) -> i32532 fn get_item_position<P: IsA<ToolItem>>(&self, item: &P) -> i32 { 533 unsafe { 534 gtk_sys::gtk_tool_item_group_get_item_position( 535 self.as_ref().to_glib_none().0, 536 item.as_ref().to_glib_none().0, 537 ) 538 } 539 } 540 get_label(&self) -> Option<GString>541 fn get_label(&self) -> Option<GString> { 542 unsafe { 543 from_glib_none(gtk_sys::gtk_tool_item_group_get_label( 544 self.as_ref().to_glib_none().0, 545 )) 546 } 547 } 548 get_label_widget(&self) -> Option<Widget>549 fn get_label_widget(&self) -> Option<Widget> { 550 unsafe { 551 from_glib_none(gtk_sys::gtk_tool_item_group_get_label_widget( 552 self.as_ref().to_glib_none().0, 553 )) 554 } 555 } 556 get_n_items(&self) -> u32557 fn get_n_items(&self) -> u32 { 558 unsafe { gtk_sys::gtk_tool_item_group_get_n_items(self.as_ref().to_glib_none().0) } 559 } 560 get_nth_item(&self, index: u32) -> Option<ToolItem>561 fn get_nth_item(&self, index: u32) -> Option<ToolItem> { 562 unsafe { 563 from_glib_none(gtk_sys::gtk_tool_item_group_get_nth_item( 564 self.as_ref().to_glib_none().0, 565 index, 566 )) 567 } 568 } 569 insert<P: IsA<ToolItem>>(&self, item: &P, position: i32)570 fn insert<P: IsA<ToolItem>>(&self, item: &P, position: i32) { 571 unsafe { 572 gtk_sys::gtk_tool_item_group_insert( 573 self.as_ref().to_glib_none().0, 574 item.as_ref().to_glib_none().0, 575 position, 576 ); 577 } 578 } 579 set_collapsed(&self, collapsed: bool)580 fn set_collapsed(&self, collapsed: bool) { 581 unsafe { 582 gtk_sys::gtk_tool_item_group_set_collapsed( 583 self.as_ref().to_glib_none().0, 584 collapsed.to_glib(), 585 ); 586 } 587 } 588 set_ellipsize(&self, ellipsize: pango::EllipsizeMode)589 fn set_ellipsize(&self, ellipsize: pango::EllipsizeMode) { 590 unsafe { 591 gtk_sys::gtk_tool_item_group_set_ellipsize( 592 self.as_ref().to_glib_none().0, 593 ellipsize.to_glib(), 594 ); 595 } 596 } 597 set_header_relief(&self, style: ReliefStyle)598 fn set_header_relief(&self, style: ReliefStyle) { 599 unsafe { 600 gtk_sys::gtk_tool_item_group_set_header_relief( 601 self.as_ref().to_glib_none().0, 602 style.to_glib(), 603 ); 604 } 605 } 606 set_item_position<P: IsA<ToolItem>>(&self, item: &P, position: i32)607 fn set_item_position<P: IsA<ToolItem>>(&self, item: &P, position: i32) { 608 unsafe { 609 gtk_sys::gtk_tool_item_group_set_item_position( 610 self.as_ref().to_glib_none().0, 611 item.as_ref().to_glib_none().0, 612 position, 613 ); 614 } 615 } 616 set_label(&self, label: &str)617 fn set_label(&self, label: &str) { 618 unsafe { 619 gtk_sys::gtk_tool_item_group_set_label( 620 self.as_ref().to_glib_none().0, 621 label.to_glib_none().0, 622 ); 623 } 624 } 625 set_label_widget<P: IsA<Widget>>(&self, label_widget: &P)626 fn set_label_widget<P: IsA<Widget>>(&self, label_widget: &P) { 627 unsafe { 628 gtk_sys::gtk_tool_item_group_set_label_widget( 629 self.as_ref().to_glib_none().0, 630 label_widget.as_ref().to_glib_none().0, 631 ); 632 } 633 } 634 get_item_expand<T: IsA<ToolItem>>(&self, item: &T) -> bool635 fn get_item_expand<T: IsA<ToolItem>>(&self, item: &T) -> bool { 636 unsafe { 637 let mut value = Value::from_type(<bool as StaticType>::static_type()); 638 gtk_sys::gtk_container_child_get_property( 639 self.to_glib_none().0 as *mut gtk_sys::GtkContainer, 640 item.to_glib_none().0 as *mut _, 641 b"expand\0".as_ptr() as *const _, 642 value.to_glib_none_mut().0, 643 ); 644 value 645 .get() 646 .expect("Return Value for property `expand` getter") 647 .unwrap() 648 } 649 } 650 set_item_expand<T: IsA<ToolItem>>(&self, item: &T, expand: bool)651 fn set_item_expand<T: IsA<ToolItem>>(&self, item: &T, expand: bool) { 652 unsafe { 653 gtk_sys::gtk_container_child_set_property( 654 self.to_glib_none().0 as *mut gtk_sys::GtkContainer, 655 item.to_glib_none().0 as *mut _, 656 b"expand\0".as_ptr() as *const _, 657 Value::from(&expand).to_glib_none().0, 658 ); 659 } 660 } 661 get_item_fill<T: IsA<ToolItem>>(&self, item: &T) -> bool662 fn get_item_fill<T: IsA<ToolItem>>(&self, item: &T) -> bool { 663 unsafe { 664 let mut value = Value::from_type(<bool as StaticType>::static_type()); 665 gtk_sys::gtk_container_child_get_property( 666 self.to_glib_none().0 as *mut gtk_sys::GtkContainer, 667 item.to_glib_none().0 as *mut _, 668 b"fill\0".as_ptr() as *const _, 669 value.to_glib_none_mut().0, 670 ); 671 value 672 .get() 673 .expect("Return Value for property `fill` getter") 674 .unwrap() 675 } 676 } 677 set_item_fill<T: IsA<ToolItem>>(&self, item: &T, fill: bool)678 fn set_item_fill<T: IsA<ToolItem>>(&self, item: &T, fill: bool) { 679 unsafe { 680 gtk_sys::gtk_container_child_set_property( 681 self.to_glib_none().0 as *mut gtk_sys::GtkContainer, 682 item.to_glib_none().0 as *mut _, 683 b"fill\0".as_ptr() as *const _, 684 Value::from(&fill).to_glib_none().0, 685 ); 686 } 687 } 688 get_item_homogeneous<T: IsA<ToolItem>>(&self, item: &T) -> bool689 fn get_item_homogeneous<T: IsA<ToolItem>>(&self, item: &T) -> bool { 690 unsafe { 691 let mut value = Value::from_type(<bool as StaticType>::static_type()); 692 gtk_sys::gtk_container_child_get_property( 693 self.to_glib_none().0 as *mut gtk_sys::GtkContainer, 694 item.to_glib_none().0 as *mut _, 695 b"homogeneous\0".as_ptr() as *const _, 696 value.to_glib_none_mut().0, 697 ); 698 value 699 .get() 700 .expect("Return Value for property `homogeneous` getter") 701 .unwrap() 702 } 703 } 704 set_item_homogeneous<T: IsA<ToolItem>>(&self, item: &T, homogeneous: bool)705 fn set_item_homogeneous<T: IsA<ToolItem>>(&self, item: &T, homogeneous: bool) { 706 unsafe { 707 gtk_sys::gtk_container_child_set_property( 708 self.to_glib_none().0 as *mut gtk_sys::GtkContainer, 709 item.to_glib_none().0 as *mut _, 710 b"homogeneous\0".as_ptr() as *const _, 711 Value::from(&homogeneous).to_glib_none().0, 712 ); 713 } 714 } 715 get_item_new_row<T: IsA<ToolItem>>(&self, item: &T) -> bool716 fn get_item_new_row<T: IsA<ToolItem>>(&self, item: &T) -> bool { 717 unsafe { 718 let mut value = Value::from_type(<bool as StaticType>::static_type()); 719 gtk_sys::gtk_container_child_get_property( 720 self.to_glib_none().0 as *mut gtk_sys::GtkContainer, 721 item.to_glib_none().0 as *mut _, 722 b"new-row\0".as_ptr() as *const _, 723 value.to_glib_none_mut().0, 724 ); 725 value 726 .get() 727 .expect("Return Value for property `new-row` getter") 728 .unwrap() 729 } 730 } 731 set_item_new_row<T: IsA<ToolItem>>(&self, item: &T, new_row: bool)732 fn set_item_new_row<T: IsA<ToolItem>>(&self, item: &T, new_row: bool) { 733 unsafe { 734 gtk_sys::gtk_container_child_set_property( 735 self.to_glib_none().0 as *mut gtk_sys::GtkContainer, 736 item.to_glib_none().0 as *mut _, 737 b"new-row\0".as_ptr() as *const _, 738 Value::from(&new_row).to_glib_none().0, 739 ); 740 } 741 } 742 connect_property_collapsed_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId743 fn connect_property_collapsed_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 744 unsafe extern "C" fn notify_collapsed_trampoline<P, F: Fn(&P) + 'static>( 745 this: *mut gtk_sys::GtkToolItemGroup, 746 _param_spec: glib_sys::gpointer, 747 f: glib_sys::gpointer, 748 ) where 749 P: IsA<ToolItemGroup>, 750 { 751 let f: &F = &*(f as *const F); 752 f(&ToolItemGroup::from_glib_borrow(this).unsafe_cast()) 753 } 754 unsafe { 755 let f: Box_<F> = Box_::new(f); 756 connect_raw( 757 self.as_ptr() as *mut _, 758 b"notify::collapsed\0".as_ptr() as *const _, 759 Some(transmute(notify_collapsed_trampoline::<Self, F> as usize)), 760 Box_::into_raw(f), 761 ) 762 } 763 } 764 connect_property_ellipsize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId765 fn connect_property_ellipsize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 766 unsafe extern "C" fn notify_ellipsize_trampoline<P, F: Fn(&P) + 'static>( 767 this: *mut gtk_sys::GtkToolItemGroup, 768 _param_spec: glib_sys::gpointer, 769 f: glib_sys::gpointer, 770 ) where 771 P: IsA<ToolItemGroup>, 772 { 773 let f: &F = &*(f as *const F); 774 f(&ToolItemGroup::from_glib_borrow(this).unsafe_cast()) 775 } 776 unsafe { 777 let f: Box_<F> = Box_::new(f); 778 connect_raw( 779 self.as_ptr() as *mut _, 780 b"notify::ellipsize\0".as_ptr() as *const _, 781 Some(transmute(notify_ellipsize_trampoline::<Self, F> as usize)), 782 Box_::into_raw(f), 783 ) 784 } 785 } 786 connect_property_header_relief_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId787 fn connect_property_header_relief_notify<F: Fn(&Self) + 'static>( 788 &self, 789 f: F, 790 ) -> SignalHandlerId { 791 unsafe extern "C" fn notify_header_relief_trampoline<P, F: Fn(&P) + 'static>( 792 this: *mut gtk_sys::GtkToolItemGroup, 793 _param_spec: glib_sys::gpointer, 794 f: glib_sys::gpointer, 795 ) where 796 P: IsA<ToolItemGroup>, 797 { 798 let f: &F = &*(f as *const F); 799 f(&ToolItemGroup::from_glib_borrow(this).unsafe_cast()) 800 } 801 unsafe { 802 let f: Box_<F> = Box_::new(f); 803 connect_raw( 804 self.as_ptr() as *mut _, 805 b"notify::header-relief\0".as_ptr() as *const _, 806 Some(transmute( 807 notify_header_relief_trampoline::<Self, F> as usize, 808 )), 809 Box_::into_raw(f), 810 ) 811 } 812 } 813 connect_property_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId814 fn connect_property_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 815 unsafe extern "C" fn notify_label_trampoline<P, F: Fn(&P) + 'static>( 816 this: *mut gtk_sys::GtkToolItemGroup, 817 _param_spec: glib_sys::gpointer, 818 f: glib_sys::gpointer, 819 ) where 820 P: IsA<ToolItemGroup>, 821 { 822 let f: &F = &*(f as *const F); 823 f(&ToolItemGroup::from_glib_borrow(this).unsafe_cast()) 824 } 825 unsafe { 826 let f: Box_<F> = Box_::new(f); 827 connect_raw( 828 self.as_ptr() as *mut _, 829 b"notify::label\0".as_ptr() as *const _, 830 Some(transmute(notify_label_trampoline::<Self, F> as usize)), 831 Box_::into_raw(f), 832 ) 833 } 834 } 835 connect_property_label_widget_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId836 fn connect_property_label_widget_notify<F: Fn(&Self) + 'static>( 837 &self, 838 f: F, 839 ) -> SignalHandlerId { 840 unsafe extern "C" fn notify_label_widget_trampoline<P, F: Fn(&P) + 'static>( 841 this: *mut gtk_sys::GtkToolItemGroup, 842 _param_spec: glib_sys::gpointer, 843 f: glib_sys::gpointer, 844 ) where 845 P: IsA<ToolItemGroup>, 846 { 847 let f: &F = &*(f as *const F); 848 f(&ToolItemGroup::from_glib_borrow(this).unsafe_cast()) 849 } 850 unsafe { 851 let f: Box_<F> = Box_::new(f); 852 connect_raw( 853 self.as_ptr() as *mut _, 854 b"notify::label-widget\0".as_ptr() as *const _, 855 Some(transmute( 856 notify_label_widget_trampoline::<Self, F> as usize, 857 )), 858 Box_::into_raw(f), 859 ) 860 } 861 } 862 } 863 864 impl fmt::Display for ToolItemGroup { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result865 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 866 write!(f, "ToolItemGroup") 867 } 868 } 869