1 // This file was generated by gir (https://github.com/gtk-rs/gir) 2 // from gir-files (https://github.com/gtk-rs/gir-files) 3 // DO NOT EDIT 4 5 use gdk; 6 use glib::object::Cast; 7 use glib::object::IsA; 8 use glib::signal::connect_raw; 9 use glib::signal::SignalHandlerId; 10 use glib::translate::*; 11 use glib::value::SetValueOptional; 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 pango; 19 use std::boxed::Box as Box_; 20 use std::fmt; 21 use std::mem::transmute; 22 use Adjustment; 23 use CellRenderer; 24 use CellRendererMode; 25 use CellRendererText; 26 27 glib_wrapper! { 28 pub struct CellRendererSpin(Object<gtk_sys::GtkCellRendererSpin, gtk_sys::GtkCellRendererSpinClass, CellRendererSpinClass>) @extends CellRendererText, CellRenderer; 29 30 match fn { 31 get_type => || gtk_sys::gtk_cell_renderer_spin_get_type(), 32 } 33 } 34 35 impl CellRendererSpin { new() -> CellRendererSpin36 pub fn new() -> CellRendererSpin { 37 assert_initialized_main_thread!(); 38 unsafe { CellRenderer::from_glib_none(gtk_sys::gtk_cell_renderer_spin_new()).unsafe_cast() } 39 } 40 } 41 42 impl Default for CellRendererSpin { default() -> Self43 fn default() -> Self { 44 Self::new() 45 } 46 } 47 48 #[derive(Clone, Default)] 49 pub struct CellRendererSpinBuilder { 50 adjustment: Option<Adjustment>, 51 climb_rate: Option<f64>, 52 digits: Option<u32>, 53 align_set: Option<bool>, 54 alignment: Option<pango::Alignment>, 55 attributes: Option<pango::AttrList>, 56 background: Option<String>, 57 background_rgba: Option<gdk::RGBA>, 58 background_set: Option<bool>, 59 editable: Option<bool>, 60 editable_set: Option<bool>, 61 ellipsize: Option<pango::EllipsizeMode>, 62 ellipsize_set: Option<bool>, 63 family: Option<String>, 64 family_set: Option<bool>, 65 font: Option<String>, 66 font_desc: Option<pango::FontDescription>, 67 foreground: Option<String>, 68 foreground_rgba: Option<gdk::RGBA>, 69 foreground_set: Option<bool>, 70 language: Option<String>, 71 language_set: Option<bool>, 72 markup: Option<String>, 73 max_width_chars: Option<i32>, 74 placeholder_text: Option<String>, 75 rise: Option<i32>, 76 rise_set: Option<bool>, 77 scale: Option<f64>, 78 scale_set: Option<bool>, 79 single_paragraph_mode: Option<bool>, 80 size: Option<i32>, 81 size_points: Option<f64>, 82 size_set: Option<bool>, 83 stretch: Option<pango::Stretch>, 84 stretch_set: Option<bool>, 85 strikethrough: Option<bool>, 86 strikethrough_set: Option<bool>, 87 style: Option<pango::Style>, 88 style_set: Option<bool>, 89 text: Option<String>, 90 underline: Option<pango::Underline>, 91 underline_set: Option<bool>, 92 variant: Option<pango::Variant>, 93 variant_set: Option<bool>, 94 weight: Option<i32>, 95 weight_set: Option<bool>, 96 width_chars: Option<i32>, 97 wrap_mode: Option<pango::WrapMode>, 98 wrap_width: Option<i32>, 99 cell_background: Option<String>, 100 cell_background_rgba: Option<gdk::RGBA>, 101 cell_background_set: Option<bool>, 102 height: Option<i32>, 103 is_expanded: Option<bool>, 104 is_expander: Option<bool>, 105 mode: Option<CellRendererMode>, 106 sensitive: Option<bool>, 107 visible: Option<bool>, 108 width: Option<i32>, 109 xalign: Option<f32>, 110 xpad: Option<u32>, 111 yalign: Option<f32>, 112 ypad: Option<u32>, 113 } 114 115 impl CellRendererSpinBuilder { new() -> Self116 pub fn new() -> Self { 117 Self::default() 118 } 119 build(self) -> CellRendererSpin120 pub fn build(self) -> CellRendererSpin { 121 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 122 if let Some(ref adjustment) = self.adjustment { 123 properties.push(("adjustment", adjustment)); 124 } 125 if let Some(ref climb_rate) = self.climb_rate { 126 properties.push(("climb-rate", climb_rate)); 127 } 128 if let Some(ref digits) = self.digits { 129 properties.push(("digits", digits)); 130 } 131 if let Some(ref align_set) = self.align_set { 132 properties.push(("align-set", align_set)); 133 } 134 if let Some(ref alignment) = self.alignment { 135 properties.push(("alignment", alignment)); 136 } 137 if let Some(ref attributes) = self.attributes { 138 properties.push(("attributes", attributes)); 139 } 140 if let Some(ref background) = self.background { 141 properties.push(("background", background)); 142 } 143 if let Some(ref background_rgba) = self.background_rgba { 144 properties.push(("background-rgba", background_rgba)); 145 } 146 if let Some(ref background_set) = self.background_set { 147 properties.push(("background-set", background_set)); 148 } 149 if let Some(ref editable) = self.editable { 150 properties.push(("editable", editable)); 151 } 152 if let Some(ref editable_set) = self.editable_set { 153 properties.push(("editable-set", editable_set)); 154 } 155 if let Some(ref ellipsize) = self.ellipsize { 156 properties.push(("ellipsize", ellipsize)); 157 } 158 if let Some(ref ellipsize_set) = self.ellipsize_set { 159 properties.push(("ellipsize-set", ellipsize_set)); 160 } 161 if let Some(ref family) = self.family { 162 properties.push(("family", family)); 163 } 164 if let Some(ref family_set) = self.family_set { 165 properties.push(("family-set", family_set)); 166 } 167 if let Some(ref font) = self.font { 168 properties.push(("font", font)); 169 } 170 if let Some(ref font_desc) = self.font_desc { 171 properties.push(("font-desc", font_desc)); 172 } 173 if let Some(ref foreground) = self.foreground { 174 properties.push(("foreground", foreground)); 175 } 176 if let Some(ref foreground_rgba) = self.foreground_rgba { 177 properties.push(("foreground-rgba", foreground_rgba)); 178 } 179 if let Some(ref foreground_set) = self.foreground_set { 180 properties.push(("foreground-set", foreground_set)); 181 } 182 if let Some(ref language) = self.language { 183 properties.push(("language", language)); 184 } 185 if let Some(ref language_set) = self.language_set { 186 properties.push(("language-set", language_set)); 187 } 188 if let Some(ref markup) = self.markup { 189 properties.push(("markup", markup)); 190 } 191 if let Some(ref max_width_chars) = self.max_width_chars { 192 properties.push(("max-width-chars", max_width_chars)); 193 } 194 if let Some(ref placeholder_text) = self.placeholder_text { 195 properties.push(("placeholder-text", placeholder_text)); 196 } 197 if let Some(ref rise) = self.rise { 198 properties.push(("rise", rise)); 199 } 200 if let Some(ref rise_set) = self.rise_set { 201 properties.push(("rise-set", rise_set)); 202 } 203 if let Some(ref scale) = self.scale { 204 properties.push(("scale", scale)); 205 } 206 if let Some(ref scale_set) = self.scale_set { 207 properties.push(("scale-set", scale_set)); 208 } 209 if let Some(ref single_paragraph_mode) = self.single_paragraph_mode { 210 properties.push(("single-paragraph-mode", single_paragraph_mode)); 211 } 212 if let Some(ref size) = self.size { 213 properties.push(("size", size)); 214 } 215 if let Some(ref size_points) = self.size_points { 216 properties.push(("size-points", size_points)); 217 } 218 if let Some(ref size_set) = self.size_set { 219 properties.push(("size-set", size_set)); 220 } 221 if let Some(ref stretch) = self.stretch { 222 properties.push(("stretch", stretch)); 223 } 224 if let Some(ref stretch_set) = self.stretch_set { 225 properties.push(("stretch-set", stretch_set)); 226 } 227 if let Some(ref strikethrough) = self.strikethrough { 228 properties.push(("strikethrough", strikethrough)); 229 } 230 if let Some(ref strikethrough_set) = self.strikethrough_set { 231 properties.push(("strikethrough-set", strikethrough_set)); 232 } 233 if let Some(ref style) = self.style { 234 properties.push(("style", style)); 235 } 236 if let Some(ref style_set) = self.style_set { 237 properties.push(("style-set", style_set)); 238 } 239 if let Some(ref text) = self.text { 240 properties.push(("text", text)); 241 } 242 if let Some(ref underline) = self.underline { 243 properties.push(("underline", underline)); 244 } 245 if let Some(ref underline_set) = self.underline_set { 246 properties.push(("underline-set", underline_set)); 247 } 248 if let Some(ref variant) = self.variant { 249 properties.push(("variant", variant)); 250 } 251 if let Some(ref variant_set) = self.variant_set { 252 properties.push(("variant-set", variant_set)); 253 } 254 if let Some(ref weight) = self.weight { 255 properties.push(("weight", weight)); 256 } 257 if let Some(ref weight_set) = self.weight_set { 258 properties.push(("weight-set", weight_set)); 259 } 260 if let Some(ref width_chars) = self.width_chars { 261 properties.push(("width-chars", width_chars)); 262 } 263 if let Some(ref wrap_mode) = self.wrap_mode { 264 properties.push(("wrap-mode", wrap_mode)); 265 } 266 if let Some(ref wrap_width) = self.wrap_width { 267 properties.push(("wrap-width", wrap_width)); 268 } 269 if let Some(ref cell_background) = self.cell_background { 270 properties.push(("cell-background", cell_background)); 271 } 272 if let Some(ref cell_background_rgba) = self.cell_background_rgba { 273 properties.push(("cell-background-rgba", cell_background_rgba)); 274 } 275 if let Some(ref cell_background_set) = self.cell_background_set { 276 properties.push(("cell-background-set", cell_background_set)); 277 } 278 if let Some(ref height) = self.height { 279 properties.push(("height", height)); 280 } 281 if let Some(ref is_expanded) = self.is_expanded { 282 properties.push(("is-expanded", is_expanded)); 283 } 284 if let Some(ref is_expander) = self.is_expander { 285 properties.push(("is-expander", is_expander)); 286 } 287 if let Some(ref mode) = self.mode { 288 properties.push(("mode", mode)); 289 } 290 if let Some(ref sensitive) = self.sensitive { 291 properties.push(("sensitive", sensitive)); 292 } 293 if let Some(ref visible) = self.visible { 294 properties.push(("visible", visible)); 295 } 296 if let Some(ref width) = self.width { 297 properties.push(("width", width)); 298 } 299 if let Some(ref xalign) = self.xalign { 300 properties.push(("xalign", xalign)); 301 } 302 if let Some(ref xpad) = self.xpad { 303 properties.push(("xpad", xpad)); 304 } 305 if let Some(ref yalign) = self.yalign { 306 properties.push(("yalign", yalign)); 307 } 308 if let Some(ref ypad) = self.ypad { 309 properties.push(("ypad", ypad)); 310 } 311 glib::Object::new(CellRendererSpin::static_type(), &properties) 312 .expect("object new") 313 .downcast() 314 .expect("downcast") 315 } 316 adjustment<P: IsA<Adjustment>>(mut self, adjustment: &P) -> Self317 pub fn adjustment<P: IsA<Adjustment>>(mut self, adjustment: &P) -> Self { 318 self.adjustment = Some(adjustment.clone().upcast()); 319 self 320 } 321 climb_rate(mut self, climb_rate: f64) -> Self322 pub fn climb_rate(mut self, climb_rate: f64) -> Self { 323 self.climb_rate = Some(climb_rate); 324 self 325 } 326 digits(mut self, digits: u32) -> Self327 pub fn digits(mut self, digits: u32) -> Self { 328 self.digits = Some(digits); 329 self 330 } 331 align_set(mut self, align_set: bool) -> Self332 pub fn align_set(mut self, align_set: bool) -> Self { 333 self.align_set = Some(align_set); 334 self 335 } 336 alignment(mut self, alignment: pango::Alignment) -> Self337 pub fn alignment(mut self, alignment: pango::Alignment) -> Self { 338 self.alignment = Some(alignment); 339 self 340 } 341 attributes(mut self, attributes: &pango::AttrList) -> Self342 pub fn attributes(mut self, attributes: &pango::AttrList) -> Self { 343 self.attributes = Some(attributes.clone()); 344 self 345 } 346 background(mut self, background: &str) -> Self347 pub fn background(mut self, background: &str) -> Self { 348 self.background = Some(background.to_string()); 349 self 350 } 351 background_rgba(mut self, background_rgba: &gdk::RGBA) -> Self352 pub fn background_rgba(mut self, background_rgba: &gdk::RGBA) -> Self { 353 self.background_rgba = Some(background_rgba.clone()); 354 self 355 } 356 background_set(mut self, background_set: bool) -> Self357 pub fn background_set(mut self, background_set: bool) -> Self { 358 self.background_set = Some(background_set); 359 self 360 } 361 editable(mut self, editable: bool) -> Self362 pub fn editable(mut self, editable: bool) -> Self { 363 self.editable = Some(editable); 364 self 365 } 366 editable_set(mut self, editable_set: bool) -> Self367 pub fn editable_set(mut self, editable_set: bool) -> Self { 368 self.editable_set = Some(editable_set); 369 self 370 } 371 ellipsize(mut self, ellipsize: pango::EllipsizeMode) -> Self372 pub fn ellipsize(mut self, ellipsize: pango::EllipsizeMode) -> Self { 373 self.ellipsize = Some(ellipsize); 374 self 375 } 376 ellipsize_set(mut self, ellipsize_set: bool) -> Self377 pub fn ellipsize_set(mut self, ellipsize_set: bool) -> Self { 378 self.ellipsize_set = Some(ellipsize_set); 379 self 380 } 381 family(mut self, family: &str) -> Self382 pub fn family(mut self, family: &str) -> Self { 383 self.family = Some(family.to_string()); 384 self 385 } 386 family_set(mut self, family_set: bool) -> Self387 pub fn family_set(mut self, family_set: bool) -> Self { 388 self.family_set = Some(family_set); 389 self 390 } 391 font(mut self, font: &str) -> Self392 pub fn font(mut self, font: &str) -> Self { 393 self.font = Some(font.to_string()); 394 self 395 } 396 font_desc(mut self, font_desc: &pango::FontDescription) -> Self397 pub fn font_desc(mut self, font_desc: &pango::FontDescription) -> Self { 398 self.font_desc = Some(font_desc.clone()); 399 self 400 } 401 foreground(mut self, foreground: &str) -> Self402 pub fn foreground(mut self, foreground: &str) -> Self { 403 self.foreground = Some(foreground.to_string()); 404 self 405 } 406 foreground_rgba(mut self, foreground_rgba: &gdk::RGBA) -> Self407 pub fn foreground_rgba(mut self, foreground_rgba: &gdk::RGBA) -> Self { 408 self.foreground_rgba = Some(foreground_rgba.clone()); 409 self 410 } 411 foreground_set(mut self, foreground_set: bool) -> Self412 pub fn foreground_set(mut self, foreground_set: bool) -> Self { 413 self.foreground_set = Some(foreground_set); 414 self 415 } 416 language(mut self, language: &str) -> Self417 pub fn language(mut self, language: &str) -> Self { 418 self.language = Some(language.to_string()); 419 self 420 } 421 language_set(mut self, language_set: bool) -> Self422 pub fn language_set(mut self, language_set: bool) -> Self { 423 self.language_set = Some(language_set); 424 self 425 } 426 markup(mut self, markup: &str) -> Self427 pub fn markup(mut self, markup: &str) -> Self { 428 self.markup = Some(markup.to_string()); 429 self 430 } 431 max_width_chars(mut self, max_width_chars: i32) -> Self432 pub fn max_width_chars(mut self, max_width_chars: i32) -> Self { 433 self.max_width_chars = Some(max_width_chars); 434 self 435 } 436 placeholder_text(mut self, placeholder_text: &str) -> Self437 pub fn placeholder_text(mut self, placeholder_text: &str) -> Self { 438 self.placeholder_text = Some(placeholder_text.to_string()); 439 self 440 } 441 rise(mut self, rise: i32) -> Self442 pub fn rise(mut self, rise: i32) -> Self { 443 self.rise = Some(rise); 444 self 445 } 446 rise_set(mut self, rise_set: bool) -> Self447 pub fn rise_set(mut self, rise_set: bool) -> Self { 448 self.rise_set = Some(rise_set); 449 self 450 } 451 scale(mut self, scale: f64) -> Self452 pub fn scale(mut self, scale: f64) -> Self { 453 self.scale = Some(scale); 454 self 455 } 456 scale_set(mut self, scale_set: bool) -> Self457 pub fn scale_set(mut self, scale_set: bool) -> Self { 458 self.scale_set = Some(scale_set); 459 self 460 } 461 single_paragraph_mode(mut self, single_paragraph_mode: bool) -> Self462 pub fn single_paragraph_mode(mut self, single_paragraph_mode: bool) -> Self { 463 self.single_paragraph_mode = Some(single_paragraph_mode); 464 self 465 } 466 size(mut self, size: i32) -> Self467 pub fn size(mut self, size: i32) -> Self { 468 self.size = Some(size); 469 self 470 } 471 size_points(mut self, size_points: f64) -> Self472 pub fn size_points(mut self, size_points: f64) -> Self { 473 self.size_points = Some(size_points); 474 self 475 } 476 size_set(mut self, size_set: bool) -> Self477 pub fn size_set(mut self, size_set: bool) -> Self { 478 self.size_set = Some(size_set); 479 self 480 } 481 stretch(mut self, stretch: pango::Stretch) -> Self482 pub fn stretch(mut self, stretch: pango::Stretch) -> Self { 483 self.stretch = Some(stretch); 484 self 485 } 486 stretch_set(mut self, stretch_set: bool) -> Self487 pub fn stretch_set(mut self, stretch_set: bool) -> Self { 488 self.stretch_set = Some(stretch_set); 489 self 490 } 491 strikethrough(mut self, strikethrough: bool) -> Self492 pub fn strikethrough(mut self, strikethrough: bool) -> Self { 493 self.strikethrough = Some(strikethrough); 494 self 495 } 496 strikethrough_set(mut self, strikethrough_set: bool) -> Self497 pub fn strikethrough_set(mut self, strikethrough_set: bool) -> Self { 498 self.strikethrough_set = Some(strikethrough_set); 499 self 500 } 501 style(mut self, style: pango::Style) -> Self502 pub fn style(mut self, style: pango::Style) -> Self { 503 self.style = Some(style); 504 self 505 } 506 style_set(mut self, style_set: bool) -> Self507 pub fn style_set(mut self, style_set: bool) -> Self { 508 self.style_set = Some(style_set); 509 self 510 } 511 text(mut self, text: &str) -> Self512 pub fn text(mut self, text: &str) -> Self { 513 self.text = Some(text.to_string()); 514 self 515 } 516 underline(mut self, underline: pango::Underline) -> Self517 pub fn underline(mut self, underline: pango::Underline) -> Self { 518 self.underline = Some(underline); 519 self 520 } 521 underline_set(mut self, underline_set: bool) -> Self522 pub fn underline_set(mut self, underline_set: bool) -> Self { 523 self.underline_set = Some(underline_set); 524 self 525 } 526 variant(mut self, variant: pango::Variant) -> Self527 pub fn variant(mut self, variant: pango::Variant) -> Self { 528 self.variant = Some(variant); 529 self 530 } 531 variant_set(mut self, variant_set: bool) -> Self532 pub fn variant_set(mut self, variant_set: bool) -> Self { 533 self.variant_set = Some(variant_set); 534 self 535 } 536 weight(mut self, weight: i32) -> Self537 pub fn weight(mut self, weight: i32) -> Self { 538 self.weight = Some(weight); 539 self 540 } 541 weight_set(mut self, weight_set: bool) -> Self542 pub fn weight_set(mut self, weight_set: bool) -> Self { 543 self.weight_set = Some(weight_set); 544 self 545 } 546 width_chars(mut self, width_chars: i32) -> Self547 pub fn width_chars(mut self, width_chars: i32) -> Self { 548 self.width_chars = Some(width_chars); 549 self 550 } 551 wrap_mode(mut self, wrap_mode: pango::WrapMode) -> Self552 pub fn wrap_mode(mut self, wrap_mode: pango::WrapMode) -> Self { 553 self.wrap_mode = Some(wrap_mode); 554 self 555 } 556 wrap_width(mut self, wrap_width: i32) -> Self557 pub fn wrap_width(mut self, wrap_width: i32) -> Self { 558 self.wrap_width = Some(wrap_width); 559 self 560 } 561 cell_background(mut self, cell_background: &str) -> Self562 pub fn cell_background(mut self, cell_background: &str) -> Self { 563 self.cell_background = Some(cell_background.to_string()); 564 self 565 } 566 cell_background_rgba(mut self, cell_background_rgba: &gdk::RGBA) -> Self567 pub fn cell_background_rgba(mut self, cell_background_rgba: &gdk::RGBA) -> Self { 568 self.cell_background_rgba = Some(cell_background_rgba.clone()); 569 self 570 } 571 cell_background_set(mut self, cell_background_set: bool) -> Self572 pub fn cell_background_set(mut self, cell_background_set: bool) -> Self { 573 self.cell_background_set = Some(cell_background_set); 574 self 575 } 576 height(mut self, height: i32) -> Self577 pub fn height(mut self, height: i32) -> Self { 578 self.height = Some(height); 579 self 580 } 581 is_expanded(mut self, is_expanded: bool) -> Self582 pub fn is_expanded(mut self, is_expanded: bool) -> Self { 583 self.is_expanded = Some(is_expanded); 584 self 585 } 586 is_expander(mut self, is_expander: bool) -> Self587 pub fn is_expander(mut self, is_expander: bool) -> Self { 588 self.is_expander = Some(is_expander); 589 self 590 } 591 mode(mut self, mode: CellRendererMode) -> Self592 pub fn mode(mut self, mode: CellRendererMode) -> Self { 593 self.mode = Some(mode); 594 self 595 } 596 sensitive(mut self, sensitive: bool) -> Self597 pub fn sensitive(mut self, sensitive: bool) -> Self { 598 self.sensitive = Some(sensitive); 599 self 600 } 601 visible(mut self, visible: bool) -> Self602 pub fn visible(mut self, visible: bool) -> Self { 603 self.visible = Some(visible); 604 self 605 } 606 width(mut self, width: i32) -> Self607 pub fn width(mut self, width: i32) -> Self { 608 self.width = Some(width); 609 self 610 } 611 xalign(mut self, xalign: f32) -> Self612 pub fn xalign(mut self, xalign: f32) -> Self { 613 self.xalign = Some(xalign); 614 self 615 } 616 xpad(mut self, xpad: u32) -> Self617 pub fn xpad(mut self, xpad: u32) -> Self { 618 self.xpad = Some(xpad); 619 self 620 } 621 yalign(mut self, yalign: f32) -> Self622 pub fn yalign(mut self, yalign: f32) -> Self { 623 self.yalign = Some(yalign); 624 self 625 } 626 ypad(mut self, ypad: u32) -> Self627 pub fn ypad(mut self, ypad: u32) -> Self { 628 self.ypad = Some(ypad); 629 self 630 } 631 } 632 633 pub const NONE_CELL_RENDERER_SPIN: Option<&CellRendererSpin> = None; 634 635 pub trait CellRendererSpinExt: 'static { get_property_adjustment(&self) -> Option<Adjustment>636 fn get_property_adjustment(&self) -> Option<Adjustment>; 637 set_property_adjustment<P: IsA<Adjustment> + SetValueOptional>( &self, adjustment: Option<&P>, )638 fn set_property_adjustment<P: IsA<Adjustment> + SetValueOptional>( 639 &self, 640 adjustment: Option<&P>, 641 ); 642 get_property_climb_rate(&self) -> f64643 fn get_property_climb_rate(&self) -> f64; 644 set_property_climb_rate(&self, climb_rate: f64)645 fn set_property_climb_rate(&self, climb_rate: f64); 646 get_property_digits(&self) -> u32647 fn get_property_digits(&self) -> u32; 648 set_property_digits(&self, digits: u32)649 fn set_property_digits(&self, digits: u32); 650 connect_property_adjustment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId651 fn connect_property_adjustment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 652 connect_property_climb_rate_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId653 fn connect_property_climb_rate_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 654 connect_property_digits_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId655 fn connect_property_digits_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 656 } 657 658 impl<O: IsA<CellRendererSpin>> CellRendererSpinExt for O { get_property_adjustment(&self) -> Option<Adjustment>659 fn get_property_adjustment(&self) -> Option<Adjustment> { 660 unsafe { 661 let mut value = Value::from_type(<Adjustment as StaticType>::static_type()); 662 gobject_sys::g_object_get_property( 663 self.to_glib_none().0 as *mut gobject_sys::GObject, 664 b"adjustment\0".as_ptr() as *const _, 665 value.to_glib_none_mut().0, 666 ); 667 value 668 .get() 669 .expect("Return Value for property `adjustment` getter") 670 } 671 } 672 set_property_adjustment<P: IsA<Adjustment> + SetValueOptional>( &self, adjustment: Option<&P>, )673 fn set_property_adjustment<P: IsA<Adjustment> + SetValueOptional>( 674 &self, 675 adjustment: Option<&P>, 676 ) { 677 unsafe { 678 gobject_sys::g_object_set_property( 679 self.to_glib_none().0 as *mut gobject_sys::GObject, 680 b"adjustment\0".as_ptr() as *const _, 681 Value::from(adjustment).to_glib_none().0, 682 ); 683 } 684 } 685 get_property_climb_rate(&self) -> f64686 fn get_property_climb_rate(&self) -> f64 { 687 unsafe { 688 let mut value = Value::from_type(<f64 as StaticType>::static_type()); 689 gobject_sys::g_object_get_property( 690 self.to_glib_none().0 as *mut gobject_sys::GObject, 691 b"climb-rate\0".as_ptr() as *const _, 692 value.to_glib_none_mut().0, 693 ); 694 value 695 .get() 696 .expect("Return Value for property `climb-rate` getter") 697 .unwrap() 698 } 699 } 700 set_property_climb_rate(&self, climb_rate: f64)701 fn set_property_climb_rate(&self, climb_rate: f64) { 702 unsafe { 703 gobject_sys::g_object_set_property( 704 self.to_glib_none().0 as *mut gobject_sys::GObject, 705 b"climb-rate\0".as_ptr() as *const _, 706 Value::from(&climb_rate).to_glib_none().0, 707 ); 708 } 709 } 710 get_property_digits(&self) -> u32711 fn get_property_digits(&self) -> u32 { 712 unsafe { 713 let mut value = Value::from_type(<u32 as StaticType>::static_type()); 714 gobject_sys::g_object_get_property( 715 self.to_glib_none().0 as *mut gobject_sys::GObject, 716 b"digits\0".as_ptr() as *const _, 717 value.to_glib_none_mut().0, 718 ); 719 value 720 .get() 721 .expect("Return Value for property `digits` getter") 722 .unwrap() 723 } 724 } 725 set_property_digits(&self, digits: u32)726 fn set_property_digits(&self, digits: u32) { 727 unsafe { 728 gobject_sys::g_object_set_property( 729 self.to_glib_none().0 as *mut gobject_sys::GObject, 730 b"digits\0".as_ptr() as *const _, 731 Value::from(&digits).to_glib_none().0, 732 ); 733 } 734 } 735 connect_property_adjustment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId736 fn connect_property_adjustment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 737 unsafe extern "C" fn notify_adjustment_trampoline<P, F: Fn(&P) + 'static>( 738 this: *mut gtk_sys::GtkCellRendererSpin, 739 _param_spec: glib_sys::gpointer, 740 f: glib_sys::gpointer, 741 ) where 742 P: IsA<CellRendererSpin>, 743 { 744 let f: &F = &*(f as *const F); 745 f(&CellRendererSpin::from_glib_borrow(this).unsafe_cast()) 746 } 747 unsafe { 748 let f: Box_<F> = Box_::new(f); 749 connect_raw( 750 self.as_ptr() as *mut _, 751 b"notify::adjustment\0".as_ptr() as *const _, 752 Some(transmute(notify_adjustment_trampoline::<Self, F> as usize)), 753 Box_::into_raw(f), 754 ) 755 } 756 } 757 connect_property_climb_rate_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId758 fn connect_property_climb_rate_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 759 unsafe extern "C" fn notify_climb_rate_trampoline<P, F: Fn(&P) + 'static>( 760 this: *mut gtk_sys::GtkCellRendererSpin, 761 _param_spec: glib_sys::gpointer, 762 f: glib_sys::gpointer, 763 ) where 764 P: IsA<CellRendererSpin>, 765 { 766 let f: &F = &*(f as *const F); 767 f(&CellRendererSpin::from_glib_borrow(this).unsafe_cast()) 768 } 769 unsafe { 770 let f: Box_<F> = Box_::new(f); 771 connect_raw( 772 self.as_ptr() as *mut _, 773 b"notify::climb-rate\0".as_ptr() as *const _, 774 Some(transmute(notify_climb_rate_trampoline::<Self, F> as usize)), 775 Box_::into_raw(f), 776 ) 777 } 778 } 779 connect_property_digits_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId780 fn connect_property_digits_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 781 unsafe extern "C" fn notify_digits_trampoline<P, F: Fn(&P) + 'static>( 782 this: *mut gtk_sys::GtkCellRendererSpin, 783 _param_spec: glib_sys::gpointer, 784 f: glib_sys::gpointer, 785 ) where 786 P: IsA<CellRendererSpin>, 787 { 788 let f: &F = &*(f as *const F); 789 f(&CellRendererSpin::from_glib_borrow(this).unsafe_cast()) 790 } 791 unsafe { 792 let f: Box_<F> = Box_::new(f); 793 connect_raw( 794 self.as_ptr() as *mut _, 795 b"notify::digits\0".as_ptr() as *const _, 796 Some(transmute(notify_digits_trampoline::<Self, F> as usize)), 797 Box_::into_raw(f), 798 ) 799 } 800 } 801 } 802 803 impl fmt::Display for CellRendererSpin { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result804 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 805 write!(f, "CellRendererSpin") 806 } 807 } 808