1use gdk;
6use gdk_pixbuf;
7use gio;
8use glib::object::Cast;
9use glib::object::IsA;
10use glib::signal::connect_raw;
11use glib::signal::SignalHandlerId;
12use glib::translate::*;
13use glib::GString;
14use glib::StaticType;
15use glib::ToValue;
16use glib::Value;
17use glib_sys;
18use gobject_sys;
19use gtk_sys;
20use std::boxed::Box as Box_;
21use std::fmt;
22use std::mem::transmute;
23use CellRenderer;
24use CellRendererMode;
25
26glib_wrapper! {
27 pub struct CellRendererPixbuf(Object<gtk_sys::GtkCellRendererPixbuf, gtk_sys::GtkCellRendererPixbufClass, CellRendererPixbufClass>) @extends CellRenderer;
28
29 match fn {
30 get_type => || gtk_sys::gtk_cell_renderer_pixbuf_get_type(),
31 }
32}
33
34impl CellRendererPixbuf {
35 pub fn new() -> CellRendererPixbuf {
36 assert_initialized_main_thread!();
37 unsafe {
38 CellRenderer::from_glib_none(gtk_sys::gtk_cell_renderer_pixbuf_new()).unsafe_cast()
39 }
40 }
41}
42
43impl Default for CellRendererPixbuf {
44 fn default() -> Self {
45 Self::new()
46 }
47}
48
49pub struct CellRendererPixbufBuilder {
50 follow_state: Option<bool>,
51 gicon: Option<gio::Icon>,
52 icon_name: Option<String>,
53 pixbuf: Option<gdk_pixbuf::Pixbuf>,
54 pixbuf_expander_closed: Option<gdk_pixbuf::Pixbuf>,
55 pixbuf_expander_open: Option<gdk_pixbuf::Pixbuf>,
56 stock_detail: Option<String>,
57 stock_size: Option<u32>,
58 cell_background: Option<String>,
59 cell_background_rgba: Option<gdk::RGBA>,
60 cell_background_set: Option<bool>,
61 height: Option<i32>,
62 is_expanded: Option<bool>,
63 is_expander: Option<bool>,
64 mode: Option<CellRendererMode>,
65 sensitive: Option<bool>,
66 visible: Option<bool>,
67 width: Option<i32>,
68 xalign: Option<f32>,
69 xpad: Option<u32>,
70 yalign: Option<f32>,
71 ypad: Option<u32>,
72}
73
74impl CellRendererPixbufBuilder {
75 pub fn new() -> Self {
76 Self {
77 follow_state: None,
78 gicon: None,
79 icon_name: None,
80 pixbuf: None,
81 pixbuf_expander_closed: None,
82 pixbuf_expander_open: None,
83 stock_detail: None,
84 stock_size: None,
85 cell_background: None,
86 cell_background_rgba: None,
87 cell_background_set: None,
88 height: None,
89 is_expanded: None,
90 is_expander: None,
91 mode: None,
92 sensitive: None,
93 visible: None,
94 width: None,
95 xalign: None,
96 xpad: None,
97 yalign: None,
98 ypad: None,
99 }
100 }
101
102 pub fn build(self) -> CellRendererPixbuf {
103 let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
104 if let Some(ref follow_state) = self.follow_state {
105 properties.push(("follow-state", follow_state));
106 }
107 if let Some(ref gicon) = self.gicon {
108 properties.push(("gicon", gicon));
109 }
110 if let Some(ref icon_name) = self.icon_name {
111 properties.push(("icon-name", icon_name));
112 }
113 if let Some(ref pixbuf) = self.pixbuf {
114 properties.push(("pixbuf", pixbuf));
115 }
116 if let Some(ref pixbuf_expander_closed) = self.pixbuf_expander_closed {
117 properties.push(("pixbuf-expander-closed", pixbuf_expander_closed));
118 }
119 if let Some(ref pixbuf_expander_open) = self.pixbuf_expander_open {
120 properties.push(("pixbuf-expander-open", pixbuf_expander_open));
121 }
122 if let Some(ref stock_detail) = self.stock_detail {
123 properties.push(("stock-detail", stock_detail));
124 }
125 if let Some(ref stock_size) = self.stock_size {
126 properties.push(("stock-size", stock_size));
127 }
128 if let Some(ref cell_background) = self.cell_background {
129 properties.push(("cell-background", cell_background));
130 }
131 if let Some(ref cell_background_rgba) = self.cell_background_rgba {
132 properties.push(("cell-background-rgba", cell_background_rgba));
133 }
134 if let Some(ref cell_background_set) = self.cell_background_set {
135 properties.push(("cell-background-set", cell_background_set));
136 }
137 if let Some(ref height) = self.height {
138 properties.push(("height", height));
139 }
140 if let Some(ref is_expanded) = self.is_expanded {
141 properties.push(("is-expanded", is_expanded));
142 }
143 if let Some(ref is_expander) = self.is_expander {
144 properties.push(("is-expander", is_expander));
145 }
146 if let Some(ref mode) = self.mode {
147 properties.push(("mode", mode));
148 }
149 if let Some(ref sensitive) = self.sensitive {
150 properties.push(("sensitive", sensitive));
151 }
152 if let Some(ref visible) = self.visible {
153 properties.push(("visible", visible));
154 }
155 if let Some(ref width) = self.width {
156 properties.push(("width", width));
157 }
158 if let Some(ref xalign) = self.xalign {
159 properties.push(("xalign", xalign));
160 }
161 if let Some(ref xpad) = self.xpad {
162 properties.push(("xpad", xpad));
163 }
164 if let Some(ref yalign) = self.yalign {
165 properties.push(("yalign", yalign));
166 }
167 if let Some(ref ypad) = self.ypad {
168 properties.push(("ypad", ypad));
169 }
170 glib::Object::new(CellRendererPixbuf::static_type(), &properties)
171 .expect("object new")
172 .downcast()
173 .expect("downcast")
174 }
175
176 pub fn follow_state(mut self, follow_state: bool) -> Self {
177 self.follow_state = Some(follow_state);
178 self
179 }
180
181 pub fn gicon(mut self, gicon: &gio::Icon) -> Self {
182 self.gicon = Some(gicon.clone());
183 self
184 }
185
186 pub fn icon_name(mut self, icon_name: &str) -> Self {
187 self.icon_name = Some(icon_name.to_string());
188 self
189 }
190
191 pub fn pixbuf(mut self, pixbuf: &gdk_pixbuf::Pixbuf) -> Self {
192 self.pixbuf = Some(pixbuf.clone());
193 self
194 }
195
196 pub fn pixbuf_expander_closed(mut self, pixbuf_expander_closed: &gdk_pixbuf::Pixbuf) -> Self {
197 self.pixbuf_expander_closed = Some(pixbuf_expander_closed.clone());
198 self
199 }
200
201 pub fn pixbuf_expander_open(mut self, pixbuf_expander_open: &gdk_pixbuf::Pixbuf) -> Self {
202 self.pixbuf_expander_open = Some(pixbuf_expander_open.clone());
203 self
204 }
205
206 pub fn stock_detail(mut self, stock_detail: &str) -> Self {
207 self.stock_detail = Some(stock_detail.to_string());
208 self
209 }
210
211 pub fn stock_size(mut self, stock_size: u32) -> Self {
212 self.stock_size = Some(stock_size);
213 self
214 }
215
216 pub fn cell_background(mut self, cell_background: &str) -> Self {
217 self.cell_background = Some(cell_background.to_string());
218 self
219 }
220
221 pub fn cell_background_rgba(mut self, cell_background_rgba: &gdk::RGBA) -> Self {
222 self.cell_background_rgba = Some(cell_background_rgba.clone());
223 self
224 }
225
226 pub fn cell_background_set(mut self, cell_background_set: bool) -> Self {
227 self.cell_background_set = Some(cell_background_set);
228 self
229 }
230
231 pub fn height(mut self, height: i32) -> Self {
232 self.height = Some(height);
233 self
234 }
235
236 pub fn is_expanded(mut self, is_expanded: bool) -> Self {
237 self.is_expanded = Some(is_expanded);
238 self
239 }
240
241 pub fn is_expander(mut self, is_expander: bool) -> Self {
242 self.is_expander = Some(is_expander);
243 self
244 }
245
246 pub fn mode(mut self, mode: CellRendererMode) -> Self {
247 self.mode = Some(mode);
248 self
249 }
250
251 pub fn sensitive(mut self, sensitive: bool) -> Self {
252 self.sensitive = Some(sensitive);
253 self
254 }
255
256 pub fn visible(mut self, visible: bool) -> Self {
257 self.visible = Some(visible);
258 self
259 }
260
261 pub fn width(mut self, width: i32) -> Self {
262 self.width = Some(width);
263 self
264 }
265
266 pub fn xalign(mut self, xalign: f32) -> Self {
267 self.xalign = Some(xalign);
268 self
269 }
270
271 pub fn xpad(mut self, xpad: u32) -> Self {
272 self.xpad = Some(xpad);
273 self
274 }
275
276 pub fn yalign(mut self, yalign: f32) -> Self {
277 self.yalign = Some(yalign);
278 self
279 }
280
281 pub fn ypad(mut self, ypad: u32) -> Self {
282 self.ypad = Some(ypad);
283 self
284 }
285}
286
287pub const NONE_CELL_RENDERER_PIXBUF: Option<&CellRendererPixbuf> = None;
288
289pub trait CellRendererPixbufExt: 'static {
290 #[cfg_attr(feature = "v3_16", deprecated)]
291 fn get_property_follow_state(&self) -> bool;
292
293 #[cfg_attr(feature = "v3_16", deprecated)]
294 fn set_property_follow_state(&self, follow_state: bool);
295
296 fn get_property_gicon(&self) -> Option<gio::Icon>;
297
298 fn set_property_gicon(&self, gicon: Option<&gio::Icon>);
299
300 fn get_property_icon_name(&self) -> Option<GString>;
301
302 fn set_property_icon_name(&self, icon_name: Option<&str>);
303
304 fn get_property_pixbuf(&self) -> Option<gdk_pixbuf::Pixbuf>;
305
306 fn set_property_pixbuf(&self, pixbuf: Option<&gdk_pixbuf::Pixbuf>);
307
308 fn get_property_pixbuf_expander_closed(&self) -> Option<gdk_pixbuf::Pixbuf>;
309
310 fn set_property_pixbuf_expander_closed(
311 &self,
312 pixbuf_expander_closed: Option<&gdk_pixbuf::Pixbuf>,
313 );
314
315 fn get_property_pixbuf_expander_open(&self) -> Option<gdk_pixbuf::Pixbuf>;
316
317 fn set_property_pixbuf_expander_open(&self, pixbuf_expander_open: Option<&gdk_pixbuf::Pixbuf>);
318
319 fn get_property_stock_detail(&self) -> Option<GString>;
320
321 fn set_property_stock_detail(&self, stock_detail: Option<&str>);
322
323 #[cfg_attr(feature = "v3_16", deprecated)]
324 fn connect_property_follow_state_notify<F: Fn(&Self) + 'static>(&self, f: F)
325 -> SignalHandlerId;
326
327 fn connect_property_gicon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
328
329 fn connect_property_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
330
331 fn connect_property_pixbuf_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
332
333 fn connect_property_pixbuf_expander_closed_notify<F: Fn(&Self) + 'static>(
334 &self,
335 f: F,
336 ) -> SignalHandlerId;
337
338 fn connect_property_pixbuf_expander_open_notify<F: Fn(&Self) + 'static>(
339 &self,
340 f: F,
341 ) -> SignalHandlerId;
342
343 fn connect_property_stock_detail_notify<F: Fn(&Self) + 'static>(&self, f: F)
344 -> SignalHandlerId;
345
346 fn connect_property_stock_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
347}
348
349impl<O: IsA<CellRendererPixbuf>> CellRendererPixbufExt for O {
350 fn get_property_follow_state(&self) -> bool {
351 unsafe {
352 let mut value = Value::from_type(<bool as StaticType>::static_type());
353 gobject_sys::g_object_get_property(
354 self.to_glib_none().0 as *mut gobject_sys::GObject,
355 b"follow-state\0".as_ptr() as *const _,
356 value.to_glib_none_mut().0,
357 );
358 value.get().unwrap()
359 }
360 }
361
362 fn set_property_follow_state(&self, follow_state: bool) {
363 unsafe {
364 gobject_sys::g_object_set_property(
365 self.to_glib_none().0 as *mut gobject_sys::GObject,
366 b"follow-state\0".as_ptr() as *const _,
367 Value::from(&follow_state).to_glib_none().0,
368 );
369 }
370 }
371
372 fn get_property_gicon(&self) -> Option<gio::Icon> {
373 unsafe {
374 let mut value = Value::from_type(<gio::Icon as StaticType>::static_type());
375 gobject_sys::g_object_get_property(
376 self.to_glib_none().0 as *mut gobject_sys::GObject,
377 b"gicon\0".as_ptr() as *const _,
378 value.to_glib_none_mut().0,
379 );
380 value.get()
381 }
382 }
383
384 fn set_property_gicon(&self, gicon: Option<&gio::Icon>) {
385 unsafe {
386 gobject_sys::g_object_set_property(
387 self.to_glib_none().0 as *mut gobject_sys::GObject,
388 b"gicon\0".as_ptr() as *const _,
389 Value::from(gicon).to_glib_none().0,
390 );
391 }
392 }
393
394 fn get_property_icon_name(&self) -> Option<GString> {
395 unsafe {
396 let mut value = Value::from_type(<GString as StaticType>::static_type());
397 gobject_sys::g_object_get_property(
398 self.to_glib_none().0 as *mut gobject_sys::GObject,
399 b"icon-name\0".as_ptr() as *const _,
400 value.to_glib_none_mut().0,
401 );
402 value.get()
403 }
404 }
405
406 fn set_property_icon_name(&self, icon_name: Option<&str>) {
407 unsafe {
408 gobject_sys::g_object_set_property(
409 self.to_glib_none().0 as *mut gobject_sys::GObject,
410 b"icon-name\0".as_ptr() as *const _,
411 Value::from(icon_name).to_glib_none().0,
412 );
413 }
414 }
415
416 fn get_property_pixbuf(&self) -> Option<gdk_pixbuf::Pixbuf> {
417 unsafe {
418 let mut value = Value::from_type(<gdk_pixbuf::Pixbuf as StaticType>::static_type());
419 gobject_sys::g_object_get_property(
420 self.to_glib_none().0 as *mut gobject_sys::GObject,
421 b"pixbuf\0".as_ptr() as *const _,
422 value.to_glib_none_mut().0,
423 );
424 value.get()
425 }
426 }
427
428 fn set_property_pixbuf(&self, pixbuf: Option<&gdk_pixbuf::Pixbuf>) {
429 unsafe {
430 gobject_sys::g_object_set_property(
431 self.to_glib_none().0 as *mut gobject_sys::GObject,
432 b"pixbuf\0".as_ptr() as *const _,
433 Value::from(pixbuf).to_glib_none().0,
434 );
435 }
436 }
437
438 fn get_property_pixbuf_expander_closed(&self) -> Option<gdk_pixbuf::Pixbuf> {
439 unsafe {
440 let mut value = Value::from_type(<gdk_pixbuf::Pixbuf as StaticType>::static_type());
441 gobject_sys::g_object_get_property(
442 self.to_glib_none().0 as *mut gobject_sys::GObject,
443 b"pixbuf-expander-closed\0".as_ptr() as *const _,
444 value.to_glib_none_mut().0,
445 );
446 value.get()
447 }
448 }
449
450 fn set_property_pixbuf_expander_closed(
451 &self,
452 pixbuf_expander_closed: Option<&gdk_pixbuf::Pixbuf>,
453 ) {
454 unsafe {
455 gobject_sys::g_object_set_property(
456 self.to_glib_none().0 as *mut gobject_sys::GObject,
457 b"pixbuf-expander-closed\0".as_ptr() as *const _,
458 Value::from(pixbuf_expander_closed).to_glib_none().0,
459 );
460 }
461 }
462
463 fn get_property_pixbuf_expander_open(&self) -> Option<gdk_pixbuf::Pixbuf> {
464 unsafe {
465 let mut value = Value::from_type(<gdk_pixbuf::Pixbuf as StaticType>::static_type());
466 gobject_sys::g_object_get_property(
467 self.to_glib_none().0 as *mut gobject_sys::GObject,
468 b"pixbuf-expander-open\0".as_ptr() as *const _,
469 value.to_glib_none_mut().0,
470 );
471 value.get()
472 }
473 }
474
475 fn set_property_pixbuf_expander_open(&self, pixbuf_expander_open: Option<&gdk_pixbuf::Pixbuf>) {
476 unsafe {
477 gobject_sys::g_object_set_property(
478 self.to_glib_none().0 as *mut gobject_sys::GObject,
479 b"pixbuf-expander-open\0".as_ptr() as *const _,
480 Value::from(pixbuf_expander_open).to_glib_none().0,
481 );
482 }
483 }
484
485 fn get_property_stock_detail(&self) -> Option<GString> {
486 unsafe {
487 let mut value = Value::from_type(<GString as StaticType>::static_type());
488 gobject_sys::g_object_get_property(
489 self.to_glib_none().0 as *mut gobject_sys::GObject,
490 b"stock-detail\0".as_ptr() as *const _,
491 value.to_glib_none_mut().0,
492 );
493 value.get()
494 }
495 }
496
497 fn set_property_stock_detail(&self, stock_detail: Option<&str>) {
498 unsafe {
499 gobject_sys::g_object_set_property(
500 self.to_glib_none().0 as *mut gobject_sys::GObject,
501 b"stock-detail\0".as_ptr() as *const _,
502 Value::from(stock_detail).to_glib_none().0,
503 );
504 }
505 }
506
507 fn connect_property_follow_state_notify<F: Fn(&Self) + 'static>(
508 &self,
509 f: F,
510 ) -> SignalHandlerId {
511 unsafe extern "C" fn notify_follow_state_trampoline<P, F: Fn(&P) + 'static>(
512 this: *mut gtk_sys::GtkCellRendererPixbuf,
513 _param_spec: glib_sys::gpointer,
514 f: glib_sys::gpointer,
515 ) where
516 P: IsA<CellRendererPixbuf>,
517 {
518 let f: &F = &*(f as *const F);
519 f(&CellRendererPixbuf::from_glib_borrow(this).unsafe_cast())
520 }
521 unsafe {
522 let f: Box_<F> = Box_::new(f);
523 connect_raw(
524 self.as_ptr() as *mut _,
525 b"notify::follow-state\0".as_ptr() as *const _,
526 Some(transmute(
527 notify_follow_state_trampoline::<Self, F> as usize,
528 )),
529 Box_::into_raw(f),
530 )
531 }
532 }
533
534 fn connect_property_gicon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
535 unsafe extern "C" fn notify_gicon_trampoline<P, F: Fn(&P) + 'static>(
536 this: *mut gtk_sys::GtkCellRendererPixbuf,
537 _param_spec: glib_sys::gpointer,
538 f: glib_sys::gpointer,
539 ) where
540 P: IsA<CellRendererPixbuf>,
541 {
542 let f: &F = &*(f as *const F);
543 f(&CellRendererPixbuf::from_glib_borrow(this).unsafe_cast())
544 }
545 unsafe {
546 let f: Box_<F> = Box_::new(f);
547 connect_raw(
548 self.as_ptr() as *mut _,
549 b"notify::gicon\0".as_ptr() as *const _,
550 Some(transmute(notify_gicon_trampoline::<Self, F> as usize)),
551 Box_::into_raw(f),
552 )
553 }
554 }
555
556 fn connect_property_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
557 unsafe extern "C" fn notify_icon_name_trampoline<P, F: Fn(&P) + 'static>(
558 this: *mut gtk_sys::GtkCellRendererPixbuf,
559 _param_spec: glib_sys::gpointer,
560 f: glib_sys::gpointer,
561 ) where
562 P: IsA<CellRendererPixbuf>,
563 {
564 let f: &F = &*(f as *const F);
565 f(&CellRendererPixbuf::from_glib_borrow(this).unsafe_cast())
566 }
567 unsafe {
568 let f: Box_<F> = Box_::new(f);
569 connect_raw(
570 self.as_ptr() as *mut _,
571 b"notify::icon-name\0".as_ptr() as *const _,
572 Some(transmute(notify_icon_name_trampoline::<Self, F> as usize)),
573 Box_::into_raw(f),
574 )
575 }
576 }
577
578 fn connect_property_pixbuf_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
579 unsafe extern "C" fn notify_pixbuf_trampoline<P, F: Fn(&P) + 'static>(
580 this: *mut gtk_sys::GtkCellRendererPixbuf,
581 _param_spec: glib_sys::gpointer,
582 f: glib_sys::gpointer,
583 ) where
584 P: IsA<CellRendererPixbuf>,
585 {
586 let f: &F = &*(f as *const F);
587 f(&CellRendererPixbuf::from_glib_borrow(this).unsafe_cast())
588 }
589 unsafe {
590 let f: Box_<F> = Box_::new(f);
591 connect_raw(
592 self.as_ptr() as *mut _,
593 b"notify::pixbuf\0".as_ptr() as *const _,
594 Some(transmute(notify_pixbuf_trampoline::<Self, F> as usize)),
595 Box_::into_raw(f),
596 )
597 }
598 }
599
600 fn connect_property_pixbuf_expander_closed_notify<F: Fn(&Self) + 'static>(
601 &self,
602 f: F,
603 ) -> SignalHandlerId {
604 unsafe extern "C" fn notify_pixbuf_expander_closed_trampoline<P, F: Fn(&P) + 'static>(
605 this: *mut gtk_sys::GtkCellRendererPixbuf,
606 _param_spec: glib_sys::gpointer,
607 f: glib_sys::gpointer,
608 ) where
609 P: IsA<CellRendererPixbuf>,
610 {
611 let f: &F = &*(f as *const F);
612 f(&CellRendererPixbuf::from_glib_borrow(this).unsafe_cast())
613 }
614 unsafe {
615 let f: Box_<F> = Box_::new(f);
616 connect_raw(
617 self.as_ptr() as *mut _,
618 b"notify::pixbuf-expander-closed\0".as_ptr() as *const _,
619 Some(transmute(
620 notify_pixbuf_expander_closed_trampoline::<Self, F> as usize,
621 )),
622 Box_::into_raw(f),
623 )
624 }
625 }
626
627 fn connect_property_pixbuf_expander_open_notify<F: Fn(&Self) + 'static>(
628 &self,
629 f: F,
630 ) -> SignalHandlerId {
631 unsafe extern "C" fn notify_pixbuf_expander_open_trampoline<P, F: Fn(&P) + 'static>(
632 this: *mut gtk_sys::GtkCellRendererPixbuf,
633 _param_spec: glib_sys::gpointer,
634 f: glib_sys::gpointer,
635 ) where
636 P: IsA<CellRendererPixbuf>,
637 {
638 let f: &F = &*(f as *const F);
639 f(&CellRendererPixbuf::from_glib_borrow(this).unsafe_cast())
640 }
641 unsafe {
642 let f: Box_<F> = Box_::new(f);
643 connect_raw(
644 self.as_ptr() as *mut _,
645 b"notify::pixbuf-expander-open\0".as_ptr() as *const _,
646 Some(transmute(
647 notify_pixbuf_expander_open_trampoline::<Self, F> as usize,
648 )),
649 Box_::into_raw(f),
650 )
651 }
652 }
653
654 fn connect_property_stock_detail_notify<F: Fn(&Self) + 'static>(
655 &self,
656 f: F,
657 ) -> SignalHandlerId {
658 unsafe extern "C" fn notify_stock_detail_trampoline<P, F: Fn(&P) + 'static>(
659 this: *mut gtk_sys::GtkCellRendererPixbuf,
660 _param_spec: glib_sys::gpointer,
661 f: glib_sys::gpointer,
662 ) where
663 P: IsA<CellRendererPixbuf>,
664 {
665 let f: &F = &*(f as *const F);
666 f(&CellRendererPixbuf::from_glib_borrow(this).unsafe_cast())
667 }
668 unsafe {
669 let f: Box_<F> = Box_::new(f);
670 connect_raw(
671 self.as_ptr() as *mut _,
672 b"notify::stock-detail\0".as_ptr() as *const _,
673 Some(transmute(
674 notify_stock_detail_trampoline::<Self, F> as usize,
675 )),
676 Box_::into_raw(f),
677 )
678 }
679 }
680
681 fn connect_property_stock_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
682 unsafe extern "C" fn notify_stock_size_trampoline<P, F: Fn(&P) + 'static>(
683 this: *mut gtk_sys::GtkCellRendererPixbuf,
684 _param_spec: glib_sys::gpointer,
685 f: glib_sys::gpointer,
686 ) where
687 P: IsA<CellRendererPixbuf>,
688 {
689 let f: &F = &*(f as *const F);
690 f(&CellRendererPixbuf::from_glib_borrow(this).unsafe_cast())
691 }
692 unsafe {
693 let f: Box_<F> = Box_::new(f);
694 connect_raw(
695 self.as_ptr() as *mut _,
696 b"notify::stock-size\0".as_ptr() as *const _,
697 Some(transmute(notify_stock_size_trampoline::<Self, F> as usize)),
698 Box_::into_raw(f),
699 )
700 }
701 }
702}
703
704impl fmt::Display for CellRendererPixbuf {
705 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
706 write!(f, "CellRendererPixbuf")
707 }
708}