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::CellRendererMode;
7 use crate::Orientable;
8 use crate::Orientation;
9 use glib::object::Cast;
10 use glib::object::IsA;
11 use glib::signal::connect_raw;
12 use glib::signal::SignalHandlerId;
13 use glib::translate::*;
14 use glib::StaticType;
15 use glib::ToValue;
16 use std::boxed::Box as Box_;
17 use std::fmt;
18 use std::mem::transmute;
19 
20 glib::wrapper! {
21     #[doc(alias = "GtkCellRendererProgress")]
22     pub struct CellRendererProgress(Object<ffi::GtkCellRendererProgress, ffi::GtkCellRendererProgressClass>) @extends CellRenderer, @implements Orientable;
23 
24     match fn {
25         type_ => || ffi::gtk_cell_renderer_progress_get_type(),
26     }
27 }
28 
29 impl CellRendererProgress {
30     #[doc(alias = "gtk_cell_renderer_progress_new")]
new() -> CellRendererProgress31     pub fn new() -> CellRendererProgress {
32         assert_initialized_main_thread!();
33         unsafe { CellRenderer::from_glib_none(ffi::gtk_cell_renderer_progress_new()).unsafe_cast() }
34     }
35 
36     // rustdoc-stripper-ignore-next
37     /// Creates a new builder-pattern struct instance to construct [`CellRendererProgress`] objects.
38     ///
39     /// This method returns an instance of [`CellRendererProgressBuilder`] which can be used to create [`CellRendererProgress`] objects.
builder() -> CellRendererProgressBuilder40     pub fn builder() -> CellRendererProgressBuilder {
41         CellRendererProgressBuilder::default()
42     }
43 }
44 
45 impl Default for CellRendererProgress {
default() -> Self46     fn default() -> Self {
47         Self::new()
48     }
49 }
50 
51 #[derive(Clone, Default)]
52 // rustdoc-stripper-ignore-next
53 /// A [builder-pattern] type to construct [`CellRendererProgress`] objects.
54 ///
55 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
56 pub struct CellRendererProgressBuilder {
57     inverted: Option<bool>,
58     pulse: Option<i32>,
59     text: Option<String>,
60     text_xalign: Option<f32>,
61     text_yalign: Option<f32>,
62     value: Option<i32>,
63     cell_background: Option<String>,
64     cell_background_rgba: Option<gdk::RGBA>,
65     cell_background_set: Option<bool>,
66     height: Option<i32>,
67     is_expanded: Option<bool>,
68     is_expander: Option<bool>,
69     mode: Option<CellRendererMode>,
70     sensitive: Option<bool>,
71     visible: Option<bool>,
72     width: Option<i32>,
73     xalign: Option<f32>,
74     xpad: Option<u32>,
75     yalign: Option<f32>,
76     ypad: Option<u32>,
77     orientation: Option<Orientation>,
78 }
79 
80 impl CellRendererProgressBuilder {
81     // rustdoc-stripper-ignore-next
82     /// Create a new [`CellRendererProgressBuilder`].
new() -> Self83     pub fn new() -> Self {
84         Self::default()
85     }
86 
87     // rustdoc-stripper-ignore-next
88     /// Build the [`CellRendererProgress`].
build(self) -> CellRendererProgress89     pub fn build(self) -> CellRendererProgress {
90         let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
91         if let Some(ref inverted) = self.inverted {
92             properties.push(("inverted", inverted));
93         }
94         if let Some(ref pulse) = self.pulse {
95             properties.push(("pulse", pulse));
96         }
97         if let Some(ref text) = self.text {
98             properties.push(("text", text));
99         }
100         if let Some(ref text_xalign) = self.text_xalign {
101             properties.push(("text-xalign", text_xalign));
102         }
103         if let Some(ref text_yalign) = self.text_yalign {
104             properties.push(("text-yalign", text_yalign));
105         }
106         if let Some(ref value) = self.value {
107             properties.push(("value", value));
108         }
109         if let Some(ref cell_background) = self.cell_background {
110             properties.push(("cell-background", cell_background));
111         }
112         if let Some(ref cell_background_rgba) = self.cell_background_rgba {
113             properties.push(("cell-background-rgba", cell_background_rgba));
114         }
115         if let Some(ref cell_background_set) = self.cell_background_set {
116             properties.push(("cell-background-set", cell_background_set));
117         }
118         if let Some(ref height) = self.height {
119             properties.push(("height", height));
120         }
121         if let Some(ref is_expanded) = self.is_expanded {
122             properties.push(("is-expanded", is_expanded));
123         }
124         if let Some(ref is_expander) = self.is_expander {
125             properties.push(("is-expander", is_expander));
126         }
127         if let Some(ref mode) = self.mode {
128             properties.push(("mode", mode));
129         }
130         if let Some(ref sensitive) = self.sensitive {
131             properties.push(("sensitive", sensitive));
132         }
133         if let Some(ref visible) = self.visible {
134             properties.push(("visible", visible));
135         }
136         if let Some(ref width) = self.width {
137             properties.push(("width", width));
138         }
139         if let Some(ref xalign) = self.xalign {
140             properties.push(("xalign", xalign));
141         }
142         if let Some(ref xpad) = self.xpad {
143             properties.push(("xpad", xpad));
144         }
145         if let Some(ref yalign) = self.yalign {
146             properties.push(("yalign", yalign));
147         }
148         if let Some(ref ypad) = self.ypad {
149             properties.push(("ypad", ypad));
150         }
151         if let Some(ref orientation) = self.orientation {
152             properties.push(("orientation", orientation));
153         }
154         glib::Object::new::<CellRendererProgress>(&properties)
155             .expect("Failed to create an instance of CellRendererProgress")
156     }
157 
inverted(mut self, inverted: bool) -> Self158     pub fn inverted(mut self, inverted: bool) -> Self {
159         self.inverted = Some(inverted);
160         self
161     }
162 
pulse(mut self, pulse: i32) -> Self163     pub fn pulse(mut self, pulse: i32) -> Self {
164         self.pulse = Some(pulse);
165         self
166     }
167 
text(mut self, text: &str) -> Self168     pub fn text(mut self, text: &str) -> Self {
169         self.text = Some(text.to_string());
170         self
171     }
172 
text_xalign(mut self, text_xalign: f32) -> Self173     pub fn text_xalign(mut self, text_xalign: f32) -> Self {
174         self.text_xalign = Some(text_xalign);
175         self
176     }
177 
text_yalign(mut self, text_yalign: f32) -> Self178     pub fn text_yalign(mut self, text_yalign: f32) -> Self {
179         self.text_yalign = Some(text_yalign);
180         self
181     }
182 
value(mut self, value: i32) -> Self183     pub fn value(mut self, value: i32) -> Self {
184         self.value = Some(value);
185         self
186     }
187 
cell_background(mut self, cell_background: &str) -> Self188     pub fn cell_background(mut self, cell_background: &str) -> Self {
189         self.cell_background = Some(cell_background.to_string());
190         self
191     }
192 
cell_background_rgba(mut self, cell_background_rgba: &gdk::RGBA) -> Self193     pub fn cell_background_rgba(mut self, cell_background_rgba: &gdk::RGBA) -> Self {
194         self.cell_background_rgba = Some(cell_background_rgba.clone());
195         self
196     }
197 
cell_background_set(mut self, cell_background_set: bool) -> Self198     pub fn cell_background_set(mut self, cell_background_set: bool) -> Self {
199         self.cell_background_set = Some(cell_background_set);
200         self
201     }
202 
height(mut self, height: i32) -> Self203     pub fn height(mut self, height: i32) -> Self {
204         self.height = Some(height);
205         self
206     }
207 
is_expanded(mut self, is_expanded: bool) -> Self208     pub fn is_expanded(mut self, is_expanded: bool) -> Self {
209         self.is_expanded = Some(is_expanded);
210         self
211     }
212 
is_expander(mut self, is_expander: bool) -> Self213     pub fn is_expander(mut self, is_expander: bool) -> Self {
214         self.is_expander = Some(is_expander);
215         self
216     }
217 
mode(mut self, mode: CellRendererMode) -> Self218     pub fn mode(mut self, mode: CellRendererMode) -> Self {
219         self.mode = Some(mode);
220         self
221     }
222 
sensitive(mut self, sensitive: bool) -> Self223     pub fn sensitive(mut self, sensitive: bool) -> Self {
224         self.sensitive = Some(sensitive);
225         self
226     }
227 
visible(mut self, visible: bool) -> Self228     pub fn visible(mut self, visible: bool) -> Self {
229         self.visible = Some(visible);
230         self
231     }
232 
width(mut self, width: i32) -> Self233     pub fn width(mut self, width: i32) -> Self {
234         self.width = Some(width);
235         self
236     }
237 
xalign(mut self, xalign: f32) -> Self238     pub fn xalign(mut self, xalign: f32) -> Self {
239         self.xalign = Some(xalign);
240         self
241     }
242 
xpad(mut self, xpad: u32) -> Self243     pub fn xpad(mut self, xpad: u32) -> Self {
244         self.xpad = Some(xpad);
245         self
246     }
247 
yalign(mut self, yalign: f32) -> Self248     pub fn yalign(mut self, yalign: f32) -> Self {
249         self.yalign = Some(yalign);
250         self
251     }
252 
ypad(mut self, ypad: u32) -> Self253     pub fn ypad(mut self, ypad: u32) -> Self {
254         self.ypad = Some(ypad);
255         self
256     }
257 
orientation(mut self, orientation: Orientation) -> Self258     pub fn orientation(mut self, orientation: Orientation) -> Self {
259         self.orientation = Some(orientation);
260         self
261     }
262 }
263 
264 pub const NONE_CELL_RENDERER_PROGRESS: Option<&CellRendererProgress> = None;
265 
266 pub trait CellRendererProgressExt: 'static {
is_inverted(&self) -> bool267     fn is_inverted(&self) -> bool;
268 
set_inverted(&self, inverted: bool)269     fn set_inverted(&self, inverted: bool);
270 
pulse(&self) -> i32271     fn pulse(&self) -> i32;
272 
set_pulse(&self, pulse: i32)273     fn set_pulse(&self, pulse: i32);
274 
text(&self) -> Option<glib::GString>275     fn text(&self) -> Option<glib::GString>;
276 
set_text(&self, text: Option<&str>)277     fn set_text(&self, text: Option<&str>);
278 
279     #[doc(alias = "text-xalign")]
text_xalign(&self) -> f32280     fn text_xalign(&self) -> f32;
281 
282     #[doc(alias = "text-xalign")]
set_text_xalign(&self, text_xalign: f32)283     fn set_text_xalign(&self, text_xalign: f32);
284 
285     #[doc(alias = "text-yalign")]
text_yalign(&self) -> f32286     fn text_yalign(&self) -> f32;
287 
288     #[doc(alias = "text-yalign")]
set_text_yalign(&self, text_yalign: f32)289     fn set_text_yalign(&self, text_yalign: f32);
290 
value(&self) -> i32291     fn value(&self) -> i32;
292 
set_value(&self, value: i32)293     fn set_value(&self, value: i32);
294 
295     #[doc(alias = "inverted")]
connect_inverted_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId296     fn connect_inverted_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
297 
298     #[doc(alias = "pulse")]
connect_pulse_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId299     fn connect_pulse_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
300 
301     #[doc(alias = "text")]
connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId302     fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
303 
304     #[doc(alias = "text-xalign")]
connect_text_xalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId305     fn connect_text_xalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
306 
307     #[doc(alias = "text-yalign")]
connect_text_yalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId308     fn connect_text_yalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
309 
310     #[doc(alias = "value")]
connect_value_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId311     fn connect_value_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
312 }
313 
314 impl<O: IsA<CellRendererProgress>> CellRendererProgressExt for O {
is_inverted(&self) -> bool315     fn is_inverted(&self) -> bool {
316         unsafe {
317             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
318             glib::gobject_ffi::g_object_get_property(
319                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
320                 b"inverted\0".as_ptr() as *const _,
321                 value.to_glib_none_mut().0,
322             );
323             value
324                 .get()
325                 .expect("Return Value for property `inverted` getter")
326         }
327     }
328 
set_inverted(&self, inverted: bool)329     fn set_inverted(&self, inverted: bool) {
330         unsafe {
331             glib::gobject_ffi::g_object_set_property(
332                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
333                 b"inverted\0".as_ptr() as *const _,
334                 inverted.to_value().to_glib_none().0,
335             );
336         }
337     }
338 
pulse(&self) -> i32339     fn pulse(&self) -> i32 {
340         unsafe {
341             let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
342             glib::gobject_ffi::g_object_get_property(
343                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
344                 b"pulse\0".as_ptr() as *const _,
345                 value.to_glib_none_mut().0,
346             );
347             value
348                 .get()
349                 .expect("Return Value for property `pulse` getter")
350         }
351     }
352 
set_pulse(&self, pulse: i32)353     fn set_pulse(&self, pulse: i32) {
354         unsafe {
355             glib::gobject_ffi::g_object_set_property(
356                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
357                 b"pulse\0".as_ptr() as *const _,
358                 pulse.to_value().to_glib_none().0,
359             );
360         }
361     }
362 
text(&self) -> Option<glib::GString>363     fn text(&self) -> Option<glib::GString> {
364         unsafe {
365             let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
366             glib::gobject_ffi::g_object_get_property(
367                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
368                 b"text\0".as_ptr() as *const _,
369                 value.to_glib_none_mut().0,
370             );
371             value
372                 .get()
373                 .expect("Return Value for property `text` getter")
374         }
375     }
376 
set_text(&self, text: Option<&str>)377     fn set_text(&self, text: Option<&str>) {
378         unsafe {
379             glib::gobject_ffi::g_object_set_property(
380                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
381                 b"text\0".as_ptr() as *const _,
382                 text.to_value().to_glib_none().0,
383             );
384         }
385     }
386 
text_xalign(&self) -> f32387     fn text_xalign(&self) -> f32 {
388         unsafe {
389             let mut value = glib::Value::from_type(<f32 as StaticType>::static_type());
390             glib::gobject_ffi::g_object_get_property(
391                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
392                 b"text-xalign\0".as_ptr() as *const _,
393                 value.to_glib_none_mut().0,
394             );
395             value
396                 .get()
397                 .expect("Return Value for property `text-xalign` getter")
398         }
399     }
400 
set_text_xalign(&self, text_xalign: f32)401     fn set_text_xalign(&self, text_xalign: f32) {
402         unsafe {
403             glib::gobject_ffi::g_object_set_property(
404                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
405                 b"text-xalign\0".as_ptr() as *const _,
406                 text_xalign.to_value().to_glib_none().0,
407             );
408         }
409     }
410 
text_yalign(&self) -> f32411     fn text_yalign(&self) -> f32 {
412         unsafe {
413             let mut value = glib::Value::from_type(<f32 as StaticType>::static_type());
414             glib::gobject_ffi::g_object_get_property(
415                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
416                 b"text-yalign\0".as_ptr() as *const _,
417                 value.to_glib_none_mut().0,
418             );
419             value
420                 .get()
421                 .expect("Return Value for property `text-yalign` getter")
422         }
423     }
424 
set_text_yalign(&self, text_yalign: f32)425     fn set_text_yalign(&self, text_yalign: f32) {
426         unsafe {
427             glib::gobject_ffi::g_object_set_property(
428                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
429                 b"text-yalign\0".as_ptr() as *const _,
430                 text_yalign.to_value().to_glib_none().0,
431             );
432         }
433     }
434 
value(&self) -> i32435     fn value(&self) -> i32 {
436         unsafe {
437             let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
438             glib::gobject_ffi::g_object_get_property(
439                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
440                 b"value\0".as_ptr() as *const _,
441                 value.to_glib_none_mut().0,
442             );
443             value
444                 .get()
445                 .expect("Return Value for property `value` getter")
446         }
447     }
448 
set_value(&self, value: i32)449     fn set_value(&self, value: i32) {
450         unsafe {
451             glib::gobject_ffi::g_object_set_property(
452                 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
453                 b"value\0".as_ptr() as *const _,
454                 value.to_value().to_glib_none().0,
455             );
456         }
457     }
458 
connect_inverted_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId459     fn connect_inverted_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
460         unsafe extern "C" fn notify_inverted_trampoline<
461             P: IsA<CellRendererProgress>,
462             F: Fn(&P) + 'static,
463         >(
464             this: *mut ffi::GtkCellRendererProgress,
465             _param_spec: glib::ffi::gpointer,
466             f: glib::ffi::gpointer,
467         ) {
468             let f: &F = &*(f as *const F);
469             f(CellRendererProgress::from_glib_borrow(this).unsafe_cast_ref())
470         }
471         unsafe {
472             let f: Box_<F> = Box_::new(f);
473             connect_raw(
474                 self.as_ptr() as *mut _,
475                 b"notify::inverted\0".as_ptr() as *const _,
476                 Some(transmute::<_, unsafe extern "C" fn()>(
477                     notify_inverted_trampoline::<Self, F> as *const (),
478                 )),
479                 Box_::into_raw(f),
480             )
481         }
482     }
483 
connect_pulse_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId484     fn connect_pulse_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
485         unsafe extern "C" fn notify_pulse_trampoline<
486             P: IsA<CellRendererProgress>,
487             F: Fn(&P) + 'static,
488         >(
489             this: *mut ffi::GtkCellRendererProgress,
490             _param_spec: glib::ffi::gpointer,
491             f: glib::ffi::gpointer,
492         ) {
493             let f: &F = &*(f as *const F);
494             f(CellRendererProgress::from_glib_borrow(this).unsafe_cast_ref())
495         }
496         unsafe {
497             let f: Box_<F> = Box_::new(f);
498             connect_raw(
499                 self.as_ptr() as *mut _,
500                 b"notify::pulse\0".as_ptr() as *const _,
501                 Some(transmute::<_, unsafe extern "C" fn()>(
502                     notify_pulse_trampoline::<Self, F> as *const (),
503                 )),
504                 Box_::into_raw(f),
505             )
506         }
507     }
508 
connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId509     fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
510         unsafe extern "C" fn notify_text_trampoline<
511             P: IsA<CellRendererProgress>,
512             F: Fn(&P) + 'static,
513         >(
514             this: *mut ffi::GtkCellRendererProgress,
515             _param_spec: glib::ffi::gpointer,
516             f: glib::ffi::gpointer,
517         ) {
518             let f: &F = &*(f as *const F);
519             f(CellRendererProgress::from_glib_borrow(this).unsafe_cast_ref())
520         }
521         unsafe {
522             let f: Box_<F> = Box_::new(f);
523             connect_raw(
524                 self.as_ptr() as *mut _,
525                 b"notify::text\0".as_ptr() as *const _,
526                 Some(transmute::<_, unsafe extern "C" fn()>(
527                     notify_text_trampoline::<Self, F> as *const (),
528                 )),
529                 Box_::into_raw(f),
530             )
531         }
532     }
533 
connect_text_xalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId534     fn connect_text_xalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
535         unsafe extern "C" fn notify_text_xalign_trampoline<
536             P: IsA<CellRendererProgress>,
537             F: Fn(&P) + 'static,
538         >(
539             this: *mut ffi::GtkCellRendererProgress,
540             _param_spec: glib::ffi::gpointer,
541             f: glib::ffi::gpointer,
542         ) {
543             let f: &F = &*(f as *const F);
544             f(CellRendererProgress::from_glib_borrow(this).unsafe_cast_ref())
545         }
546         unsafe {
547             let f: Box_<F> = Box_::new(f);
548             connect_raw(
549                 self.as_ptr() as *mut _,
550                 b"notify::text-xalign\0".as_ptr() as *const _,
551                 Some(transmute::<_, unsafe extern "C" fn()>(
552                     notify_text_xalign_trampoline::<Self, F> as *const (),
553                 )),
554                 Box_::into_raw(f),
555             )
556         }
557     }
558 
connect_text_yalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId559     fn connect_text_yalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
560         unsafe extern "C" fn notify_text_yalign_trampoline<
561             P: IsA<CellRendererProgress>,
562             F: Fn(&P) + 'static,
563         >(
564             this: *mut ffi::GtkCellRendererProgress,
565             _param_spec: glib::ffi::gpointer,
566             f: glib::ffi::gpointer,
567         ) {
568             let f: &F = &*(f as *const F);
569             f(CellRendererProgress::from_glib_borrow(this).unsafe_cast_ref())
570         }
571         unsafe {
572             let f: Box_<F> = Box_::new(f);
573             connect_raw(
574                 self.as_ptr() as *mut _,
575                 b"notify::text-yalign\0".as_ptr() as *const _,
576                 Some(transmute::<_, unsafe extern "C" fn()>(
577                     notify_text_yalign_trampoline::<Self, F> as *const (),
578                 )),
579                 Box_::into_raw(f),
580             )
581         }
582     }
583 
connect_value_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId584     fn connect_value_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
585         unsafe extern "C" fn notify_value_trampoline<
586             P: IsA<CellRendererProgress>,
587             F: Fn(&P) + 'static,
588         >(
589             this: *mut ffi::GtkCellRendererProgress,
590             _param_spec: glib::ffi::gpointer,
591             f: glib::ffi::gpointer,
592         ) {
593             let f: &F = &*(f as *const F);
594             f(CellRendererProgress::from_glib_borrow(this).unsafe_cast_ref())
595         }
596         unsafe {
597             let f: Box_<F> = Box_::new(f);
598             connect_raw(
599                 self.as_ptr() as *mut _,
600                 b"notify::value\0".as_ptr() as *const _,
601                 Some(transmute::<_, unsafe extern "C" fn()>(
602                     notify_value_trampoline::<Self, F> as *const (),
603                 )),
604                 Box_::into_raw(f),
605             )
606         }
607     }
608 }
609 
610 impl fmt::Display for CellRendererProgress {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result611     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
612         f.write_str("CellRendererProgress")
613     }
614 }
615