1use gdk;
6use gdk_pixbuf;
7use glib::object::Cast;
8use glib::object::IsA;
9use glib::signal::connect_raw;
10use glib::signal::SignalHandlerId;
11use glib::translate::*;
12use glib::StaticType;
13use glib::ToValue;
14use glib::Value;
15use glib_sys;
16use gobject_sys;
17use gtk_sys;
18use std::boxed::Box as Box_;
19use std::fmt;
20use std::mem::transmute;
21use Align;
22use Application;
23use Bin;
24use Buildable;
25use ColorChooser;
26use Container;
27use Dialog;
28use ResizeMode;
29use Widget;
30use Window;
31use WindowPosition;
32use WindowType;
33
34glib_wrapper! {
35 pub struct ColorChooserDialog(Object<gtk_sys::GtkColorChooserDialog, gtk_sys::GtkColorChooserDialogClass, ColorChooserDialogClass>) @extends Dialog, Window, Bin, Container, Widget, @implements Buildable, ColorChooser;
36
37 match fn {
38 get_type => || gtk_sys::gtk_color_chooser_dialog_get_type(),
39 }
40}
41
42impl ColorChooserDialog {
43 pub fn new<P: IsA<Window>>(title: Option<&str>, parent: Option<&P>) -> ColorChooserDialog {
44 assert_initialized_main_thread!();
45 unsafe {
46 Widget::from_glib_none(gtk_sys::gtk_color_chooser_dialog_new(
47 title.to_glib_none().0,
48 parent.map(|p| p.as_ref()).to_glib_none().0,
49 ))
50 .unsafe_cast()
51 }
52 }
53}
54
55pub struct ColorChooserDialogBuilder {
56 show_editor: Option<bool>,
57 use_header_bar: Option<i32>,
58 accept_focus: Option<bool>,
59 application: Option<Application>,
60 attached_to: Option<Widget>,
61 decorated: Option<bool>,
62 default_height: Option<i32>,
63 default_width: Option<i32>,
64 deletable: Option<bool>,
65 destroy_with_parent: Option<bool>,
66 focus_on_map: Option<bool>,
67 focus_visible: Option<bool>,
68 gravity: Option<gdk::Gravity>,
69 hide_titlebar_when_maximized: Option<bool>,
70 icon: Option<gdk_pixbuf::Pixbuf>,
71 icon_name: Option<String>,
72 mnemonics_visible: Option<bool>,
73 modal: Option<bool>,
74 resizable: Option<bool>,
75 role: Option<String>,
76 screen: Option<gdk::Screen>,
77 skip_pager_hint: Option<bool>,
78 skip_taskbar_hint: Option<bool>,
79 startup_id: Option<String>,
80 title: Option<String>,
81 transient_for: Option<Window>,
82 type_: Option<WindowType>,
83 type_hint: Option<gdk::WindowTypeHint>,
84 urgency_hint: Option<bool>,
85 window_position: Option<WindowPosition>,
86 border_width: Option<u32>,
87 child: Option<Widget>,
88 resize_mode: Option<ResizeMode>,
89 app_paintable: Option<bool>,
90 can_default: Option<bool>,
91 can_focus: Option<bool>,
92 events: Option<gdk::EventMask>,
93 expand: Option<bool>,
94 #[cfg(any(feature = "v3_20", feature = "dox"))]
95 focus_on_click: Option<bool>,
96 halign: Option<Align>,
97 has_default: Option<bool>,
98 has_focus: Option<bool>,
99 has_tooltip: Option<bool>,
100 height_request: Option<i32>,
101 hexpand: Option<bool>,
102 hexpand_set: Option<bool>,
103 is_focus: Option<bool>,
104 margin: Option<i32>,
105 margin_bottom: Option<i32>,
106 margin_end: Option<i32>,
107 margin_start: Option<i32>,
108 margin_top: Option<i32>,
109 name: Option<String>,
110 no_show_all: Option<bool>,
111 opacity: Option<f64>,
112 parent: Option<Container>,
113 receives_default: Option<bool>,
114 sensitive: Option<bool>,
115 tooltip_markup: Option<String>,
117 tooltip_text: Option<String>,
118 valign: Option<Align>,
119 vexpand: Option<bool>,
120 vexpand_set: Option<bool>,
121 visible: Option<bool>,
122 width_request: Option<i32>,
123}
124
125impl ColorChooserDialogBuilder {
126 pub fn new() -> Self {
127 Self {
128 show_editor: None,
129 use_header_bar: None,
130 accept_focus: None,
131 application: None,
132 attached_to: None,
133 decorated: None,
134 default_height: None,
135 default_width: None,
136 deletable: None,
137 destroy_with_parent: None,
138 focus_on_map: None,
139 focus_visible: None,
140 gravity: None,
141 hide_titlebar_when_maximized: None,
142 icon: None,
143 icon_name: None,
144 mnemonics_visible: None,
145 modal: None,
146 resizable: None,
147 role: None,
148 screen: None,
149 skip_pager_hint: None,
150 skip_taskbar_hint: None,
151 startup_id: None,
152 title: None,
153 transient_for: None,
154 type_: None,
155 type_hint: None,
156 urgency_hint: None,
157 window_position: None,
158 border_width: None,
159 child: None,
160 resize_mode: None,
161 app_paintable: None,
162 can_default: None,
163 can_focus: None,
164 events: None,
165 expand: None,
166 #[cfg(any(feature = "v3_20", feature = "dox"))]
167 focus_on_click: None,
168 halign: None,
169 has_default: None,
170 has_focus: None,
171 has_tooltip: None,
172 height_request: None,
173 hexpand: None,
174 hexpand_set: None,
175 is_focus: None,
176 margin: None,
177 margin_bottom: None,
178 margin_end: None,
179 margin_start: None,
180 margin_top: None,
181 name: None,
182 no_show_all: None,
183 opacity: None,
184 parent: None,
185 receives_default: None,
186 sensitive: None,
187 tooltip_markup: None,
188 tooltip_text: None,
189 valign: None,
190 vexpand: None,
191 vexpand_set: None,
192 visible: None,
193 width_request: None,
194 }
195 }
196
197 pub fn build(self) -> ColorChooserDialog {
198 let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
199 if let Some(ref show_editor) = self.show_editor {
200 properties.push(("show-editor", show_editor));
201 }
202 if let Some(ref use_header_bar) = self.use_header_bar {
203 properties.push(("use-header-bar", use_header_bar));
204 }
205 if let Some(ref accept_focus) = self.accept_focus {
206 properties.push(("accept-focus", accept_focus));
207 }
208 if let Some(ref application) = self.application {
209 properties.push(("application", application));
210 }
211 if let Some(ref attached_to) = self.attached_to {
212 properties.push(("attached-to", attached_to));
213 }
214 if let Some(ref decorated) = self.decorated {
215 properties.push(("decorated", decorated));
216 }
217 if let Some(ref default_height) = self.default_height {
218 properties.push(("default-height", default_height));
219 }
220 if let Some(ref default_width) = self.default_width {
221 properties.push(("default-width", default_width));
222 }
223 if let Some(ref deletable) = self.deletable {
224 properties.push(("deletable", deletable));
225 }
226 if let Some(ref destroy_with_parent) = self.destroy_with_parent {
227 properties.push(("destroy-with-parent", destroy_with_parent));
228 }
229 if let Some(ref focus_on_map) = self.focus_on_map {
230 properties.push(("focus-on-map", focus_on_map));
231 }
232 if let Some(ref focus_visible) = self.focus_visible {
233 properties.push(("focus-visible", focus_visible));
234 }
235 if let Some(ref gravity) = self.gravity {
236 properties.push(("gravity", gravity));
237 }
238 if let Some(ref hide_titlebar_when_maximized) = self.hide_titlebar_when_maximized {
239 properties.push(("hide-titlebar-when-maximized", hide_titlebar_when_maximized));
240 }
241 if let Some(ref icon) = self.icon {
242 properties.push(("icon", icon));
243 }
244 if let Some(ref icon_name) = self.icon_name {
245 properties.push(("icon-name", icon_name));
246 }
247 if let Some(ref mnemonics_visible) = self.mnemonics_visible {
248 properties.push(("mnemonics-visible", mnemonics_visible));
249 }
250 if let Some(ref modal) = self.modal {
251 properties.push(("modal", modal));
252 }
253 if let Some(ref resizable) = self.resizable {
254 properties.push(("resizable", resizable));
255 }
256 if let Some(ref role) = self.role {
257 properties.push(("role", role));
258 }
259 if let Some(ref screen) = self.screen {
260 properties.push(("screen", screen));
261 }
262 if let Some(ref skip_pager_hint) = self.skip_pager_hint {
263 properties.push(("skip-pager-hint", skip_pager_hint));
264 }
265 if let Some(ref skip_taskbar_hint) = self.skip_taskbar_hint {
266 properties.push(("skip-taskbar-hint", skip_taskbar_hint));
267 }
268 if let Some(ref startup_id) = self.startup_id {
269 properties.push(("startup-id", startup_id));
270 }
271 if let Some(ref title) = self.title {
272 properties.push(("title", title));
273 }
274 if let Some(ref transient_for) = self.transient_for {
275 properties.push(("transient-for", transient_for));
276 }
277 if let Some(ref type_) = self.type_ {
278 properties.push(("type", type_));
279 }
280 if let Some(ref type_hint) = self.type_hint {
281 properties.push(("type-hint", type_hint));
282 }
283 if let Some(ref urgency_hint) = self.urgency_hint {
284 properties.push(("urgency-hint", urgency_hint));
285 }
286 if let Some(ref window_position) = self.window_position {
287 properties.push(("window-position", window_position));
288 }
289 if let Some(ref border_width) = self.border_width {
290 properties.push(("border-width", border_width));
291 }
292 if let Some(ref child) = self.child {
293 properties.push(("child", child));
294 }
295 if let Some(ref resize_mode) = self.resize_mode {
296 properties.push(("resize-mode", resize_mode));
297 }
298 if let Some(ref app_paintable) = self.app_paintable {
299 properties.push(("app-paintable", app_paintable));
300 }
301 if let Some(ref can_default) = self.can_default {
302 properties.push(("can-default", can_default));
303 }
304 if let Some(ref can_focus) = self.can_focus {
305 properties.push(("can-focus", can_focus));
306 }
307 if let Some(ref events) = self.events {
308 properties.push(("events", events));
309 }
310 if let Some(ref expand) = self.expand {
311 properties.push(("expand", expand));
312 }
313 #[cfg(any(feature = "v3_20", feature = "dox"))]
314 {
315 if let Some(ref focus_on_click) = self.focus_on_click {
316 properties.push(("focus-on-click", focus_on_click));
317 }
318 }
319 if let Some(ref halign) = self.halign {
320 properties.push(("halign", halign));
321 }
322 if let Some(ref has_default) = self.has_default {
323 properties.push(("has-default", has_default));
324 }
325 if let Some(ref has_focus) = self.has_focus {
326 properties.push(("has-focus", has_focus));
327 }
328 if let Some(ref has_tooltip) = self.has_tooltip {
329 properties.push(("has-tooltip", has_tooltip));
330 }
331 if let Some(ref height_request) = self.height_request {
332 properties.push(("height-request", height_request));
333 }
334 if let Some(ref hexpand) = self.hexpand {
335 properties.push(("hexpand", hexpand));
336 }
337 if let Some(ref hexpand_set) = self.hexpand_set {
338 properties.push(("hexpand-set", hexpand_set));
339 }
340 if let Some(ref is_focus) = self.is_focus {
341 properties.push(("is-focus", is_focus));
342 }
343 if let Some(ref margin) = self.margin {
344 properties.push(("margin", margin));
345 }
346 if let Some(ref margin_bottom) = self.margin_bottom {
347 properties.push(("margin-bottom", margin_bottom));
348 }
349 if let Some(ref margin_end) = self.margin_end {
350 properties.push(("margin-end", margin_end));
351 }
352 if let Some(ref margin_start) = self.margin_start {
353 properties.push(("margin-start", margin_start));
354 }
355 if let Some(ref margin_top) = self.margin_top {
356 properties.push(("margin-top", margin_top));
357 }
358 if let Some(ref name) = self.name {
359 properties.push(("name", name));
360 }
361 if let Some(ref no_show_all) = self.no_show_all {
362 properties.push(("no-show-all", no_show_all));
363 }
364 if let Some(ref opacity) = self.opacity {
365 properties.push(("opacity", opacity));
366 }
367 if let Some(ref parent) = self.parent {
368 properties.push(("parent", parent));
369 }
370 if let Some(ref receives_default) = self.receives_default {
371 properties.push(("receives-default", receives_default));
372 }
373 if let Some(ref sensitive) = self.sensitive {
374 properties.push(("sensitive", sensitive));
375 }
376 if let Some(ref tooltip_markup) = self.tooltip_markup {
377 properties.push(("tooltip-markup", tooltip_markup));
378 }
379 if let Some(ref tooltip_text) = self.tooltip_text {
380 properties.push(("tooltip-text", tooltip_text));
381 }
382 if let Some(ref valign) = self.valign {
383 properties.push(("valign", valign));
384 }
385 if let Some(ref vexpand) = self.vexpand {
386 properties.push(("vexpand", vexpand));
387 }
388 if let Some(ref vexpand_set) = self.vexpand_set {
389 properties.push(("vexpand-set", vexpand_set));
390 }
391 if let Some(ref visible) = self.visible {
392 properties.push(("visible", visible));
393 }
394 if let Some(ref width_request) = self.width_request {
395 properties.push(("width-request", width_request));
396 }
397 glib::Object::new(ColorChooserDialog::static_type(), &properties)
398 .expect("object new")
399 .downcast()
400 .expect("downcast")
401 }
402
403 pub fn show_editor(mut self, show_editor: bool) -> Self {
404 self.show_editor = Some(show_editor);
405 self
406 }
407
408 pub fn use_header_bar(mut self, use_header_bar: i32) -> Self {
409 self.use_header_bar = Some(use_header_bar);
410 self
411 }
412
413 pub fn accept_focus(mut self, accept_focus: bool) -> Self {
414 self.accept_focus = Some(accept_focus);
415 self
416 }
417
418 pub fn application(mut self, application: &Application) -> Self {
419 self.application = Some(application.clone());
420 self
421 }
422
423 pub fn attached_to(mut self, attached_to: &Widget) -> Self {
424 self.attached_to = Some(attached_to.clone());
425 self
426 }
427
428 pub fn decorated(mut self, decorated: bool) -> Self {
429 self.decorated = Some(decorated);
430 self
431 }
432
433 pub fn default_height(mut self, default_height: i32) -> Self {
434 self.default_height = Some(default_height);
435 self
436 }
437
438 pub fn default_width(mut self, default_width: i32) -> Self {
439 self.default_width = Some(default_width);
440 self
441 }
442
443 pub fn deletable(mut self, deletable: bool) -> Self {
444 self.deletable = Some(deletable);
445 self
446 }
447
448 pub fn destroy_with_parent(mut self, destroy_with_parent: bool) -> Self {
449 self.destroy_with_parent = Some(destroy_with_parent);
450 self
451 }
452
453 pub fn focus_on_map(mut self, focus_on_map: bool) -> Self {
454 self.focus_on_map = Some(focus_on_map);
455 self
456 }
457
458 pub fn focus_visible(mut self, focus_visible: bool) -> Self {
459 self.focus_visible = Some(focus_visible);
460 self
461 }
462
463 pub fn gravity(mut self, gravity: gdk::Gravity) -> Self {
464 self.gravity = Some(gravity);
465 self
466 }
467
468 pub fn hide_titlebar_when_maximized(mut self, hide_titlebar_when_maximized: bool) -> Self {
469 self.hide_titlebar_when_maximized = Some(hide_titlebar_when_maximized);
470 self
471 }
472
473 pub fn icon(mut self, icon: &gdk_pixbuf::Pixbuf) -> Self {
474 self.icon = Some(icon.clone());
475 self
476 }
477
478 pub fn icon_name(mut self, icon_name: &str) -> Self {
479 self.icon_name = Some(icon_name.to_string());
480 self
481 }
482
483 pub fn mnemonics_visible(mut self, mnemonics_visible: bool) -> Self {
484 self.mnemonics_visible = Some(mnemonics_visible);
485 self
486 }
487
488 pub fn modal(mut self, modal: bool) -> Self {
489 self.modal = Some(modal);
490 self
491 }
492
493 pub fn resizable(mut self, resizable: bool) -> Self {
494 self.resizable = Some(resizable);
495 self
496 }
497
498 pub fn role(mut self, role: &str) -> Self {
499 self.role = Some(role.to_string());
500 self
501 }
502
503 pub fn screen(mut self, screen: &gdk::Screen) -> Self {
504 self.screen = Some(screen.clone());
505 self
506 }
507
508 pub fn skip_pager_hint(mut self, skip_pager_hint: bool) -> Self {
509 self.skip_pager_hint = Some(skip_pager_hint);
510 self
511 }
512
513 pub fn skip_taskbar_hint(mut self, skip_taskbar_hint: bool) -> Self {
514 self.skip_taskbar_hint = Some(skip_taskbar_hint);
515 self
516 }
517
518 pub fn startup_id(mut self, startup_id: &str) -> Self {
519 self.startup_id = Some(startup_id.to_string());
520 self
521 }
522
523 pub fn title(mut self, title: &str) -> Self {
524 self.title = Some(title.to_string());
525 self
526 }
527
528 pub fn transient_for(mut self, transient_for: &Window) -> Self {
529 self.transient_for = Some(transient_for.clone());
530 self
531 }
532
533 pub fn type_(mut self, type_: WindowType) -> Self {
534 self.type_ = Some(type_);
535 self
536 }
537
538 pub fn type_hint(mut self, type_hint: gdk::WindowTypeHint) -> Self {
539 self.type_hint = Some(type_hint);
540 self
541 }
542
543 pub fn urgency_hint(mut self, urgency_hint: bool) -> Self {
544 self.urgency_hint = Some(urgency_hint);
545 self
546 }
547
548 pub fn window_position(mut self, window_position: WindowPosition) -> Self {
549 self.window_position = Some(window_position);
550 self
551 }
552
553 pub fn border_width(mut self, border_width: u32) -> Self {
554 self.border_width = Some(border_width);
555 self
556 }
557
558 pub fn child(mut self, child: &Widget) -> Self {
559 self.child = Some(child.clone());
560 self
561 }
562
563 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
564 self.resize_mode = Some(resize_mode);
565 self
566 }
567
568 pub fn app_paintable(mut self, app_paintable: bool) -> Self {
569 self.app_paintable = Some(app_paintable);
570 self
571 }
572
573 pub fn can_default(mut self, can_default: bool) -> Self {
574 self.can_default = Some(can_default);
575 self
576 }
577
578 pub fn can_focus(mut self, can_focus: bool) -> Self {
579 self.can_focus = Some(can_focus);
580 self
581 }
582
583 pub fn events(mut self, events: gdk::EventMask) -> Self {
584 self.events = Some(events);
585 self
586 }
587
588 pub fn expand(mut self, expand: bool) -> Self {
589 self.expand = Some(expand);
590 self
591 }
592
593 #[cfg(any(feature = "v3_20", feature = "dox"))]
594 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
595 self.focus_on_click = Some(focus_on_click);
596 self
597 }
598
599 pub fn halign(mut self, halign: Align) -> Self {
600 self.halign = Some(halign);
601 self
602 }
603
604 pub fn has_default(mut self, has_default: bool) -> Self {
605 self.has_default = Some(has_default);
606 self
607 }
608
609 pub fn has_focus(mut self, has_focus: bool) -> Self {
610 self.has_focus = Some(has_focus);
611 self
612 }
613
614 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
615 self.has_tooltip = Some(has_tooltip);
616 self
617 }
618
619 pub fn height_request(mut self, height_request: i32) -> Self {
620 self.height_request = Some(height_request);
621 self
622 }
623
624 pub fn hexpand(mut self, hexpand: bool) -> Self {
625 self.hexpand = Some(hexpand);
626 self
627 }
628
629 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
630 self.hexpand_set = Some(hexpand_set);
631 self
632 }
633
634 pub fn is_focus(mut self, is_focus: bool) -> Self {
635 self.is_focus = Some(is_focus);
636 self
637 }
638
639 pub fn margin(mut self, margin: i32) -> Self {
640 self.margin = Some(margin);
641 self
642 }
643
644 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
645 self.margin_bottom = Some(margin_bottom);
646 self
647 }
648
649 pub fn margin_end(mut self, margin_end: i32) -> Self {
650 self.margin_end = Some(margin_end);
651 self
652 }
653
654 pub fn margin_start(mut self, margin_start: i32) -> Self {
655 self.margin_start = Some(margin_start);
656 self
657 }
658
659 pub fn margin_top(mut self, margin_top: i32) -> Self {
660 self.margin_top = Some(margin_top);
661 self
662 }
663
664 pub fn name(mut self, name: &str) -> Self {
665 self.name = Some(name.to_string());
666 self
667 }
668
669 pub fn no_show_all(mut self, no_show_all: bool) -> Self {
670 self.no_show_all = Some(no_show_all);
671 self
672 }
673
674 pub fn opacity(mut self, opacity: f64) -> Self {
675 self.opacity = Some(opacity);
676 self
677 }
678
679 pub fn parent(mut self, parent: &Container) -> Self {
680 self.parent = Some(parent.clone());
681 self
682 }
683
684 pub fn receives_default(mut self, receives_default: bool) -> Self {
685 self.receives_default = Some(receives_default);
686 self
687 }
688
689 pub fn sensitive(mut self, sensitive: bool) -> Self {
690 self.sensitive = Some(sensitive);
691 self
692 }
693
694 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
695 self.tooltip_markup = Some(tooltip_markup.to_string());
696 self
697 }
698
699 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
700 self.tooltip_text = Some(tooltip_text.to_string());
701 self
702 }
703
704 pub fn valign(mut self, valign: Align) -> Self {
705 self.valign = Some(valign);
706 self
707 }
708
709 pub fn vexpand(mut self, vexpand: bool) -> Self {
710 self.vexpand = Some(vexpand);
711 self
712 }
713
714 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
715 self.vexpand_set = Some(vexpand_set);
716 self
717 }
718
719 pub fn visible(mut self, visible: bool) -> Self {
720 self.visible = Some(visible);
721 self
722 }
723
724 pub fn width_request(mut self, width_request: i32) -> Self {
725 self.width_request = Some(width_request);
726 self
727 }
728}
729
730pub const NONE_COLOR_CHOOSER_DIALOG: Option<&ColorChooserDialog> = None;
731
732pub trait ColorChooserDialogExt: 'static {
733 fn get_property_show_editor(&self) -> bool;
734
735 fn set_property_show_editor(&self, show_editor: bool);
736
737 fn connect_property_show_editor_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
738}
739
740impl<O: IsA<ColorChooserDialog>> ColorChooserDialogExt for O {
741 fn get_property_show_editor(&self) -> bool {
742 unsafe {
743 let mut value = Value::from_type(<bool as StaticType>::static_type());
744 gobject_sys::g_object_get_property(
745 self.to_glib_none().0 as *mut gobject_sys::GObject,
746 b"show-editor\0".as_ptr() as *const _,
747 value.to_glib_none_mut().0,
748 );
749 value.get().unwrap()
750 }
751 }
752
753 fn set_property_show_editor(&self, show_editor: bool) {
754 unsafe {
755 gobject_sys::g_object_set_property(
756 self.to_glib_none().0 as *mut gobject_sys::GObject,
757 b"show-editor\0".as_ptr() as *const _,
758 Value::from(&show_editor).to_glib_none().0,
759 );
760 }
761 }
762
763 fn connect_property_show_editor_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
764 unsafe extern "C" fn notify_show_editor_trampoline<P, F: Fn(&P) + 'static>(
765 this: *mut gtk_sys::GtkColorChooserDialog,
766 _param_spec: glib_sys::gpointer,
767 f: glib_sys::gpointer,
768 ) where
769 P: IsA<ColorChooserDialog>,
770 {
771 let f: &F = &*(f as *const F);
772 f(&ColorChooserDialog::from_glib_borrow(this).unsafe_cast())
773 }
774 unsafe {
775 let f: Box_<F> = Box_::new(f);
776 connect_raw(
777 self.as_ptr() as *mut _,
778 b"notify::show-editor\0".as_ptr() as *const _,
779 Some(transmute(notify_show_editor_trampoline::<Self, F> as usize)),
780 Box_::into_raw(f),
781 )
782 }
783 }
784}
785
786impl fmt::Display for ColorChooserDialog {
787 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
788 write!(f, "ColorChooserDialog")
789 }
790}