1 // This file was generated by gir (https://github.com/gtk-rs/gir) 2 // from gir-files (https://github.com/gtk-rs/gir-files) 3 // DO NOT EDIT 4 5 use crate::Align; 6 use crate::Buildable; 7 use crate::Container; 8 use crate::ReliefStyle; 9 use crate::ResizeMode; 10 use crate::ToolItem; 11 use crate::ToolShell; 12 use crate::Widget; 13 use glib::object::Cast; 14 use glib::object::IsA; 15 use glib::signal::connect_raw; 16 use glib::signal::SignalHandlerId; 17 use glib::translate::*; 18 use glib::StaticType; 19 use glib::ToValue; 20 use std::boxed::Box as Box_; 21 use std::fmt; 22 use std::mem::transmute; 23 24 glib::wrapper! { 25 #[doc(alias = "GtkToolItemGroup")] 26 pub struct ToolItemGroup(Object<ffi::GtkToolItemGroup, ffi::GtkToolItemGroupClass>) @extends Container, Widget, @implements Buildable, ToolShell; 27 28 match fn { 29 type_ => || ffi::gtk_tool_item_group_get_type(), 30 } 31 } 32 33 impl ToolItemGroup { 34 #[doc(alias = "gtk_tool_item_group_new")] new(label: &str) -> ToolItemGroup35 pub fn new(label: &str) -> ToolItemGroup { 36 assert_initialized_main_thread!(); 37 unsafe { 38 Widget::from_glib_none(ffi::gtk_tool_item_group_new(label.to_glib_none().0)) 39 .unsafe_cast() 40 } 41 } 42 43 // rustdoc-stripper-ignore-next 44 /// Creates a new builder-pattern struct instance to construct [`ToolItemGroup`] objects. 45 /// 46 /// This method returns an instance of [`ToolItemGroupBuilder`] which can be used to create [`ToolItemGroup`] objects. builder() -> ToolItemGroupBuilder47 pub fn builder() -> ToolItemGroupBuilder { 48 ToolItemGroupBuilder::default() 49 } 50 } 51 52 #[derive(Clone, Default)] 53 // rustdoc-stripper-ignore-next 54 /// A [builder-pattern] type to construct [`ToolItemGroup`] objects. 55 /// 56 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html 57 pub struct ToolItemGroupBuilder { 58 collapsed: Option<bool>, 59 ellipsize: Option<pango::EllipsizeMode>, 60 header_relief: Option<ReliefStyle>, 61 label: Option<String>, 62 label_widget: Option<Widget>, 63 border_width: Option<u32>, 64 child: Option<Widget>, 65 resize_mode: Option<ResizeMode>, 66 app_paintable: Option<bool>, 67 can_default: Option<bool>, 68 can_focus: Option<bool>, 69 events: Option<gdk::EventMask>, 70 expand: Option<bool>, 71 #[cfg(any(feature = "v3_20", feature = "dox"))] 72 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))] 73 focus_on_click: Option<bool>, 74 halign: Option<Align>, 75 has_default: Option<bool>, 76 has_focus: Option<bool>, 77 has_tooltip: Option<bool>, 78 height_request: Option<i32>, 79 hexpand: Option<bool>, 80 hexpand_set: Option<bool>, 81 is_focus: Option<bool>, 82 margin: Option<i32>, 83 margin_bottom: Option<i32>, 84 margin_end: Option<i32>, 85 margin_start: Option<i32>, 86 margin_top: Option<i32>, 87 name: Option<String>, 88 no_show_all: Option<bool>, 89 opacity: Option<f64>, 90 parent: Option<Container>, 91 receives_default: Option<bool>, 92 sensitive: Option<bool>, 93 tooltip_markup: Option<String>, 94 tooltip_text: Option<String>, 95 valign: Option<Align>, 96 vexpand: Option<bool>, 97 vexpand_set: Option<bool>, 98 visible: Option<bool>, 99 width_request: Option<i32>, 100 } 101 102 impl ToolItemGroupBuilder { 103 // rustdoc-stripper-ignore-next 104 /// Create a new [`ToolItemGroupBuilder`]. new() -> Self105 pub fn new() -> Self { 106 Self::default() 107 } 108 109 // rustdoc-stripper-ignore-next 110 /// Build the [`ToolItemGroup`]. build(self) -> ToolItemGroup111 pub fn build(self) -> ToolItemGroup { 112 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 113 if let Some(ref collapsed) = self.collapsed { 114 properties.push(("collapsed", collapsed)); 115 } 116 if let Some(ref ellipsize) = self.ellipsize { 117 properties.push(("ellipsize", ellipsize)); 118 } 119 if let Some(ref header_relief) = self.header_relief { 120 properties.push(("header-relief", header_relief)); 121 } 122 if let Some(ref label) = self.label { 123 properties.push(("label", label)); 124 } 125 if let Some(ref label_widget) = self.label_widget { 126 properties.push(("label-widget", label_widget)); 127 } 128 if let Some(ref border_width) = self.border_width { 129 properties.push(("border-width", border_width)); 130 } 131 if let Some(ref child) = self.child { 132 properties.push(("child", child)); 133 } 134 if let Some(ref resize_mode) = self.resize_mode { 135 properties.push(("resize-mode", resize_mode)); 136 } 137 if let Some(ref app_paintable) = self.app_paintable { 138 properties.push(("app-paintable", app_paintable)); 139 } 140 if let Some(ref can_default) = self.can_default { 141 properties.push(("can-default", can_default)); 142 } 143 if let Some(ref can_focus) = self.can_focus { 144 properties.push(("can-focus", can_focus)); 145 } 146 if let Some(ref events) = self.events { 147 properties.push(("events", events)); 148 } 149 if let Some(ref expand) = self.expand { 150 properties.push(("expand", expand)); 151 } 152 #[cfg(any(feature = "v3_20", feature = "dox"))] 153 if let Some(ref focus_on_click) = self.focus_on_click { 154 properties.push(("focus-on-click", focus_on_click)); 155 } 156 if let Some(ref halign) = self.halign { 157 properties.push(("halign", halign)); 158 } 159 if let Some(ref has_default) = self.has_default { 160 properties.push(("has-default", has_default)); 161 } 162 if let Some(ref has_focus) = self.has_focus { 163 properties.push(("has-focus", has_focus)); 164 } 165 if let Some(ref has_tooltip) = self.has_tooltip { 166 properties.push(("has-tooltip", has_tooltip)); 167 } 168 if let Some(ref height_request) = self.height_request { 169 properties.push(("height-request", height_request)); 170 } 171 if let Some(ref hexpand) = self.hexpand { 172 properties.push(("hexpand", hexpand)); 173 } 174 if let Some(ref hexpand_set) = self.hexpand_set { 175 properties.push(("hexpand-set", hexpand_set)); 176 } 177 if let Some(ref is_focus) = self.is_focus { 178 properties.push(("is-focus", is_focus)); 179 } 180 if let Some(ref margin) = self.margin { 181 properties.push(("margin", margin)); 182 } 183 if let Some(ref margin_bottom) = self.margin_bottom { 184 properties.push(("margin-bottom", margin_bottom)); 185 } 186 if let Some(ref margin_end) = self.margin_end { 187 properties.push(("margin-end", margin_end)); 188 } 189 if let Some(ref margin_start) = self.margin_start { 190 properties.push(("margin-start", margin_start)); 191 } 192 if let Some(ref margin_top) = self.margin_top { 193 properties.push(("margin-top", margin_top)); 194 } 195 if let Some(ref name) = self.name { 196 properties.push(("name", name)); 197 } 198 if let Some(ref no_show_all) = self.no_show_all { 199 properties.push(("no-show-all", no_show_all)); 200 } 201 if let Some(ref opacity) = self.opacity { 202 properties.push(("opacity", opacity)); 203 } 204 if let Some(ref parent) = self.parent { 205 properties.push(("parent", parent)); 206 } 207 if let Some(ref receives_default) = self.receives_default { 208 properties.push(("receives-default", receives_default)); 209 } 210 if let Some(ref sensitive) = self.sensitive { 211 properties.push(("sensitive", sensitive)); 212 } 213 if let Some(ref tooltip_markup) = self.tooltip_markup { 214 properties.push(("tooltip-markup", tooltip_markup)); 215 } 216 if let Some(ref tooltip_text) = self.tooltip_text { 217 properties.push(("tooltip-text", tooltip_text)); 218 } 219 if let Some(ref valign) = self.valign { 220 properties.push(("valign", valign)); 221 } 222 if let Some(ref vexpand) = self.vexpand { 223 properties.push(("vexpand", vexpand)); 224 } 225 if let Some(ref vexpand_set) = self.vexpand_set { 226 properties.push(("vexpand-set", vexpand_set)); 227 } 228 if let Some(ref visible) = self.visible { 229 properties.push(("visible", visible)); 230 } 231 if let Some(ref width_request) = self.width_request { 232 properties.push(("width-request", width_request)); 233 } 234 glib::Object::new::<ToolItemGroup>(&properties) 235 .expect("Failed to create an instance of ToolItemGroup") 236 } 237 collapsed(mut self, collapsed: bool) -> Self238 pub fn collapsed(mut self, collapsed: bool) -> Self { 239 self.collapsed = Some(collapsed); 240 self 241 } 242 ellipsize(mut self, ellipsize: pango::EllipsizeMode) -> Self243 pub fn ellipsize(mut self, ellipsize: pango::EllipsizeMode) -> Self { 244 self.ellipsize = Some(ellipsize); 245 self 246 } 247 header_relief(mut self, header_relief: ReliefStyle) -> Self248 pub fn header_relief(mut self, header_relief: ReliefStyle) -> Self { 249 self.header_relief = Some(header_relief); 250 self 251 } 252 label(mut self, label: &str) -> Self253 pub fn label(mut self, label: &str) -> Self { 254 self.label = Some(label.to_string()); 255 self 256 } 257 label_widget<P: IsA<Widget>>(mut self, label_widget: &P) -> Self258 pub fn label_widget<P: IsA<Widget>>(mut self, label_widget: &P) -> Self { 259 self.label_widget = Some(label_widget.clone().upcast()); 260 self 261 } 262 border_width(mut self, border_width: u32) -> Self263 pub fn border_width(mut self, border_width: u32) -> Self { 264 self.border_width = Some(border_width); 265 self 266 } 267 child<P: IsA<Widget>>(mut self, child: &P) -> Self268 pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self { 269 self.child = Some(child.clone().upcast()); 270 self 271 } 272 resize_mode(mut self, resize_mode: ResizeMode) -> Self273 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self { 274 self.resize_mode = Some(resize_mode); 275 self 276 } 277 app_paintable(mut self, app_paintable: bool) -> Self278 pub fn app_paintable(mut self, app_paintable: bool) -> Self { 279 self.app_paintable = Some(app_paintable); 280 self 281 } 282 can_default(mut self, can_default: bool) -> Self283 pub fn can_default(mut self, can_default: bool) -> Self { 284 self.can_default = Some(can_default); 285 self 286 } 287 can_focus(mut self, can_focus: bool) -> Self288 pub fn can_focus(mut self, can_focus: bool) -> Self { 289 self.can_focus = Some(can_focus); 290 self 291 } 292 events(mut self, events: gdk::EventMask) -> Self293 pub fn events(mut self, events: gdk::EventMask) -> Self { 294 self.events = Some(events); 295 self 296 } 297 expand(mut self, expand: bool) -> Self298 pub fn expand(mut self, expand: bool) -> Self { 299 self.expand = Some(expand); 300 self 301 } 302 303 #[cfg(any(feature = "v3_20", feature = "dox"))] 304 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))] focus_on_click(mut self, focus_on_click: bool) -> Self305 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self { 306 self.focus_on_click = Some(focus_on_click); 307 self 308 } 309 halign(mut self, halign: Align) -> Self310 pub fn halign(mut self, halign: Align) -> Self { 311 self.halign = Some(halign); 312 self 313 } 314 has_default(mut self, has_default: bool) -> Self315 pub fn has_default(mut self, has_default: bool) -> Self { 316 self.has_default = Some(has_default); 317 self 318 } 319 has_focus(mut self, has_focus: bool) -> Self320 pub fn has_focus(mut self, has_focus: bool) -> Self { 321 self.has_focus = Some(has_focus); 322 self 323 } 324 has_tooltip(mut self, has_tooltip: bool) -> Self325 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self { 326 self.has_tooltip = Some(has_tooltip); 327 self 328 } 329 height_request(mut self, height_request: i32) -> Self330 pub fn height_request(mut self, height_request: i32) -> Self { 331 self.height_request = Some(height_request); 332 self 333 } 334 hexpand(mut self, hexpand: bool) -> Self335 pub fn hexpand(mut self, hexpand: bool) -> Self { 336 self.hexpand = Some(hexpand); 337 self 338 } 339 hexpand_set(mut self, hexpand_set: bool) -> Self340 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self { 341 self.hexpand_set = Some(hexpand_set); 342 self 343 } 344 is_focus(mut self, is_focus: bool) -> Self345 pub fn is_focus(mut self, is_focus: bool) -> Self { 346 self.is_focus = Some(is_focus); 347 self 348 } 349 margin(mut self, margin: i32) -> Self350 pub fn margin(mut self, margin: i32) -> Self { 351 self.margin = Some(margin); 352 self 353 } 354 margin_bottom(mut self, margin_bottom: i32) -> Self355 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self { 356 self.margin_bottom = Some(margin_bottom); 357 self 358 } 359 margin_end(mut self, margin_end: i32) -> Self360 pub fn margin_end(mut self, margin_end: i32) -> Self { 361 self.margin_end = Some(margin_end); 362 self 363 } 364 margin_start(mut self, margin_start: i32) -> Self365 pub fn margin_start(mut self, margin_start: i32) -> Self { 366 self.margin_start = Some(margin_start); 367 self 368 } 369 margin_top(mut self, margin_top: i32) -> Self370 pub fn margin_top(mut self, margin_top: i32) -> Self { 371 self.margin_top = Some(margin_top); 372 self 373 } 374 name(mut self, name: &str) -> Self375 pub fn name(mut self, name: &str) -> Self { 376 self.name = Some(name.to_string()); 377 self 378 } 379 no_show_all(mut self, no_show_all: bool) -> Self380 pub fn no_show_all(mut self, no_show_all: bool) -> Self { 381 self.no_show_all = Some(no_show_all); 382 self 383 } 384 opacity(mut self, opacity: f64) -> Self385 pub fn opacity(mut self, opacity: f64) -> Self { 386 self.opacity = Some(opacity); 387 self 388 } 389 parent<P: IsA<Container>>(mut self, parent: &P) -> Self390 pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self { 391 self.parent = Some(parent.clone().upcast()); 392 self 393 } 394 receives_default(mut self, receives_default: bool) -> Self395 pub fn receives_default(mut self, receives_default: bool) -> Self { 396 self.receives_default = Some(receives_default); 397 self 398 } 399 sensitive(mut self, sensitive: bool) -> Self400 pub fn sensitive(mut self, sensitive: bool) -> Self { 401 self.sensitive = Some(sensitive); 402 self 403 } 404 tooltip_markup(mut self, tooltip_markup: &str) -> Self405 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self { 406 self.tooltip_markup = Some(tooltip_markup.to_string()); 407 self 408 } 409 tooltip_text(mut self, tooltip_text: &str) -> Self410 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self { 411 self.tooltip_text = Some(tooltip_text.to_string()); 412 self 413 } 414 valign(mut self, valign: Align) -> Self415 pub fn valign(mut self, valign: Align) -> Self { 416 self.valign = Some(valign); 417 self 418 } 419 vexpand(mut self, vexpand: bool) -> Self420 pub fn vexpand(mut self, vexpand: bool) -> Self { 421 self.vexpand = Some(vexpand); 422 self 423 } 424 vexpand_set(mut self, vexpand_set: bool) -> Self425 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self { 426 self.vexpand_set = Some(vexpand_set); 427 self 428 } 429 visible(mut self, visible: bool) -> Self430 pub fn visible(mut self, visible: bool) -> Self { 431 self.visible = Some(visible); 432 self 433 } 434 width_request(mut self, width_request: i32) -> Self435 pub fn width_request(mut self, width_request: i32) -> Self { 436 self.width_request = Some(width_request); 437 self 438 } 439 } 440 441 pub const NONE_TOOL_ITEM_GROUP: Option<&ToolItemGroup> = None; 442 443 pub trait ToolItemGroupExt: 'static { 444 #[doc(alias = "gtk_tool_item_group_get_collapsed")] 445 #[doc(alias = "get_collapsed")] is_collapsed(&self) -> bool446 fn is_collapsed(&self) -> bool; 447 448 #[doc(alias = "gtk_tool_item_group_get_drop_item")] 449 #[doc(alias = "get_drop_item")] drop_item(&self, x: i32, y: i32) -> Option<ToolItem>450 fn drop_item(&self, x: i32, y: i32) -> Option<ToolItem>; 451 452 #[doc(alias = "gtk_tool_item_group_get_ellipsize")] 453 #[doc(alias = "get_ellipsize")] ellipsize(&self) -> pango::EllipsizeMode454 fn ellipsize(&self) -> pango::EllipsizeMode; 455 456 #[doc(alias = "gtk_tool_item_group_get_header_relief")] 457 #[doc(alias = "get_header_relief")] header_relief(&self) -> ReliefStyle458 fn header_relief(&self) -> ReliefStyle; 459 460 #[doc(alias = "gtk_tool_item_group_get_item_position")] 461 #[doc(alias = "get_item_position")] item_position<P: IsA<ToolItem>>(&self, item: &P) -> i32462 fn item_position<P: IsA<ToolItem>>(&self, item: &P) -> i32; 463 464 #[doc(alias = "gtk_tool_item_group_get_label")] 465 #[doc(alias = "get_label")] label(&self) -> Option<glib::GString>466 fn label(&self) -> Option<glib::GString>; 467 468 #[doc(alias = "gtk_tool_item_group_get_label_widget")] 469 #[doc(alias = "get_label_widget")] label_widget(&self) -> Option<Widget>470 fn label_widget(&self) -> Option<Widget>; 471 472 #[doc(alias = "gtk_tool_item_group_get_n_items")] 473 #[doc(alias = "get_n_items")] n_items(&self) -> u32474 fn n_items(&self) -> u32; 475 476 #[doc(alias = "gtk_tool_item_group_get_nth_item")] 477 #[doc(alias = "get_nth_item")] nth_item(&self, index: u32) -> Option<ToolItem>478 fn nth_item(&self, index: u32) -> Option<ToolItem>; 479 480 #[doc(alias = "gtk_tool_item_group_insert")] insert<P: IsA<ToolItem>>(&self, item: &P, position: i32)481 fn insert<P: IsA<ToolItem>>(&self, item: &P, position: i32); 482 483 #[doc(alias = "gtk_tool_item_group_set_collapsed")] set_collapsed(&self, collapsed: bool)484 fn set_collapsed(&self, collapsed: bool); 485 486 #[doc(alias = "gtk_tool_item_group_set_ellipsize")] set_ellipsize(&self, ellipsize: pango::EllipsizeMode)487 fn set_ellipsize(&self, ellipsize: pango::EllipsizeMode); 488 489 #[doc(alias = "gtk_tool_item_group_set_header_relief")] set_header_relief(&self, style: ReliefStyle)490 fn set_header_relief(&self, style: ReliefStyle); 491 492 #[doc(alias = "gtk_tool_item_group_set_item_position")] set_item_position<P: IsA<ToolItem>>(&self, item: &P, position: i32)493 fn set_item_position<P: IsA<ToolItem>>(&self, item: &P, position: i32); 494 495 #[doc(alias = "gtk_tool_item_group_set_label")] set_label(&self, label: &str)496 fn set_label(&self, label: &str); 497 498 #[doc(alias = "gtk_tool_item_group_set_label_widget")] set_label_widget<P: IsA<Widget>>(&self, label_widget: &P)499 fn set_label_widget<P: IsA<Widget>>(&self, label_widget: &P); 500 item_expands<T: IsA<ToolItem>>(&self, item: &T) -> bool501 fn item_expands<T: IsA<ToolItem>>(&self, item: &T) -> bool; 502 set_item_expand<T: IsA<ToolItem>>(&self, item: &T, expand: bool)503 fn set_item_expand<T: IsA<ToolItem>>(&self, item: &T, expand: bool); 504 item_fills<T: IsA<ToolItem>>(&self, item: &T) -> bool505 fn item_fills<T: IsA<ToolItem>>(&self, item: &T) -> bool; 506 set_item_fill<T: IsA<ToolItem>>(&self, item: &T, fill: bool)507 fn set_item_fill<T: IsA<ToolItem>>(&self, item: &T, fill: bool); 508 item_is_homogeneous<T: IsA<ToolItem>>(&self, item: &T) -> bool509 fn item_is_homogeneous<T: IsA<ToolItem>>(&self, item: &T) -> bool; 510 set_item_homogeneous<T: IsA<ToolItem>>(&self, item: &T, homogeneous: bool)511 fn set_item_homogeneous<T: IsA<ToolItem>>(&self, item: &T, homogeneous: bool); 512 513 #[doc(alias = "item.new-row")] item_is_new_row<T: IsA<ToolItem>>(&self, item: &T) -> bool514 fn item_is_new_row<T: IsA<ToolItem>>(&self, item: &T) -> bool; 515 516 #[doc(alias = "item.new-row")] set_item_new_row<T: IsA<ToolItem>>(&self, item: &T, new_row: bool)517 fn set_item_new_row<T: IsA<ToolItem>>(&self, item: &T, new_row: bool); 518 519 #[doc(alias = "collapsed")] connect_collapsed_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId520 fn connect_collapsed_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 521 522 #[doc(alias = "ellipsize")] connect_ellipsize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId523 fn connect_ellipsize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 524 525 #[doc(alias = "header-relief")] connect_header_relief_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId526 fn connect_header_relief_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 527 528 #[doc(alias = "label")] connect_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId529 fn connect_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 530 531 #[doc(alias = "label-widget")] connect_label_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId532 fn connect_label_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 533 } 534 535 impl<O: IsA<ToolItemGroup>> ToolItemGroupExt for O { is_collapsed(&self) -> bool536 fn is_collapsed(&self) -> bool { 537 unsafe { 538 from_glib(ffi::gtk_tool_item_group_get_collapsed( 539 self.as_ref().to_glib_none().0, 540 )) 541 } 542 } 543 drop_item(&self, x: i32, y: i32) -> Option<ToolItem>544 fn drop_item(&self, x: i32, y: i32) -> Option<ToolItem> { 545 unsafe { 546 from_glib_none(ffi::gtk_tool_item_group_get_drop_item( 547 self.as_ref().to_glib_none().0, 548 x, 549 y, 550 )) 551 } 552 } 553 ellipsize(&self) -> pango::EllipsizeMode554 fn ellipsize(&self) -> pango::EllipsizeMode { 555 unsafe { 556 from_glib(ffi::gtk_tool_item_group_get_ellipsize( 557 self.as_ref().to_glib_none().0, 558 )) 559 } 560 } 561 header_relief(&self) -> ReliefStyle562 fn header_relief(&self) -> ReliefStyle { 563 unsafe { 564 from_glib(ffi::gtk_tool_item_group_get_header_relief( 565 self.as_ref().to_glib_none().0, 566 )) 567 } 568 } 569 item_position<P: IsA<ToolItem>>(&self, item: &P) -> i32570 fn item_position<P: IsA<ToolItem>>(&self, item: &P) -> i32 { 571 unsafe { 572 ffi::gtk_tool_item_group_get_item_position( 573 self.as_ref().to_glib_none().0, 574 item.as_ref().to_glib_none().0, 575 ) 576 } 577 } 578 label(&self) -> Option<glib::GString>579 fn label(&self) -> Option<glib::GString> { 580 unsafe { 581 from_glib_none(ffi::gtk_tool_item_group_get_label( 582 self.as_ref().to_glib_none().0, 583 )) 584 } 585 } 586 label_widget(&self) -> Option<Widget>587 fn label_widget(&self) -> Option<Widget> { 588 unsafe { 589 from_glib_none(ffi::gtk_tool_item_group_get_label_widget( 590 self.as_ref().to_glib_none().0, 591 )) 592 } 593 } 594 n_items(&self) -> u32595 fn n_items(&self) -> u32 { 596 unsafe { ffi::gtk_tool_item_group_get_n_items(self.as_ref().to_glib_none().0) } 597 } 598 nth_item(&self, index: u32) -> Option<ToolItem>599 fn nth_item(&self, index: u32) -> Option<ToolItem> { 600 unsafe { 601 from_glib_none(ffi::gtk_tool_item_group_get_nth_item( 602 self.as_ref().to_glib_none().0, 603 index, 604 )) 605 } 606 } 607 insert<P: IsA<ToolItem>>(&self, item: &P, position: i32)608 fn insert<P: IsA<ToolItem>>(&self, item: &P, position: i32) { 609 unsafe { 610 ffi::gtk_tool_item_group_insert( 611 self.as_ref().to_glib_none().0, 612 item.as_ref().to_glib_none().0, 613 position, 614 ); 615 } 616 } 617 set_collapsed(&self, collapsed: bool)618 fn set_collapsed(&self, collapsed: bool) { 619 unsafe { 620 ffi::gtk_tool_item_group_set_collapsed( 621 self.as_ref().to_glib_none().0, 622 collapsed.into_glib(), 623 ); 624 } 625 } 626 set_ellipsize(&self, ellipsize: pango::EllipsizeMode)627 fn set_ellipsize(&self, ellipsize: pango::EllipsizeMode) { 628 unsafe { 629 ffi::gtk_tool_item_group_set_ellipsize( 630 self.as_ref().to_glib_none().0, 631 ellipsize.into_glib(), 632 ); 633 } 634 } 635 set_header_relief(&self, style: ReliefStyle)636 fn set_header_relief(&self, style: ReliefStyle) { 637 unsafe { 638 ffi::gtk_tool_item_group_set_header_relief( 639 self.as_ref().to_glib_none().0, 640 style.into_glib(), 641 ); 642 } 643 } 644 set_item_position<P: IsA<ToolItem>>(&self, item: &P, position: i32)645 fn set_item_position<P: IsA<ToolItem>>(&self, item: &P, position: i32) { 646 unsafe { 647 ffi::gtk_tool_item_group_set_item_position( 648 self.as_ref().to_glib_none().0, 649 item.as_ref().to_glib_none().0, 650 position, 651 ); 652 } 653 } 654 set_label(&self, label: &str)655 fn set_label(&self, label: &str) { 656 unsafe { 657 ffi::gtk_tool_item_group_set_label( 658 self.as_ref().to_glib_none().0, 659 label.to_glib_none().0, 660 ); 661 } 662 } 663 set_label_widget<P: IsA<Widget>>(&self, label_widget: &P)664 fn set_label_widget<P: IsA<Widget>>(&self, label_widget: &P) { 665 unsafe { 666 ffi::gtk_tool_item_group_set_label_widget( 667 self.as_ref().to_glib_none().0, 668 label_widget.as_ref().to_glib_none().0, 669 ); 670 } 671 } 672 item_expands<T: IsA<ToolItem>>(&self, item: &T) -> bool673 fn item_expands<T: IsA<ToolItem>>(&self, item: &T) -> bool { 674 unsafe { 675 let mut value = glib::Value::from_type(<bool as StaticType>::static_type()); 676 crate::ffi::gtk_container_child_get_property( 677 self.to_glib_none().0 as *mut crate::ffi::GtkContainer, 678 item.to_glib_none().0 as *mut _, 679 b"expand\0".as_ptr() as *const _, 680 value.to_glib_none_mut().0, 681 ); 682 value 683 .get() 684 .expect("Return Value for property `expand` getter") 685 } 686 } 687 set_item_expand<T: IsA<ToolItem>>(&self, item: &T, expand: bool)688 fn set_item_expand<T: IsA<ToolItem>>(&self, item: &T, expand: bool) { 689 unsafe { 690 crate::ffi::gtk_container_child_set_property( 691 self.to_glib_none().0 as *mut crate::ffi::GtkContainer, 692 item.to_glib_none().0 as *mut _, 693 b"expand\0".as_ptr() as *const _, 694 expand.to_value().to_glib_none().0, 695 ); 696 } 697 } 698 item_fills<T: IsA<ToolItem>>(&self, item: &T) -> bool699 fn item_fills<T: IsA<ToolItem>>(&self, item: &T) -> bool { 700 unsafe { 701 let mut value = glib::Value::from_type(<bool as StaticType>::static_type()); 702 crate::ffi::gtk_container_child_get_property( 703 self.to_glib_none().0 as *mut crate::ffi::GtkContainer, 704 item.to_glib_none().0 as *mut _, 705 b"fill\0".as_ptr() as *const _, 706 value.to_glib_none_mut().0, 707 ); 708 value 709 .get() 710 .expect("Return Value for property `fill` getter") 711 } 712 } 713 set_item_fill<T: IsA<ToolItem>>(&self, item: &T, fill: bool)714 fn set_item_fill<T: IsA<ToolItem>>(&self, item: &T, fill: bool) { 715 unsafe { 716 crate::ffi::gtk_container_child_set_property( 717 self.to_glib_none().0 as *mut crate::ffi::GtkContainer, 718 item.to_glib_none().0 as *mut _, 719 b"fill\0".as_ptr() as *const _, 720 fill.to_value().to_glib_none().0, 721 ); 722 } 723 } 724 item_is_homogeneous<T: IsA<ToolItem>>(&self, item: &T) -> bool725 fn item_is_homogeneous<T: IsA<ToolItem>>(&self, item: &T) -> bool { 726 unsafe { 727 let mut value = glib::Value::from_type(<bool as StaticType>::static_type()); 728 crate::ffi::gtk_container_child_get_property( 729 self.to_glib_none().0 as *mut crate::ffi::GtkContainer, 730 item.to_glib_none().0 as *mut _, 731 b"homogeneous\0".as_ptr() as *const _, 732 value.to_glib_none_mut().0, 733 ); 734 value 735 .get() 736 .expect("Return Value for property `homogeneous` getter") 737 } 738 } 739 set_item_homogeneous<T: IsA<ToolItem>>(&self, item: &T, homogeneous: bool)740 fn set_item_homogeneous<T: IsA<ToolItem>>(&self, item: &T, homogeneous: bool) { 741 unsafe { 742 crate::ffi::gtk_container_child_set_property( 743 self.to_glib_none().0 as *mut crate::ffi::GtkContainer, 744 item.to_glib_none().0 as *mut _, 745 b"homogeneous\0".as_ptr() as *const _, 746 homogeneous.to_value().to_glib_none().0, 747 ); 748 } 749 } 750 item_is_new_row<T: IsA<ToolItem>>(&self, item: &T) -> bool751 fn item_is_new_row<T: IsA<ToolItem>>(&self, item: &T) -> bool { 752 unsafe { 753 let mut value = glib::Value::from_type(<bool as StaticType>::static_type()); 754 crate::ffi::gtk_container_child_get_property( 755 self.to_glib_none().0 as *mut crate::ffi::GtkContainer, 756 item.to_glib_none().0 as *mut _, 757 b"new-row\0".as_ptr() as *const _, 758 value.to_glib_none_mut().0, 759 ); 760 value 761 .get() 762 .expect("Return Value for property `new-row` getter") 763 } 764 } 765 set_item_new_row<T: IsA<ToolItem>>(&self, item: &T, new_row: bool)766 fn set_item_new_row<T: IsA<ToolItem>>(&self, item: &T, new_row: bool) { 767 unsafe { 768 crate::ffi::gtk_container_child_set_property( 769 self.to_glib_none().0 as *mut crate::ffi::GtkContainer, 770 item.to_glib_none().0 as *mut _, 771 b"new-row\0".as_ptr() as *const _, 772 new_row.to_value().to_glib_none().0, 773 ); 774 } 775 } 776 connect_collapsed_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId777 fn connect_collapsed_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 778 unsafe extern "C" fn notify_collapsed_trampoline< 779 P: IsA<ToolItemGroup>, 780 F: Fn(&P) + 'static, 781 >( 782 this: *mut ffi::GtkToolItemGroup, 783 _param_spec: glib::ffi::gpointer, 784 f: glib::ffi::gpointer, 785 ) { 786 let f: &F = &*(f as *const F); 787 f(ToolItemGroup::from_glib_borrow(this).unsafe_cast_ref()) 788 } 789 unsafe { 790 let f: Box_<F> = Box_::new(f); 791 connect_raw( 792 self.as_ptr() as *mut _, 793 b"notify::collapsed\0".as_ptr() as *const _, 794 Some(transmute::<_, unsafe extern "C" fn()>( 795 notify_collapsed_trampoline::<Self, F> as *const (), 796 )), 797 Box_::into_raw(f), 798 ) 799 } 800 } 801 connect_ellipsize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId802 fn connect_ellipsize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 803 unsafe extern "C" fn notify_ellipsize_trampoline< 804 P: IsA<ToolItemGroup>, 805 F: Fn(&P) + 'static, 806 >( 807 this: *mut ffi::GtkToolItemGroup, 808 _param_spec: glib::ffi::gpointer, 809 f: glib::ffi::gpointer, 810 ) { 811 let f: &F = &*(f as *const F); 812 f(ToolItemGroup::from_glib_borrow(this).unsafe_cast_ref()) 813 } 814 unsafe { 815 let f: Box_<F> = Box_::new(f); 816 connect_raw( 817 self.as_ptr() as *mut _, 818 b"notify::ellipsize\0".as_ptr() as *const _, 819 Some(transmute::<_, unsafe extern "C" fn()>( 820 notify_ellipsize_trampoline::<Self, F> as *const (), 821 )), 822 Box_::into_raw(f), 823 ) 824 } 825 } 826 connect_header_relief_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId827 fn connect_header_relief_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 828 unsafe extern "C" fn notify_header_relief_trampoline< 829 P: IsA<ToolItemGroup>, 830 F: Fn(&P) + 'static, 831 >( 832 this: *mut ffi::GtkToolItemGroup, 833 _param_spec: glib::ffi::gpointer, 834 f: glib::ffi::gpointer, 835 ) { 836 let f: &F = &*(f as *const F); 837 f(ToolItemGroup::from_glib_borrow(this).unsafe_cast_ref()) 838 } 839 unsafe { 840 let f: Box_<F> = Box_::new(f); 841 connect_raw( 842 self.as_ptr() as *mut _, 843 b"notify::header-relief\0".as_ptr() as *const _, 844 Some(transmute::<_, unsafe extern "C" fn()>( 845 notify_header_relief_trampoline::<Self, F> as *const (), 846 )), 847 Box_::into_raw(f), 848 ) 849 } 850 } 851 connect_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId852 fn connect_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 853 unsafe extern "C" fn notify_label_trampoline<P: IsA<ToolItemGroup>, F: Fn(&P) + 'static>( 854 this: *mut ffi::GtkToolItemGroup, 855 _param_spec: glib::ffi::gpointer, 856 f: glib::ffi::gpointer, 857 ) { 858 let f: &F = &*(f as *const F); 859 f(ToolItemGroup::from_glib_borrow(this).unsafe_cast_ref()) 860 } 861 unsafe { 862 let f: Box_<F> = Box_::new(f); 863 connect_raw( 864 self.as_ptr() as *mut _, 865 b"notify::label\0".as_ptr() as *const _, 866 Some(transmute::<_, unsafe extern "C" fn()>( 867 notify_label_trampoline::<Self, F> as *const (), 868 )), 869 Box_::into_raw(f), 870 ) 871 } 872 } 873 connect_label_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId874 fn connect_label_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 875 unsafe extern "C" fn notify_label_widget_trampoline< 876 P: IsA<ToolItemGroup>, 877 F: Fn(&P) + 'static, 878 >( 879 this: *mut ffi::GtkToolItemGroup, 880 _param_spec: glib::ffi::gpointer, 881 f: glib::ffi::gpointer, 882 ) { 883 let f: &F = &*(f as *const F); 884 f(ToolItemGroup::from_glib_borrow(this).unsafe_cast_ref()) 885 } 886 unsafe { 887 let f: Box_<F> = Box_::new(f); 888 connect_raw( 889 self.as_ptr() as *mut _, 890 b"notify::label-widget\0".as_ptr() as *const _, 891 Some(transmute::<_, unsafe extern "C" fn()>( 892 notify_label_widget_trampoline::<Self, F> as *const (), 893 )), 894 Box_::into_raw(f), 895 ) 896 } 897 } 898 } 899 900 impl fmt::Display for ToolItemGroup { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result901 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 902 f.write_str("ToolItemGroup") 903 } 904 } 905