1use crate::{ActionRow, PreferencesRow, ffi};
7use glib::{
8 prelude::*,
9 signal::{SignalHandlerId, connect_raw},
10 translate::*,
11};
12use std::boxed::Box as Box_;
13
14#[cfg(feature = "gtk_v4_10")]
15#[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_10")))]
16glib::wrapper! {
17 #[doc(alias = "AdwComboRow")]
18 pub struct ComboRow(Object<ffi::AdwComboRow, ffi::AdwComboRowClass>) @extends ActionRow, PreferencesRow, gtk::ListBoxRow, gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Actionable;
19
20 match fn {
21 type_ => || ffi::adw_combo_row_get_type(),
22 }
23}
24
25#[cfg(not(feature = "gtk_v4_10"))]
26glib::wrapper! {
27 #[doc(alias = "AdwComboRow")]
28 pub struct ComboRow(Object<ffi::AdwComboRow, ffi::AdwComboRowClass>) @extends ActionRow, PreferencesRow, gtk::ListBoxRow, gtk::Widget, @implements gtk::Buildable, gtk::ConstraintTarget, gtk::Actionable;
29
30 match fn {
31 type_ => || ffi::adw_combo_row_get_type(),
32 }
33}
34
35impl ComboRow {
36 pub const NONE: Option<&'static ComboRow> = None;
37
38 #[doc(alias = "adw_combo_row_new")]
39 pub fn new() -> ComboRow {
40 assert_initialized_main_thread!();
41 unsafe { gtk::Widget::from_glib_none(ffi::adw_combo_row_new()).unsafe_cast() }
42 }
43
44 pub fn builder() -> ComboRowBuilder {
49 ComboRowBuilder::new()
50 }
51}
52
53impl Default for ComboRow {
54 fn default() -> Self {
55 Self::new()
56 }
57}
58
59#[must_use = "The builder must be built to be used"]
64pub struct ComboRowBuilder {
65 builder: glib::object::ObjectBuilder<'static, ComboRow>,
66}
67
68impl ComboRowBuilder {
69 fn new() -> Self {
70 Self {
71 builder: glib::object::Object::builder(),
72 }
73 }
74
75 #[cfg(feature = "v1_4")]
76 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
77 pub fn enable_search(self, enable_search: bool) -> Self {
78 Self {
79 builder: self.builder.property("enable-search", enable_search),
80 }
81 }
82
83 pub fn expression(self, expression: impl AsRef<gtk::Expression>) -> Self {
84 Self {
85 builder: self
86 .builder
87 .property("expression", expression.as_ref().clone()),
88 }
89 }
90
91 pub fn factory(self, factory: &impl IsA<gtk::ListItemFactory>) -> Self {
92 Self {
93 builder: self.builder.property("factory", factory.clone().upcast()),
94 }
95 }
96
97 #[cfg(feature = "v1_6")]
98 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
99 pub fn header_factory(self, header_factory: &impl IsA<gtk::ListItemFactory>) -> Self {
100 Self {
101 builder: self
102 .builder
103 .property("header-factory", header_factory.clone().upcast()),
104 }
105 }
106
107 pub fn list_factory(self, list_factory: &impl IsA<gtk::ListItemFactory>) -> Self {
108 Self {
109 builder: self
110 .builder
111 .property("list-factory", list_factory.clone().upcast()),
112 }
113 }
114
115 pub fn model(self, model: &impl IsA<gio::ListModel>) -> Self {
116 Self {
117 builder: self.builder.property("model", model.clone().upcast()),
118 }
119 }
120
121 #[cfg(feature = "v1_6")]
122 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
123 pub fn search_match_mode(self, search_match_mode: gtk::StringFilterMatchMode) -> Self {
124 Self {
125 builder: self
126 .builder
127 .property("search-match-mode", search_match_mode),
128 }
129 }
130
131 pub fn selected(self, selected: u32) -> Self {
132 Self {
133 builder: self.builder.property("selected", selected),
134 }
135 }
136
137 pub fn use_subtitle(self, use_subtitle: bool) -> Self {
138 Self {
139 builder: self.builder.property("use-subtitle", use_subtitle),
140 }
141 }
142
143 pub fn activatable_widget(self, activatable_widget: &impl IsA<gtk::Widget>) -> Self {
144 Self {
145 builder: self
146 .builder
147 .property("activatable-widget", activatable_widget.clone().upcast()),
148 }
149 }
150
151 #[cfg_attr(feature = "v1_3", deprecated = "Since 1.3")]
152 pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
153 Self {
154 builder: self.builder.property("icon-name", icon_name.into()),
155 }
156 }
157
158 pub fn subtitle(self, subtitle: impl Into<glib::GString>) -> Self {
159 Self {
160 builder: self.builder.property("subtitle", subtitle.into()),
161 }
162 }
163
164 pub fn subtitle_lines(self, subtitle_lines: i32) -> Self {
165 Self {
166 builder: self.builder.property("subtitle-lines", subtitle_lines),
167 }
168 }
169
170 #[cfg(feature = "v1_3")]
171 #[cfg_attr(docsrs, doc(cfg(feature = "v1_3")))]
172 pub fn subtitle_selectable(self, subtitle_selectable: bool) -> Self {
173 Self {
174 builder: self
175 .builder
176 .property("subtitle-selectable", subtitle_selectable),
177 }
178 }
179
180 pub fn title_lines(self, title_lines: i32) -> Self {
181 Self {
182 builder: self.builder.property("title-lines", title_lines),
183 }
184 }
185
186 pub fn title(self, title: impl Into<glib::GString>) -> Self {
187 Self {
188 builder: self.builder.property("title", title.into()),
189 }
190 }
191
192 #[cfg(feature = "v1_1")]
193 #[cfg_attr(docsrs, doc(cfg(feature = "v1_1")))]
194 pub fn title_selectable(self, title_selectable: bool) -> Self {
195 Self {
196 builder: self.builder.property("title-selectable", title_selectable),
197 }
198 }
199
200 #[cfg(feature = "v1_2")]
201 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
202 pub fn use_markup(self, use_markup: bool) -> Self {
203 Self {
204 builder: self.builder.property("use-markup", use_markup),
205 }
206 }
207
208 pub fn use_underline(self, use_underline: bool) -> Self {
209 Self {
210 builder: self.builder.property("use-underline", use_underline),
211 }
212 }
213
214 pub fn activatable(self, activatable: bool) -> Self {
215 Self {
216 builder: self.builder.property("activatable", activatable),
217 }
218 }
219
220 pub fn child(self, child: &impl IsA<gtk::Widget>) -> Self {
221 Self {
222 builder: self.builder.property("child", child.clone().upcast()),
223 }
224 }
225
226 pub fn selectable(self, selectable: bool) -> Self {
227 Self {
228 builder: self.builder.property("selectable", selectable),
229 }
230 }
231
232 pub fn can_focus(self, can_focus: bool) -> Self {
233 Self {
234 builder: self.builder.property("can-focus", can_focus),
235 }
236 }
237
238 pub fn can_target(self, can_target: bool) -> Self {
239 Self {
240 builder: self.builder.property("can-target", can_target),
241 }
242 }
243
244 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
245 Self {
246 builder: self.builder.property("css-classes", css_classes.into()),
247 }
248 }
249
250 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
251 Self {
252 builder: self.builder.property("css-name", css_name.into()),
253 }
254 }
255
256 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
257 Self {
258 builder: self.builder.property("cursor", cursor.clone()),
259 }
260 }
261
262 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
263 Self {
264 builder: self.builder.property("focus-on-click", focus_on_click),
265 }
266 }
267
268 pub fn focusable(self, focusable: bool) -> Self {
269 Self {
270 builder: self.builder.property("focusable", focusable),
271 }
272 }
273
274 pub fn halign(self, halign: gtk::Align) -> Self {
275 Self {
276 builder: self.builder.property("halign", halign),
277 }
278 }
279
280 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
281 Self {
282 builder: self.builder.property("has-tooltip", has_tooltip),
283 }
284 }
285
286 pub fn height_request(self, height_request: i32) -> Self {
287 Self {
288 builder: self.builder.property("height-request", height_request),
289 }
290 }
291
292 pub fn hexpand(self, hexpand: bool) -> Self {
293 Self {
294 builder: self.builder.property("hexpand", hexpand),
295 }
296 }
297
298 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
299 Self {
300 builder: self.builder.property("hexpand-set", hexpand_set),
301 }
302 }
303
304 pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
305 Self {
306 builder: self
307 .builder
308 .property("layout-manager", layout_manager.clone().upcast()),
309 }
310 }
311
312 #[cfg(feature = "gtk_v4_18")]
313 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
314 pub fn limit_events(self, limit_events: bool) -> Self {
315 Self {
316 builder: self.builder.property("limit-events", limit_events),
317 }
318 }
319
320 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
321 Self {
322 builder: self.builder.property("margin-bottom", margin_bottom),
323 }
324 }
325
326 pub fn margin_end(self, margin_end: i32) -> Self {
327 Self {
328 builder: self.builder.property("margin-end", margin_end),
329 }
330 }
331
332 pub fn margin_start(self, margin_start: i32) -> Self {
333 Self {
334 builder: self.builder.property("margin-start", margin_start),
335 }
336 }
337
338 pub fn margin_top(self, margin_top: i32) -> Self {
339 Self {
340 builder: self.builder.property("margin-top", margin_top),
341 }
342 }
343
344 pub fn name(self, name: impl Into<glib::GString>) -> Self {
345 Self {
346 builder: self.builder.property("name", name.into()),
347 }
348 }
349
350 pub fn opacity(self, opacity: f64) -> Self {
351 Self {
352 builder: self.builder.property("opacity", opacity),
353 }
354 }
355
356 pub fn overflow(self, overflow: gtk::Overflow) -> Self {
357 Self {
358 builder: self.builder.property("overflow", overflow),
359 }
360 }
361
362 pub fn receives_default(self, receives_default: bool) -> Self {
363 Self {
364 builder: self.builder.property("receives-default", receives_default),
365 }
366 }
367
368 pub fn sensitive(self, sensitive: bool) -> Self {
369 Self {
370 builder: self.builder.property("sensitive", sensitive),
371 }
372 }
373
374 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
375 Self {
376 builder: self
377 .builder
378 .property("tooltip-markup", tooltip_markup.into()),
379 }
380 }
381
382 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
383 Self {
384 builder: self.builder.property("tooltip-text", tooltip_text.into()),
385 }
386 }
387
388 pub fn valign(self, valign: gtk::Align) -> Self {
389 Self {
390 builder: self.builder.property("valign", valign),
391 }
392 }
393
394 pub fn vexpand(self, vexpand: bool) -> Self {
395 Self {
396 builder: self.builder.property("vexpand", vexpand),
397 }
398 }
399
400 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
401 Self {
402 builder: self.builder.property("vexpand-set", vexpand_set),
403 }
404 }
405
406 pub fn visible(self, visible: bool) -> Self {
407 Self {
408 builder: self.builder.property("visible", visible),
409 }
410 }
411
412 pub fn width_request(self, width_request: i32) -> Self {
413 Self {
414 builder: self.builder.property("width-request", width_request),
415 }
416 }
417
418 pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
419 Self {
420 builder: self.builder.property("accessible-role", accessible_role),
421 }
422 }
423
424 pub fn action_name(self, action_name: impl Into<glib::GString>) -> Self {
425 Self {
426 builder: self.builder.property("action-name", action_name.into()),
427 }
428 }
429
430 pub fn action_target(self, action_target: &glib::Variant) -> Self {
431 Self {
432 builder: self
433 .builder
434 .property("action-target", action_target.clone()),
435 }
436 }
437
438 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
441 pub fn build(self) -> ComboRow {
442 assert_initialized_main_thread!();
443 self.builder.build()
444 }
445}
446
447pub trait ComboRowExt: IsA<ComboRow> + 'static {
448 #[cfg(feature = "v1_4")]
449 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
450 #[doc(alias = "adw_combo_row_get_enable_search")]
451 #[doc(alias = "get_enable_search")]
452 #[doc(alias = "enable-search")]
453 fn enables_search(&self) -> bool {
454 unsafe {
455 from_glib(ffi::adw_combo_row_get_enable_search(
456 self.as_ref().to_glib_none().0,
457 ))
458 }
459 }
460
461 #[doc(alias = "adw_combo_row_get_expression")]
462 #[doc(alias = "get_expression")]
463 fn expression(&self) -> Option<gtk::Expression> {
464 unsafe {
465 from_glib_none(ffi::adw_combo_row_get_expression(
466 self.as_ref().to_glib_none().0,
467 ))
468 }
469 }
470
471 #[doc(alias = "adw_combo_row_get_factory")]
472 #[doc(alias = "get_factory")]
473 fn factory(&self) -> Option<gtk::ListItemFactory> {
474 unsafe {
475 from_glib_none(ffi::adw_combo_row_get_factory(
476 self.as_ref().to_glib_none().0,
477 ))
478 }
479 }
480
481 #[cfg(feature = "v1_6")]
482 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
483 #[doc(alias = "adw_combo_row_get_header_factory")]
484 #[doc(alias = "get_header_factory")]
485 #[doc(alias = "header-factory")]
486 fn header_factory(&self) -> Option<gtk::ListItemFactory> {
487 unsafe {
488 from_glib_none(ffi::adw_combo_row_get_header_factory(
489 self.as_ref().to_glib_none().0,
490 ))
491 }
492 }
493
494 #[doc(alias = "adw_combo_row_get_list_factory")]
495 #[doc(alias = "get_list_factory")]
496 #[doc(alias = "list-factory")]
497 fn list_factory(&self) -> Option<gtk::ListItemFactory> {
498 unsafe {
499 from_glib_none(ffi::adw_combo_row_get_list_factory(
500 self.as_ref().to_glib_none().0,
501 ))
502 }
503 }
504
505 #[doc(alias = "adw_combo_row_get_model")]
506 #[doc(alias = "get_model")]
507 fn model(&self) -> Option<gio::ListModel> {
508 unsafe { from_glib_none(ffi::adw_combo_row_get_model(self.as_ref().to_glib_none().0)) }
509 }
510
511 #[cfg(feature = "v1_6")]
512 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
513 #[doc(alias = "adw_combo_row_get_search_match_mode")]
514 #[doc(alias = "get_search_match_mode")]
515 #[doc(alias = "search-match-mode")]
516 fn search_match_mode(&self) -> gtk::StringFilterMatchMode {
517 unsafe {
518 from_glib(ffi::adw_combo_row_get_search_match_mode(
519 self.as_ref().to_glib_none().0,
520 ))
521 }
522 }
523
524 #[doc(alias = "adw_combo_row_get_selected")]
525 #[doc(alias = "get_selected")]
526 fn selected(&self) -> u32 {
527 unsafe { ffi::adw_combo_row_get_selected(self.as_ref().to_glib_none().0) }
528 }
529
530 #[doc(alias = "adw_combo_row_get_selected_item")]
531 #[doc(alias = "get_selected_item")]
532 #[doc(alias = "selected-item")]
533 fn selected_item(&self) -> Option<glib::Object> {
534 unsafe {
535 from_glib_none(ffi::adw_combo_row_get_selected_item(
536 self.as_ref().to_glib_none().0,
537 ))
538 }
539 }
540
541 #[doc(alias = "adw_combo_row_get_use_subtitle")]
542 #[doc(alias = "get_use_subtitle")]
543 #[doc(alias = "use-subtitle")]
544 fn uses_subtitle(&self) -> bool {
545 unsafe {
546 from_glib(ffi::adw_combo_row_get_use_subtitle(
547 self.as_ref().to_glib_none().0,
548 ))
549 }
550 }
551
552 #[cfg(feature = "v1_4")]
553 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
554 #[doc(alias = "adw_combo_row_set_enable_search")]
555 #[doc(alias = "enable-search")]
556 fn set_enable_search(&self, enable_search: bool) {
557 unsafe {
558 ffi::adw_combo_row_set_enable_search(
559 self.as_ref().to_glib_none().0,
560 enable_search.into_glib(),
561 );
562 }
563 }
564
565 #[doc(alias = "adw_combo_row_set_expression")]
566 #[doc(alias = "expression")]
567 fn set_expression(&self, expression: Option<impl AsRef<gtk::Expression>>) {
568 unsafe {
569 ffi::adw_combo_row_set_expression(
570 self.as_ref().to_glib_none().0,
571 expression.as_ref().map(|p| p.as_ref()).to_glib_none().0,
572 );
573 }
574 }
575
576 #[doc(alias = "adw_combo_row_set_factory")]
577 #[doc(alias = "factory")]
578 fn set_factory(&self, factory: Option<&impl IsA<gtk::ListItemFactory>>) {
579 unsafe {
580 ffi::adw_combo_row_set_factory(
581 self.as_ref().to_glib_none().0,
582 factory.map(|p| p.as_ref()).to_glib_none().0,
583 );
584 }
585 }
586
587 #[cfg(feature = "v1_6")]
588 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
589 #[doc(alias = "adw_combo_row_set_header_factory")]
590 #[doc(alias = "header-factory")]
591 fn set_header_factory(&self, factory: Option<&impl IsA<gtk::ListItemFactory>>) {
592 unsafe {
593 ffi::adw_combo_row_set_header_factory(
594 self.as_ref().to_glib_none().0,
595 factory.map(|p| p.as_ref()).to_glib_none().0,
596 );
597 }
598 }
599
600 #[doc(alias = "adw_combo_row_set_list_factory")]
601 #[doc(alias = "list-factory")]
602 fn set_list_factory(&self, factory: Option<&impl IsA<gtk::ListItemFactory>>) {
603 unsafe {
604 ffi::adw_combo_row_set_list_factory(
605 self.as_ref().to_glib_none().0,
606 factory.map(|p| p.as_ref()).to_glib_none().0,
607 );
608 }
609 }
610
611 #[doc(alias = "adw_combo_row_set_model")]
612 #[doc(alias = "model")]
613 fn set_model(&self, model: Option<&impl IsA<gio::ListModel>>) {
614 unsafe {
615 ffi::adw_combo_row_set_model(
616 self.as_ref().to_glib_none().0,
617 model.map(|p| p.as_ref()).to_glib_none().0,
618 );
619 }
620 }
621
622 #[cfg(feature = "v1_6")]
623 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
624 #[doc(alias = "adw_combo_row_set_search_match_mode")]
625 #[doc(alias = "search-match-mode")]
626 fn set_search_match_mode(&self, search_match_mode: gtk::StringFilterMatchMode) {
627 unsafe {
628 ffi::adw_combo_row_set_search_match_mode(
629 self.as_ref().to_glib_none().0,
630 search_match_mode.into_glib(),
631 );
632 }
633 }
634
635 #[doc(alias = "adw_combo_row_set_selected")]
636 #[doc(alias = "selected")]
637 fn set_selected(&self, position: u32) {
638 unsafe {
639 ffi::adw_combo_row_set_selected(self.as_ref().to_glib_none().0, position);
640 }
641 }
642
643 #[doc(alias = "adw_combo_row_set_use_subtitle")]
644 #[doc(alias = "use-subtitle")]
645 fn set_use_subtitle(&self, use_subtitle: bool) {
646 unsafe {
647 ffi::adw_combo_row_set_use_subtitle(
648 self.as_ref().to_glib_none().0,
649 use_subtitle.into_glib(),
650 );
651 }
652 }
653
654 #[cfg(feature = "v1_4")]
655 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
656 #[doc(alias = "enable-search")]
657 fn connect_enable_search_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
658 unsafe extern "C" fn notify_enable_search_trampoline<
659 P: IsA<ComboRow>,
660 F: Fn(&P) + 'static,
661 >(
662 this: *mut ffi::AdwComboRow,
663 _param_spec: glib::ffi::gpointer,
664 f: glib::ffi::gpointer,
665 ) {
666 unsafe {
667 let f: &F = &*(f as *const F);
668 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
669 }
670 }
671 unsafe {
672 let f: Box_<F> = Box_::new(f);
673 connect_raw(
674 self.as_ptr() as *mut _,
675 c"notify::enable-search".as_ptr(),
676 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
677 notify_enable_search_trampoline::<Self, F> as *const (),
678 )),
679 Box_::into_raw(f),
680 )
681 }
682 }
683
684 #[doc(alias = "expression")]
685 fn connect_expression_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
686 unsafe extern "C" fn notify_expression_trampoline<P: IsA<ComboRow>, F: Fn(&P) + 'static>(
687 this: *mut ffi::AdwComboRow,
688 _param_spec: glib::ffi::gpointer,
689 f: glib::ffi::gpointer,
690 ) {
691 unsafe {
692 let f: &F = &*(f as *const F);
693 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
694 }
695 }
696 unsafe {
697 let f: Box_<F> = Box_::new(f);
698 connect_raw(
699 self.as_ptr() as *mut _,
700 c"notify::expression".as_ptr(),
701 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
702 notify_expression_trampoline::<Self, F> as *const (),
703 )),
704 Box_::into_raw(f),
705 )
706 }
707 }
708
709 #[doc(alias = "factory")]
710 fn connect_factory_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
711 unsafe extern "C" fn notify_factory_trampoline<P: IsA<ComboRow>, F: Fn(&P) + 'static>(
712 this: *mut ffi::AdwComboRow,
713 _param_spec: glib::ffi::gpointer,
714 f: glib::ffi::gpointer,
715 ) {
716 unsafe {
717 let f: &F = &*(f as *const F);
718 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
719 }
720 }
721 unsafe {
722 let f: Box_<F> = Box_::new(f);
723 connect_raw(
724 self.as_ptr() as *mut _,
725 c"notify::factory".as_ptr(),
726 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
727 notify_factory_trampoline::<Self, F> as *const (),
728 )),
729 Box_::into_raw(f),
730 )
731 }
732 }
733
734 #[cfg(feature = "v1_6")]
735 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
736 #[doc(alias = "header-factory")]
737 fn connect_header_factory_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
738 unsafe extern "C" fn notify_header_factory_trampoline<
739 P: IsA<ComboRow>,
740 F: Fn(&P) + 'static,
741 >(
742 this: *mut ffi::AdwComboRow,
743 _param_spec: glib::ffi::gpointer,
744 f: glib::ffi::gpointer,
745 ) {
746 unsafe {
747 let f: &F = &*(f as *const F);
748 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
749 }
750 }
751 unsafe {
752 let f: Box_<F> = Box_::new(f);
753 connect_raw(
754 self.as_ptr() as *mut _,
755 c"notify::header-factory".as_ptr(),
756 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
757 notify_header_factory_trampoline::<Self, F> as *const (),
758 )),
759 Box_::into_raw(f),
760 )
761 }
762 }
763
764 #[doc(alias = "list-factory")]
765 fn connect_list_factory_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
766 unsafe extern "C" fn notify_list_factory_trampoline<
767 P: IsA<ComboRow>,
768 F: Fn(&P) + 'static,
769 >(
770 this: *mut ffi::AdwComboRow,
771 _param_spec: glib::ffi::gpointer,
772 f: glib::ffi::gpointer,
773 ) {
774 unsafe {
775 let f: &F = &*(f as *const F);
776 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
777 }
778 }
779 unsafe {
780 let f: Box_<F> = Box_::new(f);
781 connect_raw(
782 self.as_ptr() as *mut _,
783 c"notify::list-factory".as_ptr(),
784 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
785 notify_list_factory_trampoline::<Self, F> as *const (),
786 )),
787 Box_::into_raw(f),
788 )
789 }
790 }
791
792 #[doc(alias = "model")]
793 fn connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
794 unsafe extern "C" fn notify_model_trampoline<P: IsA<ComboRow>, F: Fn(&P) + 'static>(
795 this: *mut ffi::AdwComboRow,
796 _param_spec: glib::ffi::gpointer,
797 f: glib::ffi::gpointer,
798 ) {
799 unsafe {
800 let f: &F = &*(f as *const F);
801 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
802 }
803 }
804 unsafe {
805 let f: Box_<F> = Box_::new(f);
806 connect_raw(
807 self.as_ptr() as *mut _,
808 c"notify::model".as_ptr(),
809 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
810 notify_model_trampoline::<Self, F> as *const (),
811 )),
812 Box_::into_raw(f),
813 )
814 }
815 }
816
817 #[cfg(feature = "v1_6")]
818 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
819 #[doc(alias = "search-match-mode")]
820 fn connect_search_match_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
821 unsafe extern "C" fn notify_search_match_mode_trampoline<
822 P: IsA<ComboRow>,
823 F: Fn(&P) + 'static,
824 >(
825 this: *mut ffi::AdwComboRow,
826 _param_spec: glib::ffi::gpointer,
827 f: glib::ffi::gpointer,
828 ) {
829 unsafe {
830 let f: &F = &*(f as *const F);
831 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
832 }
833 }
834 unsafe {
835 let f: Box_<F> = Box_::new(f);
836 connect_raw(
837 self.as_ptr() as *mut _,
838 c"notify::search-match-mode".as_ptr(),
839 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
840 notify_search_match_mode_trampoline::<Self, F> as *const (),
841 )),
842 Box_::into_raw(f),
843 )
844 }
845 }
846
847 #[doc(alias = "selected")]
848 fn connect_selected_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
849 unsafe extern "C" fn notify_selected_trampoline<P: IsA<ComboRow>, F: Fn(&P) + 'static>(
850 this: *mut ffi::AdwComboRow,
851 _param_spec: glib::ffi::gpointer,
852 f: glib::ffi::gpointer,
853 ) {
854 unsafe {
855 let f: &F = &*(f as *const F);
856 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
857 }
858 }
859 unsafe {
860 let f: Box_<F> = Box_::new(f);
861 connect_raw(
862 self.as_ptr() as *mut _,
863 c"notify::selected".as_ptr(),
864 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
865 notify_selected_trampoline::<Self, F> as *const (),
866 )),
867 Box_::into_raw(f),
868 )
869 }
870 }
871
872 #[doc(alias = "selected-item")]
873 fn connect_selected_item_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
874 unsafe extern "C" fn notify_selected_item_trampoline<
875 P: IsA<ComboRow>,
876 F: Fn(&P) + 'static,
877 >(
878 this: *mut ffi::AdwComboRow,
879 _param_spec: glib::ffi::gpointer,
880 f: glib::ffi::gpointer,
881 ) {
882 unsafe {
883 let f: &F = &*(f as *const F);
884 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
885 }
886 }
887 unsafe {
888 let f: Box_<F> = Box_::new(f);
889 connect_raw(
890 self.as_ptr() as *mut _,
891 c"notify::selected-item".as_ptr(),
892 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
893 notify_selected_item_trampoline::<Self, F> as *const (),
894 )),
895 Box_::into_raw(f),
896 )
897 }
898 }
899
900 #[doc(alias = "use-subtitle")]
901 fn connect_use_subtitle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
902 unsafe extern "C" fn notify_use_subtitle_trampoline<
903 P: IsA<ComboRow>,
904 F: Fn(&P) + 'static,
905 >(
906 this: *mut ffi::AdwComboRow,
907 _param_spec: glib::ffi::gpointer,
908 f: glib::ffi::gpointer,
909 ) {
910 unsafe {
911 let f: &F = &*(f as *const F);
912 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
913 }
914 }
915 unsafe {
916 let f: Box_<F> = Box_::new(f);
917 connect_raw(
918 self.as_ptr() as *mut _,
919 c"notify::use-subtitle".as_ptr(),
920 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
921 notify_use_subtitle_trampoline::<Self, F> as *const (),
922 )),
923 Box_::into_raw(f),
924 )
925 }
926 }
927}
928
929impl<O: IsA<ComboRow>> ComboRowExt for O {}