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 gdk_sys; 7 use glib::object::Cast; 8 use glib::object::IsA; 9 use glib::signal::connect_raw; 10 use glib::signal::SignalHandlerId; 11 use glib::translate::*; 12 use glib::StaticType; 13 use glib::ToValue; 14 use glib::Value; 15 use glib_sys; 16 use gobject_sys; 17 use gtk_sys; 18 use libc; 19 use pango; 20 use std::boxed::Box as Box_; 21 use std::fmt; 22 use std::mem::transmute; 23 use CellRenderer; 24 use CellRendererAccelMode; 25 use CellRendererMode; 26 use CellRendererText; 27 use TreePath; 28 29 glib_wrapper! { 30 pub struct CellRendererAccel(Object<gtk_sys::GtkCellRendererAccel, gtk_sys::GtkCellRendererAccelClass, CellRendererAccelClass>) @extends CellRendererText, CellRenderer; 31 32 match fn { 33 get_type => || gtk_sys::gtk_cell_renderer_accel_get_type(), 34 } 35 } 36 37 impl CellRendererAccel { new() -> CellRendererAccel38 pub fn new() -> CellRendererAccel { 39 assert_initialized_main_thread!(); 40 unsafe { 41 CellRenderer::from_glib_none(gtk_sys::gtk_cell_renderer_accel_new()).unsafe_cast() 42 } 43 } 44 } 45 46 impl Default for CellRendererAccel { default() -> Self47 fn default() -> Self { 48 Self::new() 49 } 50 } 51 52 pub struct CellRendererAccelBuilder { 53 accel_key: Option<u32>, 54 accel_mode: Option<CellRendererAccelMode>, 55 accel_mods: Option<gdk::ModifierType>, 56 keycode: Option<u32>, 57 align_set: Option<bool>, 58 alignment: Option<pango::Alignment>, 59 attributes: Option<pango::AttrList>, 60 background: Option<String>, 61 background_rgba: Option<gdk::RGBA>, 62 background_set: Option<bool>, 63 editable: Option<bool>, 64 editable_set: Option<bool>, 65 ellipsize: Option<pango::EllipsizeMode>, 66 ellipsize_set: Option<bool>, 67 family: Option<String>, 68 family_set: Option<bool>, 69 font: Option<String>, 70 font_desc: Option<pango::FontDescription>, 71 foreground: Option<String>, 72 foreground_rgba: Option<gdk::RGBA>, 73 foreground_set: Option<bool>, 74 language: Option<String>, 75 language_set: Option<bool>, 76 markup: Option<String>, 77 max_width_chars: Option<i32>, 78 placeholder_text: Option<String>, 79 rise: Option<i32>, 80 rise_set: Option<bool>, 81 scale: Option<f64>, 82 scale_set: Option<bool>, 83 single_paragraph_mode: Option<bool>, 84 size: Option<i32>, 85 size_points: Option<f64>, 86 size_set: Option<bool>, 87 stretch: Option<pango::Stretch>, 88 stretch_set: Option<bool>, 89 strikethrough: Option<bool>, 90 strikethrough_set: Option<bool>, 91 style: Option<pango::Style>, 92 style_set: Option<bool>, 93 text: Option<String>, 94 underline: Option<pango::Underline>, 95 underline_set: Option<bool>, 96 variant: Option<pango::Variant>, 97 variant_set: Option<bool>, 98 weight: Option<i32>, 99 weight_set: Option<bool>, 100 width_chars: Option<i32>, 101 wrap_mode: Option<pango::WrapMode>, 102 wrap_width: Option<i32>, 103 cell_background: Option<String>, 104 cell_background_rgba: Option<gdk::RGBA>, 105 cell_background_set: Option<bool>, 106 height: Option<i32>, 107 is_expanded: Option<bool>, 108 is_expander: Option<bool>, 109 mode: Option<CellRendererMode>, 110 sensitive: Option<bool>, 111 visible: Option<bool>, 112 width: Option<i32>, 113 xalign: Option<f32>, 114 xpad: Option<u32>, 115 yalign: Option<f32>, 116 ypad: Option<u32>, 117 } 118 119 impl CellRendererAccelBuilder { new() -> Self120 pub fn new() -> Self { 121 Self { 122 accel_key: None, 123 accel_mode: None, 124 accel_mods: None, 125 keycode: None, 126 align_set: None, 127 alignment: None, 128 attributes: None, 129 background: None, 130 background_rgba: None, 131 background_set: None, 132 editable: None, 133 editable_set: None, 134 ellipsize: None, 135 ellipsize_set: None, 136 family: None, 137 family_set: None, 138 font: None, 139 font_desc: None, 140 foreground: None, 141 foreground_rgba: None, 142 foreground_set: None, 143 language: None, 144 language_set: None, 145 markup: None, 146 max_width_chars: None, 147 placeholder_text: None, 148 rise: None, 149 rise_set: None, 150 scale: None, 151 scale_set: None, 152 single_paragraph_mode: None, 153 size: None, 154 size_points: None, 155 size_set: None, 156 stretch: None, 157 stretch_set: None, 158 strikethrough: None, 159 strikethrough_set: None, 160 style: None, 161 style_set: None, 162 text: None, 163 underline: None, 164 underline_set: None, 165 variant: None, 166 variant_set: None, 167 weight: None, 168 weight_set: None, 169 width_chars: None, 170 wrap_mode: None, 171 wrap_width: None, 172 cell_background: None, 173 cell_background_rgba: None, 174 cell_background_set: None, 175 height: None, 176 is_expanded: None, 177 is_expander: None, 178 mode: None, 179 sensitive: None, 180 visible: None, 181 width: None, 182 xalign: None, 183 xpad: None, 184 yalign: None, 185 ypad: None, 186 } 187 } 188 build(self) -> CellRendererAccel189 pub fn build(self) -> CellRendererAccel { 190 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 191 if let Some(ref accel_key) = self.accel_key { 192 properties.push(("accel-key", accel_key)); 193 } 194 if let Some(ref accel_mode) = self.accel_mode { 195 properties.push(("accel-mode", accel_mode)); 196 } 197 if let Some(ref accel_mods) = self.accel_mods { 198 properties.push(("accel-mods", accel_mods)); 199 } 200 if let Some(ref keycode) = self.keycode { 201 properties.push(("keycode", keycode)); 202 } 203 if let Some(ref align_set) = self.align_set { 204 properties.push(("align-set", align_set)); 205 } 206 if let Some(ref alignment) = self.alignment { 207 properties.push(("alignment", alignment)); 208 } 209 if let Some(ref attributes) = self.attributes { 210 properties.push(("attributes", attributes)); 211 } 212 if let Some(ref background) = self.background { 213 properties.push(("background", background)); 214 } 215 if let Some(ref background_rgba) = self.background_rgba { 216 properties.push(("background-rgba", background_rgba)); 217 } 218 if let Some(ref background_set) = self.background_set { 219 properties.push(("background-set", background_set)); 220 } 221 if let Some(ref editable) = self.editable { 222 properties.push(("editable", editable)); 223 } 224 if let Some(ref editable_set) = self.editable_set { 225 properties.push(("editable-set", editable_set)); 226 } 227 if let Some(ref ellipsize) = self.ellipsize { 228 properties.push(("ellipsize", ellipsize)); 229 } 230 if let Some(ref ellipsize_set) = self.ellipsize_set { 231 properties.push(("ellipsize-set", ellipsize_set)); 232 } 233 if let Some(ref family) = self.family { 234 properties.push(("family", family)); 235 } 236 if let Some(ref family_set) = self.family_set { 237 properties.push(("family-set", family_set)); 238 } 239 if let Some(ref font) = self.font { 240 properties.push(("font", font)); 241 } 242 if let Some(ref font_desc) = self.font_desc { 243 properties.push(("font-desc", font_desc)); 244 } 245 if let Some(ref foreground) = self.foreground { 246 properties.push(("foreground", foreground)); 247 } 248 if let Some(ref foreground_rgba) = self.foreground_rgba { 249 properties.push(("foreground-rgba", foreground_rgba)); 250 } 251 if let Some(ref foreground_set) = self.foreground_set { 252 properties.push(("foreground-set", foreground_set)); 253 } 254 if let Some(ref language) = self.language { 255 properties.push(("language", language)); 256 } 257 if let Some(ref language_set) = self.language_set { 258 properties.push(("language-set", language_set)); 259 } 260 if let Some(ref markup) = self.markup { 261 properties.push(("markup", markup)); 262 } 263 if let Some(ref max_width_chars) = self.max_width_chars { 264 properties.push(("max-width-chars", max_width_chars)); 265 } 266 if let Some(ref placeholder_text) = self.placeholder_text { 267 properties.push(("placeholder-text", placeholder_text)); 268 } 269 if let Some(ref rise) = self.rise { 270 properties.push(("rise", rise)); 271 } 272 if let Some(ref rise_set) = self.rise_set { 273 properties.push(("rise-set", rise_set)); 274 } 275 if let Some(ref scale) = self.scale { 276 properties.push(("scale", scale)); 277 } 278 if let Some(ref scale_set) = self.scale_set { 279 properties.push(("scale-set", scale_set)); 280 } 281 if let Some(ref single_paragraph_mode) = self.single_paragraph_mode { 282 properties.push(("single-paragraph-mode", single_paragraph_mode)); 283 } 284 if let Some(ref size) = self.size { 285 properties.push(("size", size)); 286 } 287 if let Some(ref size_points) = self.size_points { 288 properties.push(("size-points", size_points)); 289 } 290 if let Some(ref size_set) = self.size_set { 291 properties.push(("size-set", size_set)); 292 } 293 if let Some(ref stretch) = self.stretch { 294 properties.push(("stretch", stretch)); 295 } 296 if let Some(ref stretch_set) = self.stretch_set { 297 properties.push(("stretch-set", stretch_set)); 298 } 299 if let Some(ref strikethrough) = self.strikethrough { 300 properties.push(("strikethrough", strikethrough)); 301 } 302 if let Some(ref strikethrough_set) = self.strikethrough_set { 303 properties.push(("strikethrough-set", strikethrough_set)); 304 } 305 if let Some(ref style) = self.style { 306 properties.push(("style", style)); 307 } 308 if let Some(ref style_set) = self.style_set { 309 properties.push(("style-set", style_set)); 310 } 311 if let Some(ref text) = self.text { 312 properties.push(("text", text)); 313 } 314 if let Some(ref underline) = self.underline { 315 properties.push(("underline", underline)); 316 } 317 if let Some(ref underline_set) = self.underline_set { 318 properties.push(("underline-set", underline_set)); 319 } 320 if let Some(ref variant) = self.variant { 321 properties.push(("variant", variant)); 322 } 323 if let Some(ref variant_set) = self.variant_set { 324 properties.push(("variant-set", variant_set)); 325 } 326 if let Some(ref weight) = self.weight { 327 properties.push(("weight", weight)); 328 } 329 if let Some(ref weight_set) = self.weight_set { 330 properties.push(("weight-set", weight_set)); 331 } 332 if let Some(ref width_chars) = self.width_chars { 333 properties.push(("width-chars", width_chars)); 334 } 335 if let Some(ref wrap_mode) = self.wrap_mode { 336 properties.push(("wrap-mode", wrap_mode)); 337 } 338 if let Some(ref wrap_width) = self.wrap_width { 339 properties.push(("wrap-width", wrap_width)); 340 } 341 if let Some(ref cell_background) = self.cell_background { 342 properties.push(("cell-background", cell_background)); 343 } 344 if let Some(ref cell_background_rgba) = self.cell_background_rgba { 345 properties.push(("cell-background-rgba", cell_background_rgba)); 346 } 347 if let Some(ref cell_background_set) = self.cell_background_set { 348 properties.push(("cell-background-set", cell_background_set)); 349 } 350 if let Some(ref height) = self.height { 351 properties.push(("height", height)); 352 } 353 if let Some(ref is_expanded) = self.is_expanded { 354 properties.push(("is-expanded", is_expanded)); 355 } 356 if let Some(ref is_expander) = self.is_expander { 357 properties.push(("is-expander", is_expander)); 358 } 359 if let Some(ref mode) = self.mode { 360 properties.push(("mode", mode)); 361 } 362 if let Some(ref sensitive) = self.sensitive { 363 properties.push(("sensitive", sensitive)); 364 } 365 if let Some(ref visible) = self.visible { 366 properties.push(("visible", visible)); 367 } 368 if let Some(ref width) = self.width { 369 properties.push(("width", width)); 370 } 371 if let Some(ref xalign) = self.xalign { 372 properties.push(("xalign", xalign)); 373 } 374 if let Some(ref xpad) = self.xpad { 375 properties.push(("xpad", xpad)); 376 } 377 if let Some(ref yalign) = self.yalign { 378 properties.push(("yalign", yalign)); 379 } 380 if let Some(ref ypad) = self.ypad { 381 properties.push(("ypad", ypad)); 382 } 383 glib::Object::new(CellRendererAccel::static_type(), &properties) 384 .expect("object new") 385 .downcast() 386 .expect("downcast") 387 } 388 accel_key(mut self, accel_key: u32) -> Self389 pub fn accel_key(mut self, accel_key: u32) -> Self { 390 self.accel_key = Some(accel_key); 391 self 392 } 393 accel_mode(mut self, accel_mode: CellRendererAccelMode) -> Self394 pub fn accel_mode(mut self, accel_mode: CellRendererAccelMode) -> Self { 395 self.accel_mode = Some(accel_mode); 396 self 397 } 398 accel_mods(mut self, accel_mods: gdk::ModifierType) -> Self399 pub fn accel_mods(mut self, accel_mods: gdk::ModifierType) -> Self { 400 self.accel_mods = Some(accel_mods); 401 self 402 } 403 keycode(mut self, keycode: u32) -> Self404 pub fn keycode(mut self, keycode: u32) -> Self { 405 self.keycode = Some(keycode); 406 self 407 } 408 align_set(mut self, align_set: bool) -> Self409 pub fn align_set(mut self, align_set: bool) -> Self { 410 self.align_set = Some(align_set); 411 self 412 } 413 alignment(mut self, alignment: pango::Alignment) -> Self414 pub fn alignment(mut self, alignment: pango::Alignment) -> Self { 415 self.alignment = Some(alignment); 416 self 417 } 418 attributes(mut self, attributes: &pango::AttrList) -> Self419 pub fn attributes(mut self, attributes: &pango::AttrList) -> Self { 420 self.attributes = Some(attributes.clone()); 421 self 422 } 423 background(mut self, background: &str) -> Self424 pub fn background(mut self, background: &str) -> Self { 425 self.background = Some(background.to_string()); 426 self 427 } 428 background_rgba(mut self, background_rgba: &gdk::RGBA) -> Self429 pub fn background_rgba(mut self, background_rgba: &gdk::RGBA) -> Self { 430 self.background_rgba = Some(background_rgba.clone()); 431 self 432 } 433 background_set(mut self, background_set: bool) -> Self434 pub fn background_set(mut self, background_set: bool) -> Self { 435 self.background_set = Some(background_set); 436 self 437 } 438 editable(mut self, editable: bool) -> Self439 pub fn editable(mut self, editable: bool) -> Self { 440 self.editable = Some(editable); 441 self 442 } 443 editable_set(mut self, editable_set: bool) -> Self444 pub fn editable_set(mut self, editable_set: bool) -> Self { 445 self.editable_set = Some(editable_set); 446 self 447 } 448 ellipsize(mut self, ellipsize: pango::EllipsizeMode) -> Self449 pub fn ellipsize(mut self, ellipsize: pango::EllipsizeMode) -> Self { 450 self.ellipsize = Some(ellipsize); 451 self 452 } 453 ellipsize_set(mut self, ellipsize_set: bool) -> Self454 pub fn ellipsize_set(mut self, ellipsize_set: bool) -> Self { 455 self.ellipsize_set = Some(ellipsize_set); 456 self 457 } 458 family(mut self, family: &str) -> Self459 pub fn family(mut self, family: &str) -> Self { 460 self.family = Some(family.to_string()); 461 self 462 } 463 family_set(mut self, family_set: bool) -> Self464 pub fn family_set(mut self, family_set: bool) -> Self { 465 self.family_set = Some(family_set); 466 self 467 } 468 font(mut self, font: &str) -> Self469 pub fn font(mut self, font: &str) -> Self { 470 self.font = Some(font.to_string()); 471 self 472 } 473 font_desc(mut self, font_desc: &pango::FontDescription) -> Self474 pub fn font_desc(mut self, font_desc: &pango::FontDescription) -> Self { 475 self.font_desc = Some(font_desc.clone()); 476 self 477 } 478 foreground(mut self, foreground: &str) -> Self479 pub fn foreground(mut self, foreground: &str) -> Self { 480 self.foreground = Some(foreground.to_string()); 481 self 482 } 483 foreground_rgba(mut self, foreground_rgba: &gdk::RGBA) -> Self484 pub fn foreground_rgba(mut self, foreground_rgba: &gdk::RGBA) -> Self { 485 self.foreground_rgba = Some(foreground_rgba.clone()); 486 self 487 } 488 foreground_set(mut self, foreground_set: bool) -> Self489 pub fn foreground_set(mut self, foreground_set: bool) -> Self { 490 self.foreground_set = Some(foreground_set); 491 self 492 } 493 language(mut self, language: &str) -> Self494 pub fn language(mut self, language: &str) -> Self { 495 self.language = Some(language.to_string()); 496 self 497 } 498 language_set(mut self, language_set: bool) -> Self499 pub fn language_set(mut self, language_set: bool) -> Self { 500 self.language_set = Some(language_set); 501 self 502 } 503 markup(mut self, markup: &str) -> Self504 pub fn markup(mut self, markup: &str) -> Self { 505 self.markup = Some(markup.to_string()); 506 self 507 } 508 max_width_chars(mut self, max_width_chars: i32) -> Self509 pub fn max_width_chars(mut self, max_width_chars: i32) -> Self { 510 self.max_width_chars = Some(max_width_chars); 511 self 512 } 513 placeholder_text(mut self, placeholder_text: &str) -> Self514 pub fn placeholder_text(mut self, placeholder_text: &str) -> Self { 515 self.placeholder_text = Some(placeholder_text.to_string()); 516 self 517 } 518 rise(mut self, rise: i32) -> Self519 pub fn rise(mut self, rise: i32) -> Self { 520 self.rise = Some(rise); 521 self 522 } 523 rise_set(mut self, rise_set: bool) -> Self524 pub fn rise_set(mut self, rise_set: bool) -> Self { 525 self.rise_set = Some(rise_set); 526 self 527 } 528 scale(mut self, scale: f64) -> Self529 pub fn scale(mut self, scale: f64) -> Self { 530 self.scale = Some(scale); 531 self 532 } 533 scale_set(mut self, scale_set: bool) -> Self534 pub fn scale_set(mut self, scale_set: bool) -> Self { 535 self.scale_set = Some(scale_set); 536 self 537 } 538 single_paragraph_mode(mut self, single_paragraph_mode: bool) -> Self539 pub fn single_paragraph_mode(mut self, single_paragraph_mode: bool) -> Self { 540 self.single_paragraph_mode = Some(single_paragraph_mode); 541 self 542 } 543 size(mut self, size: i32) -> Self544 pub fn size(mut self, size: i32) -> Self { 545 self.size = Some(size); 546 self 547 } 548 size_points(mut self, size_points: f64) -> Self549 pub fn size_points(mut self, size_points: f64) -> Self { 550 self.size_points = Some(size_points); 551 self 552 } 553 size_set(mut self, size_set: bool) -> Self554 pub fn size_set(mut self, size_set: bool) -> Self { 555 self.size_set = Some(size_set); 556 self 557 } 558 stretch(mut self, stretch: pango::Stretch) -> Self559 pub fn stretch(mut self, stretch: pango::Stretch) -> Self { 560 self.stretch = Some(stretch); 561 self 562 } 563 stretch_set(mut self, stretch_set: bool) -> Self564 pub fn stretch_set(mut self, stretch_set: bool) -> Self { 565 self.stretch_set = Some(stretch_set); 566 self 567 } 568 strikethrough(mut self, strikethrough: bool) -> Self569 pub fn strikethrough(mut self, strikethrough: bool) -> Self { 570 self.strikethrough = Some(strikethrough); 571 self 572 } 573 strikethrough_set(mut self, strikethrough_set: bool) -> Self574 pub fn strikethrough_set(mut self, strikethrough_set: bool) -> Self { 575 self.strikethrough_set = Some(strikethrough_set); 576 self 577 } 578 style(mut self, style: pango::Style) -> Self579 pub fn style(mut self, style: pango::Style) -> Self { 580 self.style = Some(style); 581 self 582 } 583 style_set(mut self, style_set: bool) -> Self584 pub fn style_set(mut self, style_set: bool) -> Self { 585 self.style_set = Some(style_set); 586 self 587 } 588 text(mut self, text: &str) -> Self589 pub fn text(mut self, text: &str) -> Self { 590 self.text = Some(text.to_string()); 591 self 592 } 593 underline(mut self, underline: pango::Underline) -> Self594 pub fn underline(mut self, underline: pango::Underline) -> Self { 595 self.underline = Some(underline); 596 self 597 } 598 underline_set(mut self, underline_set: bool) -> Self599 pub fn underline_set(mut self, underline_set: bool) -> Self { 600 self.underline_set = Some(underline_set); 601 self 602 } 603 variant(mut self, variant: pango::Variant) -> Self604 pub fn variant(mut self, variant: pango::Variant) -> Self { 605 self.variant = Some(variant); 606 self 607 } 608 variant_set(mut self, variant_set: bool) -> Self609 pub fn variant_set(mut self, variant_set: bool) -> Self { 610 self.variant_set = Some(variant_set); 611 self 612 } 613 weight(mut self, weight: i32) -> Self614 pub fn weight(mut self, weight: i32) -> Self { 615 self.weight = Some(weight); 616 self 617 } 618 weight_set(mut self, weight_set: bool) -> Self619 pub fn weight_set(mut self, weight_set: bool) -> Self { 620 self.weight_set = Some(weight_set); 621 self 622 } 623 width_chars(mut self, width_chars: i32) -> Self624 pub fn width_chars(mut self, width_chars: i32) -> Self { 625 self.width_chars = Some(width_chars); 626 self 627 } 628 wrap_mode(mut self, wrap_mode: pango::WrapMode) -> Self629 pub fn wrap_mode(mut self, wrap_mode: pango::WrapMode) -> Self { 630 self.wrap_mode = Some(wrap_mode); 631 self 632 } 633 wrap_width(mut self, wrap_width: i32) -> Self634 pub fn wrap_width(mut self, wrap_width: i32) -> Self { 635 self.wrap_width = Some(wrap_width); 636 self 637 } 638 cell_background(mut self, cell_background: &str) -> Self639 pub fn cell_background(mut self, cell_background: &str) -> Self { 640 self.cell_background = Some(cell_background.to_string()); 641 self 642 } 643 cell_background_rgba(mut self, cell_background_rgba: &gdk::RGBA) -> Self644 pub fn cell_background_rgba(mut self, cell_background_rgba: &gdk::RGBA) -> Self { 645 self.cell_background_rgba = Some(cell_background_rgba.clone()); 646 self 647 } 648 cell_background_set(mut self, cell_background_set: bool) -> Self649 pub fn cell_background_set(mut self, cell_background_set: bool) -> Self { 650 self.cell_background_set = Some(cell_background_set); 651 self 652 } 653 height(mut self, height: i32) -> Self654 pub fn height(mut self, height: i32) -> Self { 655 self.height = Some(height); 656 self 657 } 658 is_expanded(mut self, is_expanded: bool) -> Self659 pub fn is_expanded(mut self, is_expanded: bool) -> Self { 660 self.is_expanded = Some(is_expanded); 661 self 662 } 663 is_expander(mut self, is_expander: bool) -> Self664 pub fn is_expander(mut self, is_expander: bool) -> Self { 665 self.is_expander = Some(is_expander); 666 self 667 } 668 mode(mut self, mode: CellRendererMode) -> Self669 pub fn mode(mut self, mode: CellRendererMode) -> Self { 670 self.mode = Some(mode); 671 self 672 } 673 sensitive(mut self, sensitive: bool) -> Self674 pub fn sensitive(mut self, sensitive: bool) -> Self { 675 self.sensitive = Some(sensitive); 676 self 677 } 678 visible(mut self, visible: bool) -> Self679 pub fn visible(mut self, visible: bool) -> Self { 680 self.visible = Some(visible); 681 self 682 } 683 width(mut self, width: i32) -> Self684 pub fn width(mut self, width: i32) -> Self { 685 self.width = Some(width); 686 self 687 } 688 xalign(mut self, xalign: f32) -> Self689 pub fn xalign(mut self, xalign: f32) -> Self { 690 self.xalign = Some(xalign); 691 self 692 } 693 xpad(mut self, xpad: u32) -> Self694 pub fn xpad(mut self, xpad: u32) -> Self { 695 self.xpad = Some(xpad); 696 self 697 } 698 yalign(mut self, yalign: f32) -> Self699 pub fn yalign(mut self, yalign: f32) -> Self { 700 self.yalign = Some(yalign); 701 self 702 } 703 ypad(mut self, ypad: u32) -> Self704 pub fn ypad(mut self, ypad: u32) -> Self { 705 self.ypad = Some(ypad); 706 self 707 } 708 } 709 710 pub const NONE_CELL_RENDERER_ACCEL: Option<&CellRendererAccel> = None; 711 712 pub trait CellRendererAccelExt: 'static { get_property_accel_key(&self) -> u32713 fn get_property_accel_key(&self) -> u32; 714 set_property_accel_key(&self, accel_key: u32)715 fn set_property_accel_key(&self, accel_key: u32); 716 get_property_accel_mode(&self) -> CellRendererAccelMode717 fn get_property_accel_mode(&self) -> CellRendererAccelMode; 718 set_property_accel_mode(&self, accel_mode: CellRendererAccelMode)719 fn set_property_accel_mode(&self, accel_mode: CellRendererAccelMode); 720 get_property_accel_mods(&self) -> gdk::ModifierType721 fn get_property_accel_mods(&self) -> gdk::ModifierType; 722 set_property_accel_mods(&self, accel_mods: gdk::ModifierType)723 fn set_property_accel_mods(&self, accel_mods: gdk::ModifierType); 724 get_property_keycode(&self) -> u32725 fn get_property_keycode(&self) -> u32; 726 set_property_keycode(&self, keycode: u32)727 fn set_property_keycode(&self, keycode: u32); 728 connect_accel_cleared<F: Fn(&Self, TreePath) + 'static>(&self, f: F) -> SignalHandlerId729 fn connect_accel_cleared<F: Fn(&Self, TreePath) + 'static>(&self, f: F) -> SignalHandlerId; 730 connect_accel_edited<F: Fn(&Self, TreePath, u32, gdk::ModifierType, u32) + 'static>( &self, f: F, ) -> SignalHandlerId731 fn connect_accel_edited<F: Fn(&Self, TreePath, u32, gdk::ModifierType, u32) + 'static>( 732 &self, 733 f: F, 734 ) -> SignalHandlerId; 735 connect_property_accel_key_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId736 fn connect_property_accel_key_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 737 connect_property_accel_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId738 fn connect_property_accel_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 739 connect_property_accel_mods_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId740 fn connect_property_accel_mods_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 741 connect_property_keycode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId742 fn connect_property_keycode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 743 } 744 745 impl<O: IsA<CellRendererAccel>> CellRendererAccelExt for O { get_property_accel_key(&self) -> u32746 fn get_property_accel_key(&self) -> u32 { 747 unsafe { 748 let mut value = Value::from_type(<u32 as StaticType>::static_type()); 749 gobject_sys::g_object_get_property( 750 self.to_glib_none().0 as *mut gobject_sys::GObject, 751 b"accel-key\0".as_ptr() as *const _, 752 value.to_glib_none_mut().0, 753 ); 754 value.get().unwrap() 755 } 756 } 757 set_property_accel_key(&self, accel_key: u32)758 fn set_property_accel_key(&self, accel_key: u32) { 759 unsafe { 760 gobject_sys::g_object_set_property( 761 self.to_glib_none().0 as *mut gobject_sys::GObject, 762 b"accel-key\0".as_ptr() as *const _, 763 Value::from(&accel_key).to_glib_none().0, 764 ); 765 } 766 } 767 get_property_accel_mode(&self) -> CellRendererAccelMode768 fn get_property_accel_mode(&self) -> CellRendererAccelMode { 769 unsafe { 770 let mut value = Value::from_type(<CellRendererAccelMode as StaticType>::static_type()); 771 gobject_sys::g_object_get_property( 772 self.to_glib_none().0 as *mut gobject_sys::GObject, 773 b"accel-mode\0".as_ptr() as *const _, 774 value.to_glib_none_mut().0, 775 ); 776 value.get().unwrap() 777 } 778 } 779 set_property_accel_mode(&self, accel_mode: CellRendererAccelMode)780 fn set_property_accel_mode(&self, accel_mode: CellRendererAccelMode) { 781 unsafe { 782 gobject_sys::g_object_set_property( 783 self.to_glib_none().0 as *mut gobject_sys::GObject, 784 b"accel-mode\0".as_ptr() as *const _, 785 Value::from(&accel_mode).to_glib_none().0, 786 ); 787 } 788 } 789 get_property_accel_mods(&self) -> gdk::ModifierType790 fn get_property_accel_mods(&self) -> gdk::ModifierType { 791 unsafe { 792 let mut value = Value::from_type(<gdk::ModifierType as StaticType>::static_type()); 793 gobject_sys::g_object_get_property( 794 self.to_glib_none().0 as *mut gobject_sys::GObject, 795 b"accel-mods\0".as_ptr() as *const _, 796 value.to_glib_none_mut().0, 797 ); 798 value.get().unwrap() 799 } 800 } 801 set_property_accel_mods(&self, accel_mods: gdk::ModifierType)802 fn set_property_accel_mods(&self, accel_mods: gdk::ModifierType) { 803 unsafe { 804 gobject_sys::g_object_set_property( 805 self.to_glib_none().0 as *mut gobject_sys::GObject, 806 b"accel-mods\0".as_ptr() as *const _, 807 Value::from(&accel_mods).to_glib_none().0, 808 ); 809 } 810 } 811 get_property_keycode(&self) -> u32812 fn get_property_keycode(&self) -> u32 { 813 unsafe { 814 let mut value = Value::from_type(<u32 as StaticType>::static_type()); 815 gobject_sys::g_object_get_property( 816 self.to_glib_none().0 as *mut gobject_sys::GObject, 817 b"keycode\0".as_ptr() as *const _, 818 value.to_glib_none_mut().0, 819 ); 820 value.get().unwrap() 821 } 822 } 823 set_property_keycode(&self, keycode: u32)824 fn set_property_keycode(&self, keycode: u32) { 825 unsafe { 826 gobject_sys::g_object_set_property( 827 self.to_glib_none().0 as *mut gobject_sys::GObject, 828 b"keycode\0".as_ptr() as *const _, 829 Value::from(&keycode).to_glib_none().0, 830 ); 831 } 832 } 833 connect_accel_cleared<F: Fn(&Self, TreePath) + 'static>(&self, f: F) -> SignalHandlerId834 fn connect_accel_cleared<F: Fn(&Self, TreePath) + 'static>(&self, f: F) -> SignalHandlerId { 835 unsafe extern "C" fn accel_cleared_trampoline<P, F: Fn(&P, TreePath) + 'static>( 836 this: *mut gtk_sys::GtkCellRendererAccel, 837 path_string: *mut libc::c_char, 838 f: glib_sys::gpointer, 839 ) where 840 P: IsA<CellRendererAccel>, 841 { 842 let f: &F = &*(f as *const F); 843 let path = from_glib_full(gtk_sys::gtk_tree_path_new_from_string(path_string)); 844 f( 845 &CellRendererAccel::from_glib_borrow(this).unsafe_cast(), 846 path, 847 ) 848 } 849 unsafe { 850 let f: Box_<F> = Box_::new(f); 851 connect_raw( 852 self.as_ptr() as *mut _, 853 b"accel-cleared\0".as_ptr() as *const _, 854 Some(transmute(accel_cleared_trampoline::<Self, F> as usize)), 855 Box_::into_raw(f), 856 ) 857 } 858 } 859 connect_accel_edited<F: Fn(&Self, TreePath, u32, gdk::ModifierType, u32) + 'static>( &self, f: F, ) -> SignalHandlerId860 fn connect_accel_edited<F: Fn(&Self, TreePath, u32, gdk::ModifierType, u32) + 'static>( 861 &self, 862 f: F, 863 ) -> SignalHandlerId { 864 unsafe extern "C" fn accel_edited_trampoline< 865 P, 866 F: Fn(&P, TreePath, u32, gdk::ModifierType, u32) + 'static, 867 >( 868 this: *mut gtk_sys::GtkCellRendererAccel, 869 path_string: *mut libc::c_char, 870 accel_key: libc::c_uint, 871 accel_mods: gdk_sys::GdkModifierType, 872 hardware_keycode: libc::c_uint, 873 f: glib_sys::gpointer, 874 ) where 875 P: IsA<CellRendererAccel>, 876 { 877 let f: &F = &*(f as *const F); 878 let path = from_glib_full(gtk_sys::gtk_tree_path_new_from_string(path_string)); 879 f( 880 &CellRendererAccel::from_glib_borrow(this).unsafe_cast(), 881 path, 882 accel_key, 883 from_glib(accel_mods), 884 hardware_keycode, 885 ) 886 } 887 unsafe { 888 let f: Box_<F> = Box_::new(f); 889 connect_raw( 890 self.as_ptr() as *mut _, 891 b"accel-edited\0".as_ptr() as *const _, 892 Some(transmute(accel_edited_trampoline::<Self, F> as usize)), 893 Box_::into_raw(f), 894 ) 895 } 896 } 897 connect_property_accel_key_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId898 fn connect_property_accel_key_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 899 unsafe extern "C" fn notify_accel_key_trampoline<P, F: Fn(&P) + 'static>( 900 this: *mut gtk_sys::GtkCellRendererAccel, 901 _param_spec: glib_sys::gpointer, 902 f: glib_sys::gpointer, 903 ) where 904 P: IsA<CellRendererAccel>, 905 { 906 let f: &F = &*(f as *const F); 907 f(&CellRendererAccel::from_glib_borrow(this).unsafe_cast()) 908 } 909 unsafe { 910 let f: Box_<F> = Box_::new(f); 911 connect_raw( 912 self.as_ptr() as *mut _, 913 b"notify::accel-key\0".as_ptr() as *const _, 914 Some(transmute(notify_accel_key_trampoline::<Self, F> as usize)), 915 Box_::into_raw(f), 916 ) 917 } 918 } 919 connect_property_accel_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId920 fn connect_property_accel_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 921 unsafe extern "C" fn notify_accel_mode_trampoline<P, F: Fn(&P) + 'static>( 922 this: *mut gtk_sys::GtkCellRendererAccel, 923 _param_spec: glib_sys::gpointer, 924 f: glib_sys::gpointer, 925 ) where 926 P: IsA<CellRendererAccel>, 927 { 928 let f: &F = &*(f as *const F); 929 f(&CellRendererAccel::from_glib_borrow(this).unsafe_cast()) 930 } 931 unsafe { 932 let f: Box_<F> = Box_::new(f); 933 connect_raw( 934 self.as_ptr() as *mut _, 935 b"notify::accel-mode\0".as_ptr() as *const _, 936 Some(transmute(notify_accel_mode_trampoline::<Self, F> as usize)), 937 Box_::into_raw(f), 938 ) 939 } 940 } 941 connect_property_accel_mods_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId942 fn connect_property_accel_mods_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 943 unsafe extern "C" fn notify_accel_mods_trampoline<P, F: Fn(&P) + 'static>( 944 this: *mut gtk_sys::GtkCellRendererAccel, 945 _param_spec: glib_sys::gpointer, 946 f: glib_sys::gpointer, 947 ) where 948 P: IsA<CellRendererAccel>, 949 { 950 let f: &F = &*(f as *const F); 951 f(&CellRendererAccel::from_glib_borrow(this).unsafe_cast()) 952 } 953 unsafe { 954 let f: Box_<F> = Box_::new(f); 955 connect_raw( 956 self.as_ptr() as *mut _, 957 b"notify::accel-mods\0".as_ptr() as *const _, 958 Some(transmute(notify_accel_mods_trampoline::<Self, F> as usize)), 959 Box_::into_raw(f), 960 ) 961 } 962 } 963 connect_property_keycode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId964 fn connect_property_keycode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 965 unsafe extern "C" fn notify_keycode_trampoline<P, F: Fn(&P) + 'static>( 966 this: *mut gtk_sys::GtkCellRendererAccel, 967 _param_spec: glib_sys::gpointer, 968 f: glib_sys::gpointer, 969 ) where 970 P: IsA<CellRendererAccel>, 971 { 972 let f: &F = &*(f as *const F); 973 f(&CellRendererAccel::from_glib_borrow(this).unsafe_cast()) 974 } 975 unsafe { 976 let f: Box_<F> = Box_::new(f); 977 connect_raw( 978 self.as_ptr() as *mut _, 979 b"notify::keycode\0".as_ptr() as *const _, 980 Some(transmute(notify_keycode_trampoline::<Self, F> as usize)), 981 Box_::into_raw(f), 982 ) 983 } 984 } 985 } 986 987 impl fmt::Display for CellRendererAccel { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result988 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 989 write!(f, "CellRendererAccel") 990 } 991 } 992