1use crate::{ffi, Position, SaveDelegate};
7use glib::{
8 object::ObjectType as _,
9 prelude::*,
10 signal::{connect_raw, SignalHandlerId},
11 translate::*,
12};
13use std::boxed::Box as Box_;
14
15glib::wrapper! {
16 #[doc(alias = "PanelWidget")]
17 pub struct Widget(Object<ffi::PanelWidget, ffi::PanelWidgetClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
18
19 match fn {
20 type_ => || ffi::panel_widget_get_type(),
21 }
22}
23
24impl Widget {
25 pub const NONE: Option<&'static Widget> = None;
26
27 #[doc(alias = "panel_widget_new")]
28 pub fn new() -> Widget {
29 assert_initialized_main_thread!();
30 unsafe { gtk::Widget::from_glib_none(ffi::panel_widget_new()).unsafe_cast() }
31 }
32
33 pub fn builder() -> WidgetBuilder {
38 WidgetBuilder::new()
39 }
40}
41
42impl Default for Widget {
43 fn default() -> Self {
44 Self::new()
45 }
46}
47
48#[must_use = "The builder must be built to be used"]
53pub struct WidgetBuilder {
54 builder: glib::object::ObjectBuilder<'static, Widget>,
55}
56
57impl WidgetBuilder {
58 fn new() -> Self {
59 Self {
60 builder: glib::object::Object::builder(),
61 }
62 }
63
64 pub fn can_maximize(self, can_maximize: bool) -> Self {
65 Self {
66 builder: self.builder.property("can-maximize", can_maximize),
67 }
68 }
69
70 pub fn child(self, child: &impl IsA<gtk::Widget>) -> Self {
71 Self {
72 builder: self.builder.property("child", child.clone().upcast()),
73 }
74 }
75
76 pub fn icon(self, icon: &impl IsA<gio::Icon>) -> Self {
77 Self {
78 builder: self.builder.property("icon", icon.clone().upcast()),
79 }
80 }
81
82 pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
83 Self {
84 builder: self.builder.property("icon-name", icon_name.into()),
85 }
86 }
87
88 pub fn id(self, id: impl Into<glib::GString>) -> Self {
89 Self {
90 builder: self.builder.property("id", id.into()),
91 }
92 }
93
94 pub fn kind(self, kind: impl Into<glib::GString>) -> Self {
95 Self {
96 builder: self.builder.property("kind", kind.into()),
97 }
98 }
99
100 pub fn menu_model(self, menu_model: &impl IsA<gio::MenuModel>) -> Self {
101 Self {
102 builder: self
103 .builder
104 .property("menu-model", menu_model.clone().upcast()),
105 }
106 }
107
108 pub fn modified(self, modified: bool) -> Self {
109 Self {
110 builder: self.builder.property("modified", modified),
111 }
112 }
113
114 pub fn needs_attention(self, needs_attention: bool) -> Self {
115 Self {
116 builder: self.builder.property("needs-attention", needs_attention),
117 }
118 }
119
120 pub fn reorderable(self, reorderable: bool) -> Self {
121 Self {
122 builder: self.builder.property("reorderable", reorderable),
123 }
124 }
125
126 pub fn save_delegate(self, save_delegate: &impl IsA<SaveDelegate>) -> Self {
127 Self {
128 builder: self
129 .builder
130 .property("save-delegate", save_delegate.clone().upcast()),
131 }
132 }
133
134 pub fn title(self, title: impl Into<glib::GString>) -> Self {
135 Self {
136 builder: self.builder.property("title", title.into()),
137 }
138 }
139
140 #[cfg(feature = "v1_2")]
141 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
142 pub fn tooltip(self, tooltip: impl Into<glib::GString>) -> Self {
143 Self {
144 builder: self.builder.property("tooltip", tooltip.into()),
145 }
146 }
147
148 pub fn can_focus(self, can_focus: bool) -> Self {
149 Self {
150 builder: self.builder.property("can-focus", can_focus),
151 }
152 }
153
154 pub fn can_target(self, can_target: bool) -> Self {
155 Self {
156 builder: self.builder.property("can-target", can_target),
157 }
158 }
159
160 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
161 Self {
162 builder: self.builder.property("css-classes", css_classes.into()),
163 }
164 }
165
166 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
167 Self {
168 builder: self.builder.property("css-name", css_name.into()),
169 }
170 }
171
172 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
173 Self {
174 builder: self.builder.property("cursor", cursor.clone()),
175 }
176 }
177
178 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
179 Self {
180 builder: self.builder.property("focus-on-click", focus_on_click),
181 }
182 }
183
184 pub fn focusable(self, focusable: bool) -> Self {
185 Self {
186 builder: self.builder.property("focusable", focusable),
187 }
188 }
189
190 pub fn halign(self, halign: gtk::Align) -> Self {
191 Self {
192 builder: self.builder.property("halign", halign),
193 }
194 }
195
196 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
197 Self {
198 builder: self.builder.property("has-tooltip", has_tooltip),
199 }
200 }
201
202 pub fn height_request(self, height_request: i32) -> Self {
203 Self {
204 builder: self.builder.property("height-request", height_request),
205 }
206 }
207
208 pub fn hexpand(self, hexpand: bool) -> Self {
209 Self {
210 builder: self.builder.property("hexpand", hexpand),
211 }
212 }
213
214 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
215 Self {
216 builder: self.builder.property("hexpand-set", hexpand_set),
217 }
218 }
219
220 pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
221 Self {
222 builder: self
223 .builder
224 .property("layout-manager", layout_manager.clone().upcast()),
225 }
226 }
227
228 #[cfg(feature = "gtk_v4_18")]
229 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
230 pub fn limit_events(self, limit_events: bool) -> Self {
231 Self {
232 builder: self.builder.property("limit-events", limit_events),
233 }
234 }
235
236 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
237 Self {
238 builder: self.builder.property("margin-bottom", margin_bottom),
239 }
240 }
241
242 pub fn margin_end(self, margin_end: i32) -> Self {
243 Self {
244 builder: self.builder.property("margin-end", margin_end),
245 }
246 }
247
248 pub fn margin_start(self, margin_start: i32) -> Self {
249 Self {
250 builder: self.builder.property("margin-start", margin_start),
251 }
252 }
253
254 pub fn margin_top(self, margin_top: i32) -> Self {
255 Self {
256 builder: self.builder.property("margin-top", margin_top),
257 }
258 }
259
260 pub fn name(self, name: impl Into<glib::GString>) -> Self {
261 Self {
262 builder: self.builder.property("name", name.into()),
263 }
264 }
265
266 pub fn opacity(self, opacity: f64) -> Self {
267 Self {
268 builder: self.builder.property("opacity", opacity),
269 }
270 }
271
272 pub fn overflow(self, overflow: gtk::Overflow) -> Self {
273 Self {
274 builder: self.builder.property("overflow", overflow),
275 }
276 }
277
278 pub fn receives_default(self, receives_default: bool) -> Self {
279 Self {
280 builder: self.builder.property("receives-default", receives_default),
281 }
282 }
283
284 pub fn sensitive(self, sensitive: bool) -> Self {
285 Self {
286 builder: self.builder.property("sensitive", sensitive),
287 }
288 }
289
290 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
291 Self {
292 builder: self
293 .builder
294 .property("tooltip-markup", tooltip_markup.into()),
295 }
296 }
297
298 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
299 Self {
300 builder: self.builder.property("tooltip-text", tooltip_text.into()),
301 }
302 }
303
304 pub fn valign(self, valign: gtk::Align) -> Self {
305 Self {
306 builder: self.builder.property("valign", valign),
307 }
308 }
309
310 pub fn vexpand(self, vexpand: bool) -> Self {
311 Self {
312 builder: self.builder.property("vexpand", vexpand),
313 }
314 }
315
316 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
317 Self {
318 builder: self.builder.property("vexpand-set", vexpand_set),
319 }
320 }
321
322 pub fn visible(self, visible: bool) -> Self {
323 Self {
324 builder: self.builder.property("visible", visible),
325 }
326 }
327
328 pub fn width_request(self, width_request: i32) -> Self {
329 Self {
330 builder: self.builder.property("width-request", width_request),
331 }
332 }
333
334 pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
335 Self {
336 builder: self.builder.property("accessible-role", accessible_role),
337 }
338 }
339
340 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
343 pub fn build(self) -> Widget {
344 assert_initialized_main_thread!();
345 self.builder.build()
346 }
347}
348
349pub trait PanelWidgetExt: IsA<Widget> + 'static {
350 #[doc(alias = "panel_widget_action_set_enabled")]
351 fn action_set_enabled(&self, action_name: &str, enabled: bool) {
352 unsafe {
353 ffi::panel_widget_action_set_enabled(
354 self.as_ref().to_glib_none().0,
355 action_name.to_glib_none().0,
356 enabled.into_glib(),
357 );
358 }
359 }
360
361 #[doc(alias = "panel_widget_close")]
362 fn close(&self) {
363 unsafe {
364 ffi::panel_widget_close(self.as_ref().to_glib_none().0);
365 }
366 }
367
368 #[doc(alias = "panel_widget_focus_default")]
369 fn focus_default(&self) -> bool {
370 unsafe {
371 from_glib(ffi::panel_widget_focus_default(
372 self.as_ref().to_glib_none().0,
373 ))
374 }
375 }
376
377 #[doc(alias = "panel_widget_force_close")]
378 fn force_close(&self) {
379 unsafe {
380 ffi::panel_widget_force_close(self.as_ref().to_glib_none().0);
381 }
382 }
383
384 #[doc(alias = "panel_widget_get_busy")]
385 #[doc(alias = "get_busy")]
386 #[doc(alias = "busy")]
387 fn is_busy(&self) -> bool {
388 unsafe { from_glib(ffi::panel_widget_get_busy(self.as_ref().to_glib_none().0)) }
389 }
390
391 #[doc(alias = "panel_widget_get_can_maximize")]
392 #[doc(alias = "get_can_maximize")]
393 #[doc(alias = "can-maximize")]
394 fn can_maximize(&self) -> bool {
395 unsafe {
396 from_glib(ffi::panel_widget_get_can_maximize(
397 self.as_ref().to_glib_none().0,
398 ))
399 }
400 }
401
402 #[doc(alias = "panel_widget_get_child")]
403 #[doc(alias = "get_child")]
404 fn child(&self) -> Option<gtk::Widget> {
405 unsafe { from_glib_none(ffi::panel_widget_get_child(self.as_ref().to_glib_none().0)) }
406 }
407
408 #[doc(alias = "panel_widget_get_default_focus")]
409 #[doc(alias = "get_default_focus")]
410 fn default_focus(&self) -> Option<gtk::Widget> {
411 unsafe {
412 from_glib_none(ffi::panel_widget_get_default_focus(
413 self.as_ref().to_glib_none().0,
414 ))
415 }
416 }
417
418 #[doc(alias = "panel_widget_get_icon")]
419 #[doc(alias = "get_icon")]
420 fn icon(&self) -> Option<gio::Icon> {
421 unsafe { from_glib_none(ffi::panel_widget_get_icon(self.as_ref().to_glib_none().0)) }
422 }
423
424 #[doc(alias = "panel_widget_get_icon_name")]
425 #[doc(alias = "get_icon_name")]
426 #[doc(alias = "icon-name")]
427 fn icon_name(&self) -> Option<glib::GString> {
428 unsafe {
429 from_glib_none(ffi::panel_widget_get_icon_name(
430 self.as_ref().to_glib_none().0,
431 ))
432 }
433 }
434
435 #[doc(alias = "panel_widget_get_id")]
436 #[doc(alias = "get_id")]
437 fn id(&self) -> glib::GString {
438 unsafe { from_glib_none(ffi::panel_widget_get_id(self.as_ref().to_glib_none().0)) }
439 }
440
441 #[doc(alias = "panel_widget_get_kind")]
442 #[doc(alias = "get_kind")]
443 fn kind(&self) -> glib::GString {
444 unsafe { from_glib_none(ffi::panel_widget_get_kind(self.as_ref().to_glib_none().0)) }
445 }
446
447 #[doc(alias = "panel_widget_get_menu_model")]
448 #[doc(alias = "get_menu_model")]
449 #[doc(alias = "menu-model")]
450 fn menu_model(&self) -> Option<gio::MenuModel> {
451 unsafe {
452 from_glib_none(ffi::panel_widget_get_menu_model(
453 self.as_ref().to_glib_none().0,
454 ))
455 }
456 }
457
458 #[doc(alias = "panel_widget_get_modified")]
459 #[doc(alias = "get_modified")]
460 #[doc(alias = "modified")]
461 fn is_modified(&self) -> bool {
462 unsafe {
463 from_glib(ffi::panel_widget_get_modified(
464 self.as_ref().to_glib_none().0,
465 ))
466 }
467 }
468
469 #[doc(alias = "panel_widget_get_needs_attention")]
470 #[doc(alias = "get_needs_attention")]
471 #[doc(alias = "needs-attention")]
472 fn needs_attention(&self) -> bool {
473 unsafe {
474 from_glib(ffi::panel_widget_get_needs_attention(
475 self.as_ref().to_glib_none().0,
476 ))
477 }
478 }
479
480 #[doc(alias = "panel_widget_get_position")]
481 #[doc(alias = "get_position")]
482 fn position(&self) -> Option<Position> {
483 unsafe {
484 from_glib_full(ffi::panel_widget_get_position(
485 self.as_ref().to_glib_none().0,
486 ))
487 }
488 }
489
490 #[doc(alias = "panel_widget_get_reorderable")]
491 #[doc(alias = "get_reorderable")]
492 #[doc(alias = "reorderable")]
493 fn is_reorderable(&self) -> bool {
494 unsafe {
495 from_glib(ffi::panel_widget_get_reorderable(
496 self.as_ref().to_glib_none().0,
497 ))
498 }
499 }
500
501 #[doc(alias = "panel_widget_get_save_delegate")]
502 #[doc(alias = "get_save_delegate")]
503 #[doc(alias = "save-delegate")]
504 fn save_delegate(&self) -> Option<SaveDelegate> {
505 unsafe {
506 from_glib_none(ffi::panel_widget_get_save_delegate(
507 self.as_ref().to_glib_none().0,
508 ))
509 }
510 }
511
512 #[doc(alias = "panel_widget_get_title")]
513 #[doc(alias = "get_title")]
514 fn title(&self) -> Option<glib::GString> {
515 unsafe { from_glib_none(ffi::panel_widget_get_title(self.as_ref().to_glib_none().0)) }
516 }
517
518 #[doc(alias = "panel_widget_get_tooltip")]
519 #[doc(alias = "get_tooltip")]
520 fn tooltip(&self) -> Option<glib::GString> {
521 unsafe {
522 from_glib_none(ffi::panel_widget_get_tooltip(
523 self.as_ref().to_glib_none().0,
524 ))
525 }
526 }
527
528 #[doc(alias = "panel_widget_insert_action_group")]
529 fn insert_action_group(&self, prefix: &str, group: &impl IsA<gio::ActionGroup>) {
530 unsafe {
531 ffi::panel_widget_insert_action_group(
532 self.as_ref().to_glib_none().0,
533 prefix.to_glib_none().0,
534 group.as_ref().to_glib_none().0,
535 );
536 }
537 }
538
539 #[doc(alias = "panel_widget_mark_busy")]
540 fn mark_busy(&self) {
541 unsafe {
542 ffi::panel_widget_mark_busy(self.as_ref().to_glib_none().0);
543 }
544 }
545
546 #[doc(alias = "panel_widget_maximize")]
547 fn maximize(&self) {
548 unsafe {
549 ffi::panel_widget_maximize(self.as_ref().to_glib_none().0);
550 }
551 }
552
553 #[doc(alias = "panel_widget_raise")]
554 fn raise(&self) {
555 unsafe {
556 ffi::panel_widget_raise(self.as_ref().to_glib_none().0);
557 }
558 }
559
560 #[doc(alias = "panel_widget_set_can_maximize")]
561 #[doc(alias = "can-maximize")]
562 fn set_can_maximize(&self, can_maximize: bool) {
563 unsafe {
564 ffi::panel_widget_set_can_maximize(
565 self.as_ref().to_glib_none().0,
566 can_maximize.into_glib(),
567 );
568 }
569 }
570
571 #[doc(alias = "panel_widget_set_child")]
572 #[doc(alias = "child")]
573 fn set_child(&self, child: Option<&impl IsA<gtk::Widget>>) {
574 unsafe {
575 ffi::panel_widget_set_child(
576 self.as_ref().to_glib_none().0,
577 child.map(|p| p.as_ref()).to_glib_none().0,
578 );
579 }
580 }
581
582 #[doc(alias = "panel_widget_set_icon")]
583 #[doc(alias = "icon")]
584 fn set_icon(&self, icon: Option<&impl IsA<gio::Icon>>) {
585 unsafe {
586 ffi::panel_widget_set_icon(
587 self.as_ref().to_glib_none().0,
588 icon.map(|p| p.as_ref()).to_glib_none().0,
589 );
590 }
591 }
592
593 #[doc(alias = "panel_widget_set_icon_name")]
594 #[doc(alias = "icon-name")]
595 fn set_icon_name(&self, icon_name: Option<&str>) {
596 unsafe {
597 ffi::panel_widget_set_icon_name(
598 self.as_ref().to_glib_none().0,
599 icon_name.to_glib_none().0,
600 );
601 }
602 }
603
604 #[doc(alias = "panel_widget_set_id")]
605 #[doc(alias = "id")]
606 fn set_id(&self, id: &str) {
607 unsafe {
608 ffi::panel_widget_set_id(self.as_ref().to_glib_none().0, id.to_glib_none().0);
609 }
610 }
611
612 #[doc(alias = "panel_widget_set_kind")]
613 #[doc(alias = "kind")]
614 fn set_kind(&self, kind: Option<&str>) {
615 unsafe {
616 ffi::panel_widget_set_kind(self.as_ref().to_glib_none().0, kind.to_glib_none().0);
617 }
618 }
619
620 #[doc(alias = "panel_widget_set_menu_model")]
621 #[doc(alias = "menu-model")]
622 fn set_menu_model(&self, menu_model: Option<&impl IsA<gio::MenuModel>>) {
623 unsafe {
624 ffi::panel_widget_set_menu_model(
625 self.as_ref().to_glib_none().0,
626 menu_model.map(|p| p.as_ref()).to_glib_none().0,
627 );
628 }
629 }
630
631 #[doc(alias = "panel_widget_set_modified")]
632 #[doc(alias = "modified")]
633 fn set_modified(&self, modified: bool) {
634 unsafe {
635 ffi::panel_widget_set_modified(self.as_ref().to_glib_none().0, modified.into_glib());
636 }
637 }
638
639 #[doc(alias = "panel_widget_set_needs_attention")]
640 #[doc(alias = "needs-attention")]
641 fn set_needs_attention(&self, needs_attention: bool) {
642 unsafe {
643 ffi::panel_widget_set_needs_attention(
644 self.as_ref().to_glib_none().0,
645 needs_attention.into_glib(),
646 );
647 }
648 }
649
650 #[doc(alias = "panel_widget_set_reorderable")]
651 #[doc(alias = "reorderable")]
652 fn set_reorderable(&self, reorderable: bool) {
653 unsafe {
654 ffi::panel_widget_set_reorderable(
655 self.as_ref().to_glib_none().0,
656 reorderable.into_glib(),
657 );
658 }
659 }
660
661 #[doc(alias = "panel_widget_set_save_delegate")]
662 #[doc(alias = "save-delegate")]
663 fn set_save_delegate(&self, save_delegate: Option<&impl IsA<SaveDelegate>>) {
664 unsafe {
665 ffi::panel_widget_set_save_delegate(
666 self.as_ref().to_glib_none().0,
667 save_delegate.map(|p| p.as_ref()).to_glib_none().0,
668 );
669 }
670 }
671
672 #[doc(alias = "panel_widget_set_title")]
673 #[doc(alias = "title")]
674 fn set_title(&self, title: Option<&str>) {
675 unsafe {
676 ffi::panel_widget_set_title(self.as_ref().to_glib_none().0, title.to_glib_none().0);
677 }
678 }
679
680 #[doc(alias = "panel_widget_set_tooltip")]
681 #[doc(alias = "tooltip")]
682 fn set_tooltip(&self, tooltip: Option<&str>) {
683 unsafe {
684 ffi::panel_widget_set_tooltip(self.as_ref().to_glib_none().0, tooltip.to_glib_none().0);
685 }
686 }
687
688 #[doc(alias = "panel_widget_unmark_busy")]
689 fn unmark_busy(&self) {
690 unsafe {
691 ffi::panel_widget_unmark_busy(self.as_ref().to_glib_none().0);
692 }
693 }
694
695 #[doc(alias = "panel_widget_unmaximize")]
696 fn unmaximize(&self) {
697 unsafe {
698 ffi::panel_widget_unmaximize(self.as_ref().to_glib_none().0);
699 }
700 }
701
702 #[doc(alias = "get-default-focus")]
703 fn connect_get_default_focus<F: Fn(&Self) -> Option<gtk::Widget> + 'static>(
704 &self,
705 f: F,
706 ) -> SignalHandlerId {
707 unsafe extern "C" fn get_default_focus_trampoline<
708 P: IsA<Widget>,
709 F: Fn(&P) -> Option<gtk::Widget> + 'static,
710 >(
711 this: *mut ffi::PanelWidget,
712 f: glib::ffi::gpointer,
713 ) -> *mut gtk::ffi::GtkWidget {
714 let f: &F = &*(f as *const F);
715 f(Widget::from_glib_borrow(this).unsafe_cast_ref()) .to_glib_none()
717 .0
718 }
719 unsafe {
720 let f: Box_<F> = Box_::new(f);
721 connect_raw(
722 self.as_ptr() as *mut _,
723 c"get-default-focus".as_ptr() as *const _,
724 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
725 get_default_focus_trampoline::<Self, F> as *const (),
726 )),
727 Box_::into_raw(f),
728 )
729 }
730 }
731
732 #[doc(alias = "presented")]
733 fn connect_presented<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
734 unsafe extern "C" fn presented_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
735 this: *mut ffi::PanelWidget,
736 f: glib::ffi::gpointer,
737 ) {
738 let f: &F = &*(f as *const F);
739 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
740 }
741 unsafe {
742 let f: Box_<F> = Box_::new(f);
743 connect_raw(
744 self.as_ptr() as *mut _,
745 c"presented".as_ptr() as *const _,
746 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
747 presented_trampoline::<Self, F> as *const (),
748 )),
749 Box_::into_raw(f),
750 )
751 }
752 }
753
754 #[doc(alias = "busy")]
755 fn connect_busy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
756 unsafe extern "C" fn notify_busy_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
757 this: *mut ffi::PanelWidget,
758 _param_spec: glib::ffi::gpointer,
759 f: glib::ffi::gpointer,
760 ) {
761 let f: &F = &*(f as *const F);
762 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
763 }
764 unsafe {
765 let f: Box_<F> = Box_::new(f);
766 connect_raw(
767 self.as_ptr() as *mut _,
768 c"notify::busy".as_ptr() as *const _,
769 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
770 notify_busy_trampoline::<Self, F> as *const (),
771 )),
772 Box_::into_raw(f),
773 )
774 }
775 }
776
777 #[doc(alias = "can-maximize")]
778 fn connect_can_maximize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
779 unsafe extern "C" fn notify_can_maximize_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
780 this: *mut ffi::PanelWidget,
781 _param_spec: glib::ffi::gpointer,
782 f: glib::ffi::gpointer,
783 ) {
784 let f: &F = &*(f as *const F);
785 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
786 }
787 unsafe {
788 let f: Box_<F> = Box_::new(f);
789 connect_raw(
790 self.as_ptr() as *mut _,
791 c"notify::can-maximize".as_ptr() as *const _,
792 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
793 notify_can_maximize_trampoline::<Self, F> as *const (),
794 )),
795 Box_::into_raw(f),
796 )
797 }
798 }
799
800 #[doc(alias = "child")]
801 fn connect_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
802 unsafe extern "C" fn notify_child_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
803 this: *mut ffi::PanelWidget,
804 _param_spec: glib::ffi::gpointer,
805 f: glib::ffi::gpointer,
806 ) {
807 let f: &F = &*(f as *const F);
808 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
809 }
810 unsafe {
811 let f: Box_<F> = Box_::new(f);
812 connect_raw(
813 self.as_ptr() as *mut _,
814 c"notify::child".as_ptr() as *const _,
815 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
816 notify_child_trampoline::<Self, F> as *const (),
817 )),
818 Box_::into_raw(f),
819 )
820 }
821 }
822
823 #[doc(alias = "icon")]
824 fn connect_icon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
825 unsafe extern "C" fn notify_icon_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
826 this: *mut ffi::PanelWidget,
827 _param_spec: glib::ffi::gpointer,
828 f: glib::ffi::gpointer,
829 ) {
830 let f: &F = &*(f as *const F);
831 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
832 }
833 unsafe {
834 let f: Box_<F> = Box_::new(f);
835 connect_raw(
836 self.as_ptr() as *mut _,
837 c"notify::icon".as_ptr() as *const _,
838 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
839 notify_icon_trampoline::<Self, F> as *const (),
840 )),
841 Box_::into_raw(f),
842 )
843 }
844 }
845
846 #[doc(alias = "icon-name")]
847 fn connect_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
848 unsafe extern "C" fn notify_icon_name_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
849 this: *mut ffi::PanelWidget,
850 _param_spec: glib::ffi::gpointer,
851 f: glib::ffi::gpointer,
852 ) {
853 let f: &F = &*(f as *const F);
854 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
855 }
856 unsafe {
857 let f: Box_<F> = Box_::new(f);
858 connect_raw(
859 self.as_ptr() as *mut _,
860 c"notify::icon-name".as_ptr() as *const _,
861 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
862 notify_icon_name_trampoline::<Self, F> as *const (),
863 )),
864 Box_::into_raw(f),
865 )
866 }
867 }
868
869 #[doc(alias = "id")]
870 fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
871 unsafe extern "C" fn notify_id_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
872 this: *mut ffi::PanelWidget,
873 _param_spec: glib::ffi::gpointer,
874 f: glib::ffi::gpointer,
875 ) {
876 let f: &F = &*(f as *const F);
877 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
878 }
879 unsafe {
880 let f: Box_<F> = Box_::new(f);
881 connect_raw(
882 self.as_ptr() as *mut _,
883 c"notify::id".as_ptr() as *const _,
884 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
885 notify_id_trampoline::<Self, F> as *const (),
886 )),
887 Box_::into_raw(f),
888 )
889 }
890 }
891
892 #[doc(alias = "kind")]
893 fn connect_kind_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
894 unsafe extern "C" fn notify_kind_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
895 this: *mut ffi::PanelWidget,
896 _param_spec: glib::ffi::gpointer,
897 f: glib::ffi::gpointer,
898 ) {
899 let f: &F = &*(f as *const F);
900 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
901 }
902 unsafe {
903 let f: Box_<F> = Box_::new(f);
904 connect_raw(
905 self.as_ptr() as *mut _,
906 c"notify::kind".as_ptr() as *const _,
907 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
908 notify_kind_trampoline::<Self, F> as *const (),
909 )),
910 Box_::into_raw(f),
911 )
912 }
913 }
914
915 #[doc(alias = "menu-model")]
916 fn connect_menu_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
917 unsafe extern "C" fn notify_menu_model_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
918 this: *mut ffi::PanelWidget,
919 _param_spec: glib::ffi::gpointer,
920 f: glib::ffi::gpointer,
921 ) {
922 let f: &F = &*(f as *const F);
923 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
924 }
925 unsafe {
926 let f: Box_<F> = Box_::new(f);
927 connect_raw(
928 self.as_ptr() as *mut _,
929 c"notify::menu-model".as_ptr() as *const _,
930 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
931 notify_menu_model_trampoline::<Self, F> as *const (),
932 )),
933 Box_::into_raw(f),
934 )
935 }
936 }
937
938 #[doc(alias = "modified")]
939 fn connect_modified_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
940 unsafe extern "C" fn notify_modified_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
941 this: *mut ffi::PanelWidget,
942 _param_spec: glib::ffi::gpointer,
943 f: glib::ffi::gpointer,
944 ) {
945 let f: &F = &*(f as *const F);
946 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
947 }
948 unsafe {
949 let f: Box_<F> = Box_::new(f);
950 connect_raw(
951 self.as_ptr() as *mut _,
952 c"notify::modified".as_ptr() as *const _,
953 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
954 notify_modified_trampoline::<Self, F> as *const (),
955 )),
956 Box_::into_raw(f),
957 )
958 }
959 }
960
961 #[doc(alias = "needs-attention")]
962 fn connect_needs_attention_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
963 unsafe extern "C" fn notify_needs_attention_trampoline<
964 P: IsA<Widget>,
965 F: Fn(&P) + 'static,
966 >(
967 this: *mut ffi::PanelWidget,
968 _param_spec: glib::ffi::gpointer,
969 f: glib::ffi::gpointer,
970 ) {
971 let f: &F = &*(f as *const F);
972 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
973 }
974 unsafe {
975 let f: Box_<F> = Box_::new(f);
976 connect_raw(
977 self.as_ptr() as *mut _,
978 c"notify::needs-attention".as_ptr() as *const _,
979 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
980 notify_needs_attention_trampoline::<Self, F> as *const (),
981 )),
982 Box_::into_raw(f),
983 )
984 }
985 }
986
987 #[doc(alias = "reorderable")]
988 fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
989 unsafe extern "C" fn notify_reorderable_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
990 this: *mut ffi::PanelWidget,
991 _param_spec: glib::ffi::gpointer,
992 f: glib::ffi::gpointer,
993 ) {
994 let f: &F = &*(f as *const F);
995 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
996 }
997 unsafe {
998 let f: Box_<F> = Box_::new(f);
999 connect_raw(
1000 self.as_ptr() as *mut _,
1001 c"notify::reorderable".as_ptr() as *const _,
1002 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1003 notify_reorderable_trampoline::<Self, F> as *const (),
1004 )),
1005 Box_::into_raw(f),
1006 )
1007 }
1008 }
1009
1010 #[doc(alias = "save-delegate")]
1011 fn connect_save_delegate_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1012 unsafe extern "C" fn notify_save_delegate_trampoline<
1013 P: IsA<Widget>,
1014 F: Fn(&P) + 'static,
1015 >(
1016 this: *mut ffi::PanelWidget,
1017 _param_spec: glib::ffi::gpointer,
1018 f: glib::ffi::gpointer,
1019 ) {
1020 let f: &F = &*(f as *const F);
1021 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
1022 }
1023 unsafe {
1024 let f: Box_<F> = Box_::new(f);
1025 connect_raw(
1026 self.as_ptr() as *mut _,
1027 c"notify::save-delegate".as_ptr() as *const _,
1028 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1029 notify_save_delegate_trampoline::<Self, F> as *const (),
1030 )),
1031 Box_::into_raw(f),
1032 )
1033 }
1034 }
1035
1036 #[doc(alias = "title")]
1037 fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1038 unsafe extern "C" fn notify_title_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
1039 this: *mut ffi::PanelWidget,
1040 _param_spec: glib::ffi::gpointer,
1041 f: glib::ffi::gpointer,
1042 ) {
1043 let f: &F = &*(f as *const F);
1044 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
1045 }
1046 unsafe {
1047 let f: Box_<F> = Box_::new(f);
1048 connect_raw(
1049 self.as_ptr() as *mut _,
1050 c"notify::title".as_ptr() as *const _,
1051 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1052 notify_title_trampoline::<Self, F> as *const (),
1053 )),
1054 Box_::into_raw(f),
1055 )
1056 }
1057 }
1058
1059 #[cfg(feature = "v1_2")]
1060 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
1061 #[doc(alias = "tooltip")]
1062 fn connect_tooltip_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1063 unsafe extern "C" fn notify_tooltip_trampoline<P: IsA<Widget>, F: Fn(&P) + 'static>(
1064 this: *mut ffi::PanelWidget,
1065 _param_spec: glib::ffi::gpointer,
1066 f: glib::ffi::gpointer,
1067 ) {
1068 let f: &F = &*(f as *const F);
1069 f(Widget::from_glib_borrow(this).unsafe_cast_ref())
1070 }
1071 unsafe {
1072 let f: Box_<F> = Box_::new(f);
1073 connect_raw(
1074 self.as_ptr() as *mut _,
1075 c"notify::tooltip".as_ptr() as *const _,
1076 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1077 notify_tooltip_trampoline::<Self, F> as *const (),
1078 )),
1079 Box_::into_raw(f),
1080 )
1081 }
1082 }
1083}
1084
1085impl<O: IsA<Widget>> PanelWidgetExt for O {}