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::CellRenderer; 6 use crate::CellRendererAccelMode; 7 use crate::CellRendererMode; 8 use crate::CellRendererText; 9 use crate::TreePath; 10 use glib::object::Cast; 11 use glib::object::IsA; 12 use glib::signal::connect_raw; 13 use glib::signal::SignalHandlerId; 14 use glib::translate::*; 15 use glib::StaticType; 16 use glib::ToValue; 17 use std::boxed::Box as Box_; 18 use std::fmt; 19 use std::mem::transmute; 20 21 glib::wrapper! { 22 #[doc(alias = "GtkCellRendererAccel")] 23 pub struct CellRendererAccel(Object<ffi::GtkCellRendererAccel, ffi::GtkCellRendererAccelClass>) @extends CellRendererText, CellRenderer; 24 25 match fn { 26 type_ => || ffi::gtk_cell_renderer_accel_get_type(), 27 } 28 } 29 30 impl CellRendererAccel { 31 #[doc(alias = "gtk_cell_renderer_accel_new")] new() -> CellRendererAccel32 pub fn new() -> CellRendererAccel { 33 assert_initialized_main_thread!(); 34 unsafe { CellRenderer::from_glib_none(ffi::gtk_cell_renderer_accel_new()).unsafe_cast() } 35 } 36 37 // rustdoc-stripper-ignore-next 38 /// Creates a new builder-pattern struct instance to construct [`CellRendererAccel`] objects. 39 /// 40 /// This method returns an instance of [`CellRendererAccelBuilder`] which can be used to create [`CellRendererAccel`] objects. builder() -> CellRendererAccelBuilder41 pub fn builder() -> CellRendererAccelBuilder { 42 CellRendererAccelBuilder::default() 43 } 44 } 45 46 impl Default for CellRendererAccel { default() -> Self47 fn default() -> Self { 48 Self::new() 49 } 50 } 51 52 #[derive(Clone, Default)] 53 // rustdoc-stripper-ignore-next 54 /// A [builder-pattern] type to construct [`CellRendererAccel`] objects. 55 /// 56 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html 57 pub struct CellRendererAccelBuilder { 58 accel_key: Option<u32>, 59 accel_mode: Option<CellRendererAccelMode>, 60 accel_mods: Option<gdk::ModifierType>, 61 keycode: Option<u32>, 62 align_set: Option<bool>, 63 alignment: Option<pango::Alignment>, 64 attributes: Option<pango::AttrList>, 65 background: Option<String>, 66 background_rgba: Option<gdk::RGBA>, 67 background_set: Option<bool>, 68 editable: Option<bool>, 69 editable_set: Option<bool>, 70 ellipsize: Option<pango::EllipsizeMode>, 71 ellipsize_set: Option<bool>, 72 family: Option<String>, 73 family_set: Option<bool>, 74 font: Option<String>, 75 font_desc: Option<pango::FontDescription>, 76 foreground: Option<String>, 77 foreground_rgba: Option<gdk::RGBA>, 78 foreground_set: Option<bool>, 79 language: Option<String>, 80 language_set: Option<bool>, 81 markup: Option<String>, 82 max_width_chars: Option<i32>, 83 placeholder_text: Option<String>, 84 rise: Option<i32>, 85 rise_set: Option<bool>, 86 scale: Option<f64>, 87 scale_set: Option<bool>, 88 single_paragraph_mode: Option<bool>, 89 size: Option<i32>, 90 size_points: Option<f64>, 91 size_set: Option<bool>, 92 stretch: Option<pango::Stretch>, 93 stretch_set: Option<bool>, 94 strikethrough: Option<bool>, 95 strikethrough_set: Option<bool>, 96 style: Option<pango::Style>, 97 style_set: Option<bool>, 98 text: Option<String>, 99 underline: Option<pango::Underline>, 100 underline_set: Option<bool>, 101 variant: Option<pango::Variant>, 102 variant_set: Option<bool>, 103 weight: Option<i32>, 104 weight_set: Option<bool>, 105 width_chars: Option<i32>, 106 wrap_mode: Option<pango::WrapMode>, 107 wrap_width: Option<i32>, 108 cell_background: Option<String>, 109 cell_background_rgba: Option<gdk::RGBA>, 110 cell_background_set: Option<bool>, 111 height: Option<i32>, 112 is_expanded: Option<bool>, 113 is_expander: Option<bool>, 114 mode: Option<CellRendererMode>, 115 sensitive: Option<bool>, 116 visible: Option<bool>, 117 width: Option<i32>, 118 xalign: Option<f32>, 119 xpad: Option<u32>, 120 yalign: Option<f32>, 121 ypad: Option<u32>, 122 } 123 124 impl CellRendererAccelBuilder { 125 // rustdoc-stripper-ignore-next 126 /// Create a new [`CellRendererAccelBuilder`]. new() -> Self127 pub fn new() -> Self { 128 Self::default() 129 } 130 131 // rustdoc-stripper-ignore-next 132 /// Build the [`CellRendererAccel`]. build(self) -> CellRendererAccel133 pub fn build(self) -> CellRendererAccel { 134 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 135 if let Some(ref accel_key) = self.accel_key { 136 properties.push(("accel-key", accel_key)); 137 } 138 if let Some(ref accel_mode) = self.accel_mode { 139 properties.push(("accel-mode", accel_mode)); 140 } 141 if let Some(ref accel_mods) = self.accel_mods { 142 properties.push(("accel-mods", accel_mods)); 143 } 144 if let Some(ref keycode) = self.keycode { 145 properties.push(("keycode", keycode)); 146 } 147 if let Some(ref align_set) = self.align_set { 148 properties.push(("align-set", align_set)); 149 } 150 if let Some(ref alignment) = self.alignment { 151 properties.push(("alignment", alignment)); 152 } 153 if let Some(ref attributes) = self.attributes { 154 properties.push(("attributes", attributes)); 155 } 156 if let Some(ref background) = self.background { 157 properties.push(("background", background)); 158 } 159 if let Some(ref background_rgba) = self.background_rgba { 160 properties.push(("background-rgba", background_rgba)); 161 } 162 if let Some(ref background_set) = self.background_set { 163 properties.push(("background-set", background_set)); 164 } 165 if let Some(ref editable) = self.editable { 166 properties.push(("editable", editable)); 167 } 168 if let Some(ref editable_set) = self.editable_set { 169 properties.push(("editable-set", editable_set)); 170 } 171 if let Some(ref ellipsize) = self.ellipsize { 172 properties.push(("ellipsize", ellipsize)); 173 } 174 if let Some(ref ellipsize_set) = self.ellipsize_set { 175 properties.push(("ellipsize-set", ellipsize_set)); 176 } 177 if let Some(ref family) = self.family { 178 properties.push(("family", family)); 179 } 180 if let Some(ref family_set) = self.family_set { 181 properties.push(("family-set", family_set)); 182 } 183 if let Some(ref font) = self.font { 184 properties.push(("font", font)); 185 } 186 if let Some(ref font_desc) = self.font_desc { 187 properties.push(("font-desc", font_desc)); 188 } 189 if let Some(ref foreground) = self.foreground { 190 properties.push(("foreground", foreground)); 191 } 192 if let Some(ref foreground_rgba) = self.foreground_rgba { 193 properties.push(("foreground-rgba", foreground_rgba)); 194 } 195 if let Some(ref foreground_set) = self.foreground_set { 196 properties.push(("foreground-set", foreground_set)); 197 } 198 if let Some(ref language) = self.language { 199 properties.push(("language", language)); 200 } 201 if let Some(ref language_set) = self.language_set { 202 properties.push(("language-set", language_set)); 203 } 204 if let Some(ref markup) = self.markup { 205 properties.push(("markup", markup)); 206 } 207 if let Some(ref max_width_chars) = self.max_width_chars { 208 properties.push(("max-width-chars", max_width_chars)); 209 } 210 if let Some(ref placeholder_text) = self.placeholder_text { 211 properties.push(("placeholder-text", placeholder_text)); 212 } 213 if let Some(ref rise) = self.rise { 214 properties.push(("rise", rise)); 215 } 216 if let Some(ref rise_set) = self.rise_set { 217 properties.push(("rise-set", rise_set)); 218 } 219 if let Some(ref scale) = self.scale { 220 properties.push(("scale", scale)); 221 } 222 if let Some(ref scale_set) = self.scale_set { 223 properties.push(("scale-set", scale_set)); 224 } 225 if let Some(ref single_paragraph_mode) = self.single_paragraph_mode { 226 properties.push(("single-paragraph-mode", single_paragraph_mode)); 227 } 228 if let Some(ref size) = self.size { 229 properties.push(("size", size)); 230 } 231 if let Some(ref size_points) = self.size_points { 232 properties.push(("size-points", size_points)); 233 } 234 if let Some(ref size_set) = self.size_set { 235 properties.push(("size-set", size_set)); 236 } 237 if let Some(ref stretch) = self.stretch { 238 properties.push(("stretch", stretch)); 239 } 240 if let Some(ref stretch_set) = self.stretch_set { 241 properties.push(("stretch-set", stretch_set)); 242 } 243 if let Some(ref strikethrough) = self.strikethrough { 244 properties.push(("strikethrough", strikethrough)); 245 } 246 if let Some(ref strikethrough_set) = self.strikethrough_set { 247 properties.push(("strikethrough-set", strikethrough_set)); 248 } 249 if let Some(ref style) = self.style { 250 properties.push(("style", style)); 251 } 252 if let Some(ref style_set) = self.style_set { 253 properties.push(("style-set", style_set)); 254 } 255 if let Some(ref text) = self.text { 256 properties.push(("text", text)); 257 } 258 if let Some(ref underline) = self.underline { 259 properties.push(("underline", underline)); 260 } 261 if let Some(ref underline_set) = self.underline_set { 262 properties.push(("underline-set", underline_set)); 263 } 264 if let Some(ref variant) = self.variant { 265 properties.push(("variant", variant)); 266 } 267 if let Some(ref variant_set) = self.variant_set { 268 properties.push(("variant-set", variant_set)); 269 } 270 if let Some(ref weight) = self.weight { 271 properties.push(("weight", weight)); 272 } 273 if let Some(ref weight_set) = self.weight_set { 274 properties.push(("weight-set", weight_set)); 275 } 276 if let Some(ref width_chars) = self.width_chars { 277 properties.push(("width-chars", width_chars)); 278 } 279 if let Some(ref wrap_mode) = self.wrap_mode { 280 properties.push(("wrap-mode", wrap_mode)); 281 } 282 if let Some(ref wrap_width) = self.wrap_width { 283 properties.push(("wrap-width", wrap_width)); 284 } 285 if let Some(ref cell_background) = self.cell_background { 286 properties.push(("cell-background", cell_background)); 287 } 288 if let Some(ref cell_background_rgba) = self.cell_background_rgba { 289 properties.push(("cell-background-rgba", cell_background_rgba)); 290 } 291 if let Some(ref cell_background_set) = self.cell_background_set { 292 properties.push(("cell-background-set", cell_background_set)); 293 } 294 if let Some(ref height) = self.height { 295 properties.push(("height", height)); 296 } 297 if let Some(ref is_expanded) = self.is_expanded { 298 properties.push(("is-expanded", is_expanded)); 299 } 300 if let Some(ref is_expander) = self.is_expander { 301 properties.push(("is-expander", is_expander)); 302 } 303 if let Some(ref mode) = self.mode { 304 properties.push(("mode", mode)); 305 } 306 if let Some(ref sensitive) = self.sensitive { 307 properties.push(("sensitive", sensitive)); 308 } 309 if let Some(ref visible) = self.visible { 310 properties.push(("visible", visible)); 311 } 312 if let Some(ref width) = self.width { 313 properties.push(("width", width)); 314 } 315 if let Some(ref xalign) = self.xalign { 316 properties.push(("xalign", xalign)); 317 } 318 if let Some(ref xpad) = self.xpad { 319 properties.push(("xpad", xpad)); 320 } 321 if let Some(ref yalign) = self.yalign { 322 properties.push(("yalign", yalign)); 323 } 324 if let Some(ref ypad) = self.ypad { 325 properties.push(("ypad", ypad)); 326 } 327 glib::Object::new::<CellRendererAccel>(&properties) 328 .expect("Failed to create an instance of CellRendererAccel") 329 } 330 accel_key(mut self, accel_key: u32) -> Self331 pub fn accel_key(mut self, accel_key: u32) -> Self { 332 self.accel_key = Some(accel_key); 333 self 334 } 335 accel_mode(mut self, accel_mode: CellRendererAccelMode) -> Self336 pub fn accel_mode(mut self, accel_mode: CellRendererAccelMode) -> Self { 337 self.accel_mode = Some(accel_mode); 338 self 339 } 340 accel_mods(mut self, accel_mods: gdk::ModifierType) -> Self341 pub fn accel_mods(mut self, accel_mods: gdk::ModifierType) -> Self { 342 self.accel_mods = Some(accel_mods); 343 self 344 } 345 keycode(mut self, keycode: u32) -> Self346 pub fn keycode(mut self, keycode: u32) -> Self { 347 self.keycode = Some(keycode); 348 self 349 } 350 align_set(mut self, align_set: bool) -> Self351 pub fn align_set(mut self, align_set: bool) -> Self { 352 self.align_set = Some(align_set); 353 self 354 } 355 alignment(mut self, alignment: pango::Alignment) -> Self356 pub fn alignment(mut self, alignment: pango::Alignment) -> Self { 357 self.alignment = Some(alignment); 358 self 359 } 360 attributes(mut self, attributes: &pango::AttrList) -> Self361 pub fn attributes(mut self, attributes: &pango::AttrList) -> Self { 362 self.attributes = Some(attributes.clone()); 363 self 364 } 365 background(mut self, background: &str) -> Self366 pub fn background(mut self, background: &str) -> Self { 367 self.background = Some(background.to_string()); 368 self 369 } 370 background_rgba(mut self, background_rgba: &gdk::RGBA) -> Self371 pub fn background_rgba(mut self, background_rgba: &gdk::RGBA) -> Self { 372 self.background_rgba = Some(background_rgba.clone()); 373 self 374 } 375 background_set(mut self, background_set: bool) -> Self376 pub fn background_set(mut self, background_set: bool) -> Self { 377 self.background_set = Some(background_set); 378 self 379 } 380 editable(mut self, editable: bool) -> Self381 pub fn editable(mut self, editable: bool) -> Self { 382 self.editable = Some(editable); 383 self 384 } 385 editable_set(mut self, editable_set: bool) -> Self386 pub fn editable_set(mut self, editable_set: bool) -> Self { 387 self.editable_set = Some(editable_set); 388 self 389 } 390 ellipsize(mut self, ellipsize: pango::EllipsizeMode) -> Self391 pub fn ellipsize(mut self, ellipsize: pango::EllipsizeMode) -> Self { 392 self.ellipsize = Some(ellipsize); 393 self 394 } 395 ellipsize_set(mut self, ellipsize_set: bool) -> Self396 pub fn ellipsize_set(mut self, ellipsize_set: bool) -> Self { 397 self.ellipsize_set = Some(ellipsize_set); 398 self 399 } 400 family(mut self, family: &str) -> Self401 pub fn family(mut self, family: &str) -> Self { 402 self.family = Some(family.to_string()); 403 self 404 } 405 family_set(mut self, family_set: bool) -> Self406 pub fn family_set(mut self, family_set: bool) -> Self { 407 self.family_set = Some(family_set); 408 self 409 } 410 font(mut self, font: &str) -> Self411 pub fn font(mut self, font: &str) -> Self { 412 self.font = Some(font.to_string()); 413 self 414 } 415 font_desc(mut self, font_desc: &pango::FontDescription) -> Self416 pub fn font_desc(mut self, font_desc: &pango::FontDescription) -> Self { 417 self.font_desc = Some(font_desc.clone()); 418 self 419 } 420 foreground(mut self, foreground: &str) -> Self421 pub fn foreground(mut self, foreground: &str) -> Self { 422 self.foreground = Some(foreground.to_string()); 423 self 424 } 425 foreground_rgba(mut self, foreground_rgba: &gdk::RGBA) -> Self426 pub fn foreground_rgba(mut self, foreground_rgba: &gdk::RGBA) -> Self { 427 self.foreground_rgba = Some(foreground_rgba.clone()); 428 self 429 } 430 foreground_set(mut self, foreground_set: bool) -> Self431 pub fn foreground_set(mut self, foreground_set: bool) -> Self { 432 self.foreground_set = Some(foreground_set); 433 self 434 } 435 language(mut self, language: &str) -> Self436 pub fn language(mut self, language: &str) -> Self { 437 self.language = Some(language.to_string()); 438 self 439 } 440 language_set(mut self, language_set: bool) -> Self441 pub fn language_set(mut self, language_set: bool) -> Self { 442 self.language_set = Some(language_set); 443 self 444 } 445 markup(mut self, markup: &str) -> Self446 pub fn markup(mut self, markup: &str) -> Self { 447 self.markup = Some(markup.to_string()); 448 self 449 } 450 max_width_chars(mut self, max_width_chars: i32) -> Self451 pub fn max_width_chars(mut self, max_width_chars: i32) -> Self { 452 self.max_width_chars = Some(max_width_chars); 453 self 454 } 455 placeholder_text(mut self, placeholder_text: &str) -> Self456 pub fn placeholder_text(mut self, placeholder_text: &str) -> Self { 457 self.placeholder_text = Some(placeholder_text.to_string()); 458 self 459 } 460 rise(mut self, rise: i32) -> Self461 pub fn rise(mut self, rise: i32) -> Self { 462 self.rise = Some(rise); 463 self 464 } 465 rise_set(mut self, rise_set: bool) -> Self466 pub fn rise_set(mut self, rise_set: bool) -> Self { 467 self.rise_set = Some(rise_set); 468 self 469 } 470 scale(mut self, scale: f64) -> Self471 pub fn scale(mut self, scale: f64) -> Self { 472 self.scale = Some(scale); 473 self 474 } 475 scale_set(mut self, scale_set: bool) -> Self476 pub fn scale_set(mut self, scale_set: bool) -> Self { 477 self.scale_set = Some(scale_set); 478 self 479 } 480 single_paragraph_mode(mut self, single_paragraph_mode: bool) -> Self481 pub fn single_paragraph_mode(mut self, single_paragraph_mode: bool) -> Self { 482 self.single_paragraph_mode = Some(single_paragraph_mode); 483 self 484 } 485 size(mut self, size: i32) -> Self486 pub fn size(mut self, size: i32) -> Self { 487 self.size = Some(size); 488 self 489 } 490 size_points(mut self, size_points: f64) -> Self491 pub fn size_points(mut self, size_points: f64) -> Self { 492 self.size_points = Some(size_points); 493 self 494 } 495 size_set(mut self, size_set: bool) -> Self496 pub fn size_set(mut self, size_set: bool) -> Self { 497 self.size_set = Some(size_set); 498 self 499 } 500 stretch(mut self, stretch: pango::Stretch) -> Self501 pub fn stretch(mut self, stretch: pango::Stretch) -> Self { 502 self.stretch = Some(stretch); 503 self 504 } 505 stretch_set(mut self, stretch_set: bool) -> Self506 pub fn stretch_set(mut self, stretch_set: bool) -> Self { 507 self.stretch_set = Some(stretch_set); 508 self 509 } 510 strikethrough(mut self, strikethrough: bool) -> Self511 pub fn strikethrough(mut self, strikethrough: bool) -> Self { 512 self.strikethrough = Some(strikethrough); 513 self 514 } 515 strikethrough_set(mut self, strikethrough_set: bool) -> Self516 pub fn strikethrough_set(mut self, strikethrough_set: bool) -> Self { 517 self.strikethrough_set = Some(strikethrough_set); 518 self 519 } 520 style(mut self, style: pango::Style) -> Self521 pub fn style(mut self, style: pango::Style) -> Self { 522 self.style = Some(style); 523 self 524 } 525 style_set(mut self, style_set: bool) -> Self526 pub fn style_set(mut self, style_set: bool) -> Self { 527 self.style_set = Some(style_set); 528 self 529 } 530 text(mut self, text: &str) -> Self531 pub fn text(mut self, text: &str) -> Self { 532 self.text = Some(text.to_string()); 533 self 534 } 535 underline(mut self, underline: pango::Underline) -> Self536 pub fn underline(mut self, underline: pango::Underline) -> Self { 537 self.underline = Some(underline); 538 self 539 } 540 underline_set(mut self, underline_set: bool) -> Self541 pub fn underline_set(mut self, underline_set: bool) -> Self { 542 self.underline_set = Some(underline_set); 543 self 544 } 545 variant(mut self, variant: pango::Variant) -> Self546 pub fn variant(mut self, variant: pango::Variant) -> Self { 547 self.variant = Some(variant); 548 self 549 } 550 variant_set(mut self, variant_set: bool) -> Self551 pub fn variant_set(mut self, variant_set: bool) -> Self { 552 self.variant_set = Some(variant_set); 553 self 554 } 555 weight(mut self, weight: i32) -> Self556 pub fn weight(mut self, weight: i32) -> Self { 557 self.weight = Some(weight); 558 self 559 } 560 weight_set(mut self, weight_set: bool) -> Self561 pub fn weight_set(mut self, weight_set: bool) -> Self { 562 self.weight_set = Some(weight_set); 563 self 564 } 565 width_chars(mut self, width_chars: i32) -> Self566 pub fn width_chars(mut self, width_chars: i32) -> Self { 567 self.width_chars = Some(width_chars); 568 self 569 } 570 wrap_mode(mut self, wrap_mode: pango::WrapMode) -> Self571 pub fn wrap_mode(mut self, wrap_mode: pango::WrapMode) -> Self { 572 self.wrap_mode = Some(wrap_mode); 573 self 574 } 575 wrap_width(mut self, wrap_width: i32) -> Self576 pub fn wrap_width(mut self, wrap_width: i32) -> Self { 577 self.wrap_width = Some(wrap_width); 578 self 579 } 580 cell_background(mut self, cell_background: &str) -> Self581 pub fn cell_background(mut self, cell_background: &str) -> Self { 582 self.cell_background = Some(cell_background.to_string()); 583 self 584 } 585 cell_background_rgba(mut self, cell_background_rgba: &gdk::RGBA) -> Self586 pub fn cell_background_rgba(mut self, cell_background_rgba: &gdk::RGBA) -> Self { 587 self.cell_background_rgba = Some(cell_background_rgba.clone()); 588 self 589 } 590 cell_background_set(mut self, cell_background_set: bool) -> Self591 pub fn cell_background_set(mut self, cell_background_set: bool) -> Self { 592 self.cell_background_set = Some(cell_background_set); 593 self 594 } 595 height(mut self, height: i32) -> Self596 pub fn height(mut self, height: i32) -> Self { 597 self.height = Some(height); 598 self 599 } 600 is_expanded(mut self, is_expanded: bool) -> Self601 pub fn is_expanded(mut self, is_expanded: bool) -> Self { 602 self.is_expanded = Some(is_expanded); 603 self 604 } 605 is_expander(mut self, is_expander: bool) -> Self606 pub fn is_expander(mut self, is_expander: bool) -> Self { 607 self.is_expander = Some(is_expander); 608 self 609 } 610 mode(mut self, mode: CellRendererMode) -> Self611 pub fn mode(mut self, mode: CellRendererMode) -> Self { 612 self.mode = Some(mode); 613 self 614 } 615 sensitive(mut self, sensitive: bool) -> Self616 pub fn sensitive(mut self, sensitive: bool) -> Self { 617 self.sensitive = Some(sensitive); 618 self 619 } 620 visible(mut self, visible: bool) -> Self621 pub fn visible(mut self, visible: bool) -> Self { 622 self.visible = Some(visible); 623 self 624 } 625 width(mut self, width: i32) -> Self626 pub fn width(mut self, width: i32) -> Self { 627 self.width = Some(width); 628 self 629 } 630 xalign(mut self, xalign: f32) -> Self631 pub fn xalign(mut self, xalign: f32) -> Self { 632 self.xalign = Some(xalign); 633 self 634 } 635 xpad(mut self, xpad: u32) -> Self636 pub fn xpad(mut self, xpad: u32) -> Self { 637 self.xpad = Some(xpad); 638 self 639 } 640 yalign(mut self, yalign: f32) -> Self641 pub fn yalign(mut self, yalign: f32) -> Self { 642 self.yalign = Some(yalign); 643 self 644 } 645 ypad(mut self, ypad: u32) -> Self646 pub fn ypad(mut self, ypad: u32) -> Self { 647 self.ypad = Some(ypad); 648 self 649 } 650 } 651 652 pub const NONE_CELL_RENDERER_ACCEL: Option<&CellRendererAccel> = None; 653 654 pub trait CellRendererAccelExt: 'static { 655 #[doc(alias = "accel-key")] accel_key(&self) -> u32656 fn accel_key(&self) -> u32; 657 658 #[doc(alias = "accel-key")] set_accel_key(&self, accel_key: u32)659 fn set_accel_key(&self, accel_key: u32); 660 661 #[doc(alias = "accel-mode")] accel_mode(&self) -> CellRendererAccelMode662 fn accel_mode(&self) -> CellRendererAccelMode; 663 664 #[doc(alias = "accel-mode")] set_accel_mode(&self, accel_mode: CellRendererAccelMode)665 fn set_accel_mode(&self, accel_mode: CellRendererAccelMode); 666 667 #[doc(alias = "accel-mods")] accel_mods(&self) -> gdk::ModifierType668 fn accel_mods(&self) -> gdk::ModifierType; 669 670 #[doc(alias = "accel-mods")] set_accel_mods(&self, accel_mods: gdk::ModifierType)671 fn set_accel_mods(&self, accel_mods: gdk::ModifierType); 672 keycode(&self) -> u32673 fn keycode(&self) -> u32; 674 set_keycode(&self, keycode: u32)675 fn set_keycode(&self, keycode: u32); 676 677 #[doc(alias = "accel-cleared")] connect_accel_cleared<F: Fn(&Self, TreePath) + 'static>(&self, f: F) -> SignalHandlerId678 fn connect_accel_cleared<F: Fn(&Self, TreePath) + 'static>(&self, f: F) -> SignalHandlerId; 679 680 #[doc(alias = "accel-edited")] connect_accel_edited<F: Fn(&Self, TreePath, u32, gdk::ModifierType, u32) + 'static>( &self, f: F, ) -> SignalHandlerId681 fn connect_accel_edited<F: Fn(&Self, TreePath, u32, gdk::ModifierType, u32) + 'static>( 682 &self, 683 f: F, 684 ) -> SignalHandlerId; 685 686 #[doc(alias = "accel-key")] connect_accel_key_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId687 fn connect_accel_key_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 688 689 #[doc(alias = "accel-mode")] connect_accel_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId690 fn connect_accel_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 691 692 #[doc(alias = "accel-mods")] connect_accel_mods_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId693 fn connect_accel_mods_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 694 695 #[doc(alias = "keycode")] connect_keycode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId696 fn connect_keycode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 697 } 698 699 impl<O: IsA<CellRendererAccel>> CellRendererAccelExt for O { accel_key(&self) -> u32700 fn accel_key(&self) -> u32 { 701 unsafe { 702 let mut value = glib::Value::from_type(<u32 as StaticType>::static_type()); 703 glib::gobject_ffi::g_object_get_property( 704 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 705 b"accel-key\0".as_ptr() as *const _, 706 value.to_glib_none_mut().0, 707 ); 708 value 709 .get() 710 .expect("Return Value for property `accel-key` getter") 711 } 712 } 713 set_accel_key(&self, accel_key: u32)714 fn set_accel_key(&self, accel_key: u32) { 715 unsafe { 716 glib::gobject_ffi::g_object_set_property( 717 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 718 b"accel-key\0".as_ptr() as *const _, 719 accel_key.to_value().to_glib_none().0, 720 ); 721 } 722 } 723 accel_mode(&self) -> CellRendererAccelMode724 fn accel_mode(&self) -> CellRendererAccelMode { 725 unsafe { 726 let mut value = 727 glib::Value::from_type(<CellRendererAccelMode as StaticType>::static_type()); 728 glib::gobject_ffi::g_object_get_property( 729 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 730 b"accel-mode\0".as_ptr() as *const _, 731 value.to_glib_none_mut().0, 732 ); 733 value 734 .get() 735 .expect("Return Value for property `accel-mode` getter") 736 } 737 } 738 set_accel_mode(&self, accel_mode: CellRendererAccelMode)739 fn set_accel_mode(&self, accel_mode: CellRendererAccelMode) { 740 unsafe { 741 glib::gobject_ffi::g_object_set_property( 742 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 743 b"accel-mode\0".as_ptr() as *const _, 744 accel_mode.to_value().to_glib_none().0, 745 ); 746 } 747 } 748 accel_mods(&self) -> gdk::ModifierType749 fn accel_mods(&self) -> gdk::ModifierType { 750 unsafe { 751 let mut value = 752 glib::Value::from_type(<gdk::ModifierType as StaticType>::static_type()); 753 glib::gobject_ffi::g_object_get_property( 754 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 755 b"accel-mods\0".as_ptr() as *const _, 756 value.to_glib_none_mut().0, 757 ); 758 value 759 .get() 760 .expect("Return Value for property `accel-mods` getter") 761 } 762 } 763 set_accel_mods(&self, accel_mods: gdk::ModifierType)764 fn set_accel_mods(&self, accel_mods: gdk::ModifierType) { 765 unsafe { 766 glib::gobject_ffi::g_object_set_property( 767 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 768 b"accel-mods\0".as_ptr() as *const _, 769 accel_mods.to_value().to_glib_none().0, 770 ); 771 } 772 } 773 keycode(&self) -> u32774 fn keycode(&self) -> u32 { 775 unsafe { 776 let mut value = glib::Value::from_type(<u32 as StaticType>::static_type()); 777 glib::gobject_ffi::g_object_get_property( 778 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 779 b"keycode\0".as_ptr() as *const _, 780 value.to_glib_none_mut().0, 781 ); 782 value 783 .get() 784 .expect("Return Value for property `keycode` getter") 785 } 786 } 787 set_keycode(&self, keycode: u32)788 fn set_keycode(&self, keycode: u32) { 789 unsafe { 790 glib::gobject_ffi::g_object_set_property( 791 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 792 b"keycode\0".as_ptr() as *const _, 793 keycode.to_value().to_glib_none().0, 794 ); 795 } 796 } 797 connect_accel_cleared<F: Fn(&Self, TreePath) + 'static>(&self, f: F) -> SignalHandlerId798 fn connect_accel_cleared<F: Fn(&Self, TreePath) + 'static>(&self, f: F) -> SignalHandlerId { 799 unsafe extern "C" fn accel_cleared_trampoline< 800 P: IsA<CellRendererAccel>, 801 F: Fn(&P, TreePath) + 'static, 802 >( 803 this: *mut ffi::GtkCellRendererAccel, 804 path_string: *mut libc::c_char, 805 f: glib::ffi::gpointer, 806 ) { 807 let f: &F = &*(f as *const F); 808 let path = from_glib_full(crate::ffi::gtk_tree_path_new_from_string(path_string)); 809 f( 810 CellRendererAccel::from_glib_borrow(this).unsafe_cast_ref(), 811 path, 812 ) 813 } 814 unsafe { 815 let f: Box_<F> = Box_::new(f); 816 connect_raw( 817 self.as_ptr() as *mut _, 818 b"accel-cleared\0".as_ptr() as *const _, 819 Some(transmute::<_, unsafe extern "C" fn()>( 820 accel_cleared_trampoline::<Self, F> as *const (), 821 )), 822 Box_::into_raw(f), 823 ) 824 } 825 } 826 connect_accel_edited<F: Fn(&Self, TreePath, u32, gdk::ModifierType, u32) + 'static>( &self, f: F, ) -> SignalHandlerId827 fn connect_accel_edited<F: Fn(&Self, TreePath, u32, gdk::ModifierType, u32) + 'static>( 828 &self, 829 f: F, 830 ) -> SignalHandlerId { 831 unsafe extern "C" fn accel_edited_trampoline< 832 P: IsA<CellRendererAccel>, 833 F: Fn(&P, TreePath, u32, gdk::ModifierType, u32) + 'static, 834 >( 835 this: *mut ffi::GtkCellRendererAccel, 836 path_string: *mut libc::c_char, 837 accel_key: libc::c_uint, 838 accel_mods: gdk::ffi::GdkModifierType, 839 hardware_keycode: libc::c_uint, 840 f: glib::ffi::gpointer, 841 ) { 842 let f: &F = &*(f as *const F); 843 let path = from_glib_full(crate::ffi::gtk_tree_path_new_from_string(path_string)); 844 f( 845 CellRendererAccel::from_glib_borrow(this).unsafe_cast_ref(), 846 path, 847 accel_key, 848 from_glib(accel_mods), 849 hardware_keycode, 850 ) 851 } 852 unsafe { 853 let f: Box_<F> = Box_::new(f); 854 connect_raw( 855 self.as_ptr() as *mut _, 856 b"accel-edited\0".as_ptr() as *const _, 857 Some(transmute::<_, unsafe extern "C" fn()>( 858 accel_edited_trampoline::<Self, F> as *const (), 859 )), 860 Box_::into_raw(f), 861 ) 862 } 863 } 864 connect_accel_key_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId865 fn connect_accel_key_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 866 unsafe extern "C" fn notify_accel_key_trampoline< 867 P: IsA<CellRendererAccel>, 868 F: Fn(&P) + 'static, 869 >( 870 this: *mut ffi::GtkCellRendererAccel, 871 _param_spec: glib::ffi::gpointer, 872 f: glib::ffi::gpointer, 873 ) { 874 let f: &F = &*(f as *const F); 875 f(CellRendererAccel::from_glib_borrow(this).unsafe_cast_ref()) 876 } 877 unsafe { 878 let f: Box_<F> = Box_::new(f); 879 connect_raw( 880 self.as_ptr() as *mut _, 881 b"notify::accel-key\0".as_ptr() as *const _, 882 Some(transmute::<_, unsafe extern "C" fn()>( 883 notify_accel_key_trampoline::<Self, F> as *const (), 884 )), 885 Box_::into_raw(f), 886 ) 887 } 888 } 889 connect_accel_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId890 fn connect_accel_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 891 unsafe extern "C" fn notify_accel_mode_trampoline< 892 P: IsA<CellRendererAccel>, 893 F: Fn(&P) + 'static, 894 >( 895 this: *mut ffi::GtkCellRendererAccel, 896 _param_spec: glib::ffi::gpointer, 897 f: glib::ffi::gpointer, 898 ) { 899 let f: &F = &*(f as *const F); 900 f(CellRendererAccel::from_glib_borrow(this).unsafe_cast_ref()) 901 } 902 unsafe { 903 let f: Box_<F> = Box_::new(f); 904 connect_raw( 905 self.as_ptr() as *mut _, 906 b"notify::accel-mode\0".as_ptr() as *const _, 907 Some(transmute::<_, unsafe extern "C" fn()>( 908 notify_accel_mode_trampoline::<Self, F> as *const (), 909 )), 910 Box_::into_raw(f), 911 ) 912 } 913 } 914 connect_accel_mods_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId915 fn connect_accel_mods_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 916 unsafe extern "C" fn notify_accel_mods_trampoline< 917 P: IsA<CellRendererAccel>, 918 F: Fn(&P) + 'static, 919 >( 920 this: *mut ffi::GtkCellRendererAccel, 921 _param_spec: glib::ffi::gpointer, 922 f: glib::ffi::gpointer, 923 ) { 924 let f: &F = &*(f as *const F); 925 f(CellRendererAccel::from_glib_borrow(this).unsafe_cast_ref()) 926 } 927 unsafe { 928 let f: Box_<F> = Box_::new(f); 929 connect_raw( 930 self.as_ptr() as *mut _, 931 b"notify::accel-mods\0".as_ptr() as *const _, 932 Some(transmute::<_, unsafe extern "C" fn()>( 933 notify_accel_mods_trampoline::<Self, F> as *const (), 934 )), 935 Box_::into_raw(f), 936 ) 937 } 938 } 939 connect_keycode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId940 fn connect_keycode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 941 unsafe extern "C" fn notify_keycode_trampoline< 942 P: IsA<CellRendererAccel>, 943 F: Fn(&P) + 'static, 944 >( 945 this: *mut ffi::GtkCellRendererAccel, 946 _param_spec: glib::ffi::gpointer, 947 f: glib::ffi::gpointer, 948 ) { 949 let f: &F = &*(f as *const F); 950 f(CellRendererAccel::from_glib_borrow(this).unsafe_cast_ref()) 951 } 952 unsafe { 953 let f: Box_<F> = Box_::new(f); 954 connect_raw( 955 self.as_ptr() as *mut _, 956 b"notify::keycode\0".as_ptr() as *const _, 957 Some(transmute::<_, unsafe extern "C" fn()>( 958 notify_keycode_trampoline::<Self, F> as *const (), 959 )), 960 Box_::into_raw(f), 961 ) 962 } 963 } 964 } 965 966 impl fmt::Display for CellRendererAccel { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result967 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 968 f.write_str("CellRendererAccel") 969 } 970 } 971