gtk/auto/
cell_renderer_spin.rs

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