1#![allow(deprecated)]
6
7use crate::{ffi, PreferencesRow};
8use glib::{
9 prelude::*,
10 signal::{connect_raw, SignalHandlerId},
11 translate::*,
12};
13use std::boxed::Box as Box_;
14
15glib::wrapper! {
16 #[doc(alias = "AdwExpanderRow")]
17 pub struct ExpanderRow(Object<ffi::AdwExpanderRow, ffi::AdwExpanderRowClass>) @extends PreferencesRow, gtk::ListBoxRow, gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Actionable;
18
19 match fn {
20 type_ => || ffi::adw_expander_row_get_type(),
21 }
22}
23
24impl ExpanderRow {
25 pub const NONE: Option<&'static ExpanderRow> = None;
26
27 #[doc(alias = "adw_expander_row_new")]
28 pub fn new() -> ExpanderRow {
29 assert_initialized_main_thread!();
30 unsafe { gtk::Widget::from_glib_none(ffi::adw_expander_row_new()).unsafe_cast() }
31 }
32
33 pub fn builder() -> ExpanderRowBuilder {
38 ExpanderRowBuilder::new()
39 }
40}
41
42impl Default for ExpanderRow {
43 fn default() -> Self {
44 Self::new()
45 }
46}
47
48#[must_use = "The builder must be built to be used"]
53pub struct ExpanderRowBuilder {
54 builder: glib::object::ObjectBuilder<'static, ExpanderRow>,
55}
56
57impl ExpanderRowBuilder {
58 fn new() -> Self {
59 Self {
60 builder: glib::object::Object::builder(),
61 }
62 }
63
64 pub fn enable_expansion(self, enable_expansion: bool) -> Self {
65 Self {
66 builder: self.builder.property("enable-expansion", enable_expansion),
67 }
68 }
69
70 pub fn expanded(self, expanded: bool) -> Self {
71 Self {
72 builder: self.builder.property("expanded", expanded),
73 }
74 }
75
76 #[cfg_attr(feature = "v1_3", deprecated = "Since 1.3")]
77 pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
78 Self {
79 builder: self.builder.property("icon-name", icon_name.into()),
80 }
81 }
82
83 pub fn show_enable_switch(self, show_enable_switch: bool) -> Self {
84 Self {
85 builder: self
86 .builder
87 .property("show-enable-switch", show_enable_switch),
88 }
89 }
90
91 pub fn subtitle(self, subtitle: impl Into<glib::GString>) -> Self {
92 Self {
93 builder: self.builder.property("subtitle", subtitle.into()),
94 }
95 }
96
97 #[cfg(feature = "v1_3")]
98 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
99 pub fn subtitle_lines(self, subtitle_lines: i32) -> Self {
100 Self {
101 builder: self.builder.property("subtitle-lines", subtitle_lines),
102 }
103 }
104
105 #[cfg(feature = "v1_3")]
106 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
107 pub fn title_lines(self, title_lines: i32) -> Self {
108 Self {
109 builder: self.builder.property("title-lines", title_lines),
110 }
111 }
112
113 pub fn title(self, title: impl Into<glib::GString>) -> Self {
114 Self {
115 builder: self.builder.property("title", title.into()),
116 }
117 }
118
119 #[cfg(feature = "v1_1")]
120 #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))]
121 pub fn title_selectable(self, title_selectable: bool) -> Self {
122 Self {
123 builder: self.builder.property("title-selectable", title_selectable),
124 }
125 }
126
127 #[cfg(feature = "v1_2")]
128 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
129 pub fn use_markup(self, use_markup: bool) -> Self {
130 Self {
131 builder: self.builder.property("use-markup", use_markup),
132 }
133 }
134
135 pub fn use_underline(self, use_underline: bool) -> Self {
136 Self {
137 builder: self.builder.property("use-underline", use_underline),
138 }
139 }
140
141 pub fn activatable(self, activatable: bool) -> Self {
142 Self {
143 builder: self.builder.property("activatable", activatable),
144 }
145 }
146
147 pub fn child(self, child: &impl IsA<gtk::Widget>) -> Self {
148 Self {
149 builder: self.builder.property("child", child.clone().upcast()),
150 }
151 }
152
153 pub fn selectable(self, selectable: bool) -> Self {
154 Self {
155 builder: self.builder.property("selectable", selectable),
156 }
157 }
158
159 pub fn can_focus(self, can_focus: bool) -> Self {
160 Self {
161 builder: self.builder.property("can-focus", can_focus),
162 }
163 }
164
165 pub fn can_target(self, can_target: bool) -> Self {
166 Self {
167 builder: self.builder.property("can-target", can_target),
168 }
169 }
170
171 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
172 Self {
173 builder: self.builder.property("css-classes", css_classes.into()),
174 }
175 }
176
177 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
178 Self {
179 builder: self.builder.property("css-name", css_name.into()),
180 }
181 }
182
183 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
184 Self {
185 builder: self.builder.property("cursor", cursor.clone()),
186 }
187 }
188
189 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
190 Self {
191 builder: self.builder.property("focus-on-click", focus_on_click),
192 }
193 }
194
195 pub fn focusable(self, focusable: bool) -> Self {
196 Self {
197 builder: self.builder.property("focusable", focusable),
198 }
199 }
200
201 pub fn halign(self, halign: gtk::Align) -> Self {
202 Self {
203 builder: self.builder.property("halign", halign),
204 }
205 }
206
207 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
208 Self {
209 builder: self.builder.property("has-tooltip", has_tooltip),
210 }
211 }
212
213 pub fn height_request(self, height_request: i32) -> Self {
214 Self {
215 builder: self.builder.property("height-request", height_request),
216 }
217 }
218
219 pub fn hexpand(self, hexpand: bool) -> Self {
220 Self {
221 builder: self.builder.property("hexpand", hexpand),
222 }
223 }
224
225 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
226 Self {
227 builder: self.builder.property("hexpand-set", hexpand_set),
228 }
229 }
230
231 pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
232 Self {
233 builder: self
234 .builder
235 .property("layout-manager", layout_manager.clone().upcast()),
236 }
237 }
238
239 #[cfg(feature = "gtk_v4_18")]
240 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
241 pub fn limit_events(self, limit_events: bool) -> Self {
242 Self {
243 builder: self.builder.property("limit-events", limit_events),
244 }
245 }
246
247 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
248 Self {
249 builder: self.builder.property("margin-bottom", margin_bottom),
250 }
251 }
252
253 pub fn margin_end(self, margin_end: i32) -> Self {
254 Self {
255 builder: self.builder.property("margin-end", margin_end),
256 }
257 }
258
259 pub fn margin_start(self, margin_start: i32) -> Self {
260 Self {
261 builder: self.builder.property("margin-start", margin_start),
262 }
263 }
264
265 pub fn margin_top(self, margin_top: i32) -> Self {
266 Self {
267 builder: self.builder.property("margin-top", margin_top),
268 }
269 }
270
271 pub fn name(self, name: impl Into<glib::GString>) -> Self {
272 Self {
273 builder: self.builder.property("name", name.into()),
274 }
275 }
276
277 pub fn opacity(self, opacity: f64) -> Self {
278 Self {
279 builder: self.builder.property("opacity", opacity),
280 }
281 }
282
283 pub fn overflow(self, overflow: gtk::Overflow) -> Self {
284 Self {
285 builder: self.builder.property("overflow", overflow),
286 }
287 }
288
289 pub fn receives_default(self, receives_default: bool) -> Self {
290 Self {
291 builder: self.builder.property("receives-default", receives_default),
292 }
293 }
294
295 pub fn sensitive(self, sensitive: bool) -> Self {
296 Self {
297 builder: self.builder.property("sensitive", sensitive),
298 }
299 }
300
301 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
302 Self {
303 builder: self
304 .builder
305 .property("tooltip-markup", tooltip_markup.into()),
306 }
307 }
308
309 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
310 Self {
311 builder: self.builder.property("tooltip-text", tooltip_text.into()),
312 }
313 }
314
315 pub fn valign(self, valign: gtk::Align) -> Self {
316 Self {
317 builder: self.builder.property("valign", valign),
318 }
319 }
320
321 pub fn vexpand(self, vexpand: bool) -> Self {
322 Self {
323 builder: self.builder.property("vexpand", vexpand),
324 }
325 }
326
327 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
328 Self {
329 builder: self.builder.property("vexpand-set", vexpand_set),
330 }
331 }
332
333 pub fn visible(self, visible: bool) -> Self {
334 Self {
335 builder: self.builder.property("visible", visible),
336 }
337 }
338
339 pub fn width_request(self, width_request: i32) -> Self {
340 Self {
341 builder: self.builder.property("width-request", width_request),
342 }
343 }
344
345 pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
346 Self {
347 builder: self.builder.property("accessible-role", accessible_role),
348 }
349 }
350
351 pub fn action_name(self, action_name: impl Into<glib::GString>) -> Self {
352 Self {
353 builder: self.builder.property("action-name", action_name.into()),
354 }
355 }
356
357 pub fn action_target(self, action_target: &glib::Variant) -> Self {
358 Self {
359 builder: self
360 .builder
361 .property("action-target", action_target.clone()),
362 }
363 }
364
365 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
368 pub fn build(self) -> ExpanderRow {
369 assert_initialized_main_thread!();
370 self.builder.build()
371 }
372}
373
374pub trait ExpanderRowExt: IsA<ExpanderRow> + 'static {
375 #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")]
376 #[allow(deprecated)]
377 #[doc(alias = "adw_expander_row_add_action")]
378 fn add_action(&self, widget: &impl IsA<gtk::Widget>) {
379 unsafe {
380 ffi::adw_expander_row_add_action(
381 self.as_ref().to_glib_none().0,
382 widget.as_ref().to_glib_none().0,
383 );
384 }
385 }
386
387 #[doc(alias = "adw_expander_row_add_prefix")]
388 fn add_prefix(&self, widget: &impl IsA<gtk::Widget>) {
389 unsafe {
390 ffi::adw_expander_row_add_prefix(
391 self.as_ref().to_glib_none().0,
392 widget.as_ref().to_glib_none().0,
393 );
394 }
395 }
396
397 #[doc(alias = "adw_expander_row_add_row")]
398 fn add_row(&self, child: &impl IsA<gtk::Widget>) {
399 unsafe {
400 ffi::adw_expander_row_add_row(
401 self.as_ref().to_glib_none().0,
402 child.as_ref().to_glib_none().0,
403 );
404 }
405 }
406
407 #[cfg(feature = "v1_4")]
408 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
409 #[doc(alias = "adw_expander_row_add_suffix")]
410 fn add_suffix(&self, widget: &impl IsA<gtk::Widget>) {
411 unsafe {
412 ffi::adw_expander_row_add_suffix(
413 self.as_ref().to_glib_none().0,
414 widget.as_ref().to_glib_none().0,
415 );
416 }
417 }
418
419 #[doc(alias = "adw_expander_row_get_enable_expansion")]
420 #[doc(alias = "get_enable_expansion")]
421 #[doc(alias = "enable-expansion")]
422 fn enables_expansion(&self) -> bool {
423 unsafe {
424 from_glib(ffi::adw_expander_row_get_enable_expansion(
425 self.as_ref().to_glib_none().0,
426 ))
427 }
428 }
429
430 #[doc(alias = "adw_expander_row_get_expanded")]
431 #[doc(alias = "get_expanded")]
432 #[doc(alias = "expanded")]
433 fn is_expanded(&self) -> bool {
434 unsafe {
435 from_glib(ffi::adw_expander_row_get_expanded(
436 self.as_ref().to_glib_none().0,
437 ))
438 }
439 }
440
441 #[cfg_attr(feature = "v1_3", deprecated = "Since 1.3")]
442 #[allow(deprecated)]
443 #[doc(alias = "adw_expander_row_get_icon_name")]
444 #[doc(alias = "get_icon_name")]
445 #[doc(alias = "icon-name")]
446 fn icon_name(&self) -> Option<glib::GString> {
447 unsafe {
448 from_glib_none(ffi::adw_expander_row_get_icon_name(
449 self.as_ref().to_glib_none().0,
450 ))
451 }
452 }
453
454 #[doc(alias = "adw_expander_row_get_show_enable_switch")]
455 #[doc(alias = "get_show_enable_switch")]
456 #[doc(alias = "show-enable-switch")]
457 fn shows_enable_switch(&self) -> bool {
458 unsafe {
459 from_glib(ffi::adw_expander_row_get_show_enable_switch(
460 self.as_ref().to_glib_none().0,
461 ))
462 }
463 }
464
465 #[doc(alias = "adw_expander_row_get_subtitle")]
466 #[doc(alias = "get_subtitle")]
467 fn subtitle(&self) -> glib::GString {
468 unsafe {
469 from_glib_none(ffi::adw_expander_row_get_subtitle(
470 self.as_ref().to_glib_none().0,
471 ))
472 }
473 }
474
475 #[cfg(feature = "v1_3")]
476 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
477 #[doc(alias = "adw_expander_row_get_subtitle_lines")]
478 #[doc(alias = "get_subtitle_lines")]
479 #[doc(alias = "subtitle-lines")]
480 fn subtitle_lines(&self) -> i32 {
481 unsafe { ffi::adw_expander_row_get_subtitle_lines(self.as_ref().to_glib_none().0) }
482 }
483
484 #[cfg(feature = "v1_3")]
485 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
486 #[doc(alias = "adw_expander_row_get_title_lines")]
487 #[doc(alias = "get_title_lines")]
488 #[doc(alias = "title-lines")]
489 fn title_lines(&self) -> i32 {
490 unsafe { ffi::adw_expander_row_get_title_lines(self.as_ref().to_glib_none().0) }
491 }
492
493 #[doc(alias = "adw_expander_row_remove")]
494 fn remove(&self, child: &impl IsA<gtk::Widget>) {
495 unsafe {
496 ffi::adw_expander_row_remove(
497 self.as_ref().to_glib_none().0,
498 child.as_ref().to_glib_none().0,
499 );
500 }
501 }
502
503 #[doc(alias = "adw_expander_row_set_enable_expansion")]
504 #[doc(alias = "enable-expansion")]
505 fn set_enable_expansion(&self, enable_expansion: bool) {
506 unsafe {
507 ffi::adw_expander_row_set_enable_expansion(
508 self.as_ref().to_glib_none().0,
509 enable_expansion.into_glib(),
510 );
511 }
512 }
513
514 #[doc(alias = "adw_expander_row_set_expanded")]
515 #[doc(alias = "expanded")]
516 fn set_expanded(&self, expanded: bool) {
517 unsafe {
518 ffi::adw_expander_row_set_expanded(
519 self.as_ref().to_glib_none().0,
520 expanded.into_glib(),
521 );
522 }
523 }
524
525 #[cfg_attr(feature = "v1_3", deprecated = "Since 1.3")]
526 #[allow(deprecated)]
527 #[doc(alias = "adw_expander_row_set_icon_name")]
528 #[doc(alias = "icon-name")]
529 fn set_icon_name(&self, icon_name: Option<&str>) {
530 unsafe {
531 ffi::adw_expander_row_set_icon_name(
532 self.as_ref().to_glib_none().0,
533 icon_name.to_glib_none().0,
534 );
535 }
536 }
537
538 #[doc(alias = "adw_expander_row_set_show_enable_switch")]
539 #[doc(alias = "show-enable-switch")]
540 fn set_show_enable_switch(&self, show_enable_switch: bool) {
541 unsafe {
542 ffi::adw_expander_row_set_show_enable_switch(
543 self.as_ref().to_glib_none().0,
544 show_enable_switch.into_glib(),
545 );
546 }
547 }
548
549 #[doc(alias = "adw_expander_row_set_subtitle")]
550 #[doc(alias = "subtitle")]
551 fn set_subtitle(&self, subtitle: &str) {
552 unsafe {
553 ffi::adw_expander_row_set_subtitle(
554 self.as_ref().to_glib_none().0,
555 subtitle.to_glib_none().0,
556 );
557 }
558 }
559
560 #[cfg(feature = "v1_3")]
561 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
562 #[doc(alias = "adw_expander_row_set_subtitle_lines")]
563 #[doc(alias = "subtitle-lines")]
564 fn set_subtitle_lines(&self, subtitle_lines: i32) {
565 unsafe {
566 ffi::adw_expander_row_set_subtitle_lines(
567 self.as_ref().to_glib_none().0,
568 subtitle_lines,
569 );
570 }
571 }
572
573 #[cfg(feature = "v1_3")]
574 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
575 #[doc(alias = "adw_expander_row_set_title_lines")]
576 #[doc(alias = "title-lines")]
577 fn set_title_lines(&self, title_lines: i32) {
578 unsafe {
579 ffi::adw_expander_row_set_title_lines(self.as_ref().to_glib_none().0, title_lines);
580 }
581 }
582
583 #[doc(alias = "enable-expansion")]
584 fn connect_enable_expansion_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
585 unsafe extern "C" fn notify_enable_expansion_trampoline<
586 P: IsA<ExpanderRow>,
587 F: Fn(&P) + 'static,
588 >(
589 this: *mut ffi::AdwExpanderRow,
590 _param_spec: glib::ffi::gpointer,
591 f: glib::ffi::gpointer,
592 ) {
593 let f: &F = &*(f as *const F);
594 f(ExpanderRow::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 c"notify::enable-expansion".as_ptr() as *const _,
601 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
602 notify_enable_expansion_trampoline::<Self, F> as *const (),
603 )),
604 Box_::into_raw(f),
605 )
606 }
607 }
608
609 #[doc(alias = "expanded")]
610 fn connect_expanded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
611 unsafe extern "C" fn notify_expanded_trampoline<
612 P: IsA<ExpanderRow>,
613 F: Fn(&P) + 'static,
614 >(
615 this: *mut ffi::AdwExpanderRow,
616 _param_spec: glib::ffi::gpointer,
617 f: glib::ffi::gpointer,
618 ) {
619 let f: &F = &*(f as *const F);
620 f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref())
621 }
622 unsafe {
623 let f: Box_<F> = Box_::new(f);
624 connect_raw(
625 self.as_ptr() as *mut _,
626 c"notify::expanded".as_ptr() as *const _,
627 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
628 notify_expanded_trampoline::<Self, F> as *const (),
629 )),
630 Box_::into_raw(f),
631 )
632 }
633 }
634
635 #[cfg_attr(feature = "v1_3", deprecated = "Since 1.3")]
636 #[doc(alias = "icon-name")]
637 fn connect_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
638 unsafe extern "C" fn notify_icon_name_trampoline<
639 P: IsA<ExpanderRow>,
640 F: Fn(&P) + 'static,
641 >(
642 this: *mut ffi::AdwExpanderRow,
643 _param_spec: glib::ffi::gpointer,
644 f: glib::ffi::gpointer,
645 ) {
646 let f: &F = &*(f as *const F);
647 f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref())
648 }
649 unsafe {
650 let f: Box_<F> = Box_::new(f);
651 connect_raw(
652 self.as_ptr() as *mut _,
653 c"notify::icon-name".as_ptr() as *const _,
654 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
655 notify_icon_name_trampoline::<Self, F> as *const (),
656 )),
657 Box_::into_raw(f),
658 )
659 }
660 }
661
662 #[doc(alias = "show-enable-switch")]
663 fn connect_show_enable_switch_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
664 unsafe extern "C" fn notify_show_enable_switch_trampoline<
665 P: IsA<ExpanderRow>,
666 F: Fn(&P) + 'static,
667 >(
668 this: *mut ffi::AdwExpanderRow,
669 _param_spec: glib::ffi::gpointer,
670 f: glib::ffi::gpointer,
671 ) {
672 let f: &F = &*(f as *const F);
673 f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref())
674 }
675 unsafe {
676 let f: Box_<F> = Box_::new(f);
677 connect_raw(
678 self.as_ptr() as *mut _,
679 c"notify::show-enable-switch".as_ptr() as *const _,
680 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
681 notify_show_enable_switch_trampoline::<Self, F> as *const (),
682 )),
683 Box_::into_raw(f),
684 )
685 }
686 }
687
688 #[doc(alias = "subtitle")]
689 fn connect_subtitle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
690 unsafe extern "C" fn notify_subtitle_trampoline<
691 P: IsA<ExpanderRow>,
692 F: Fn(&P) + 'static,
693 >(
694 this: *mut ffi::AdwExpanderRow,
695 _param_spec: glib::ffi::gpointer,
696 f: glib::ffi::gpointer,
697 ) {
698 let f: &F = &*(f as *const F);
699 f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref())
700 }
701 unsafe {
702 let f: Box_<F> = Box_::new(f);
703 connect_raw(
704 self.as_ptr() as *mut _,
705 c"notify::subtitle".as_ptr() as *const _,
706 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
707 notify_subtitle_trampoline::<Self, F> as *const (),
708 )),
709 Box_::into_raw(f),
710 )
711 }
712 }
713
714 #[cfg(feature = "v1_3")]
715 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
716 #[doc(alias = "subtitle-lines")]
717 fn connect_subtitle_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
718 unsafe extern "C" fn notify_subtitle_lines_trampoline<
719 P: IsA<ExpanderRow>,
720 F: Fn(&P) + 'static,
721 >(
722 this: *mut ffi::AdwExpanderRow,
723 _param_spec: glib::ffi::gpointer,
724 f: glib::ffi::gpointer,
725 ) {
726 let f: &F = &*(f as *const F);
727 f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref())
728 }
729 unsafe {
730 let f: Box_<F> = Box_::new(f);
731 connect_raw(
732 self.as_ptr() as *mut _,
733 c"notify::subtitle-lines".as_ptr() as *const _,
734 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
735 notify_subtitle_lines_trampoline::<Self, F> as *const (),
736 )),
737 Box_::into_raw(f),
738 )
739 }
740 }
741
742 #[cfg(feature = "v1_3")]
743 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
744 #[doc(alias = "title-lines")]
745 fn connect_title_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
746 unsafe extern "C" fn notify_title_lines_trampoline<
747 P: IsA<ExpanderRow>,
748 F: Fn(&P) + 'static,
749 >(
750 this: *mut ffi::AdwExpanderRow,
751 _param_spec: glib::ffi::gpointer,
752 f: glib::ffi::gpointer,
753 ) {
754 let f: &F = &*(f as *const F);
755 f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref())
756 }
757 unsafe {
758 let f: Box_<F> = Box_::new(f);
759 connect_raw(
760 self.as_ptr() as *mut _,
761 c"notify::title-lines".as_ptr() as *const _,
762 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
763 notify_title_lines_trampoline::<Self, F> as *const (),
764 )),
765 Box_::into_raw(f),
766 )
767 }
768 }
769}
770
771impl<O: IsA<ExpanderRow>> ExpanderRowExt for O {}