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