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 #[cfg(feature = "gtk_v4_18")]
301 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
302 pub fn limit_events(self, limit_events: bool) -> Self {
303 Self {
304 builder: self.builder.property("limit-events", limit_events),
305 }
306 }
307
308 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
309 Self {
310 builder: self.builder.property("margin-bottom", margin_bottom),
311 }
312 }
313
314 pub fn margin_end(self, margin_end: i32) -> Self {
315 Self {
316 builder: self.builder.property("margin-end", margin_end),
317 }
318 }
319
320 pub fn margin_start(self, margin_start: i32) -> Self {
321 Self {
322 builder: self.builder.property("margin-start", margin_start),
323 }
324 }
325
326 pub fn margin_top(self, margin_top: i32) -> Self {
327 Self {
328 builder: self.builder.property("margin-top", margin_top),
329 }
330 }
331
332 pub fn name(self, name: impl Into<glib::GString>) -> Self {
333 Self {
334 builder: self.builder.property("name", name.into()),
335 }
336 }
337
338 pub fn opacity(self, opacity: f64) -> Self {
339 Self {
340 builder: self.builder.property("opacity", opacity),
341 }
342 }
343
344 pub fn overflow(self, overflow: gtk::Overflow) -> Self {
345 Self {
346 builder: self.builder.property("overflow", overflow),
347 }
348 }
349
350 pub fn receives_default(self, receives_default: bool) -> Self {
351 Self {
352 builder: self.builder.property("receives-default", receives_default),
353 }
354 }
355
356 pub fn sensitive(self, sensitive: bool) -> Self {
357 Self {
358 builder: self.builder.property("sensitive", sensitive),
359 }
360 }
361
362 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
363 Self {
364 builder: self
365 .builder
366 .property("tooltip-markup", tooltip_markup.into()),
367 }
368 }
369
370 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
371 Self {
372 builder: self.builder.property("tooltip-text", tooltip_text.into()),
373 }
374 }
375
376 pub fn valign(self, valign: gtk::Align) -> Self {
377 Self {
378 builder: self.builder.property("valign", valign),
379 }
380 }
381
382 pub fn vexpand(self, vexpand: bool) -> Self {
383 Self {
384 builder: self.builder.property("vexpand", vexpand),
385 }
386 }
387
388 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
389 Self {
390 builder: self.builder.property("vexpand-set", vexpand_set),
391 }
392 }
393
394 pub fn visible(self, visible: bool) -> Self {
395 Self {
396 builder: self.builder.property("visible", visible),
397 }
398 }
399
400 pub fn width_request(self, width_request: i32) -> Self {
401 Self {
402 builder: self.builder.property("width-request", width_request),
403 }
404 }
405
406 pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
407 Self {
408 builder: self.builder.property("accessible-role", accessible_role),
409 }
410 }
411
412 pub fn action_name(self, action_name: impl Into<glib::GString>) -> Self {
413 Self {
414 builder: self.builder.property("action-name", action_name.into()),
415 }
416 }
417
418 pub fn action_target(self, action_target: &glib::Variant) -> Self {
419 Self {
420 builder: self
421 .builder
422 .property("action-target", action_target.clone()),
423 }
424 }
425
426 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
429 pub fn build(self) -> ComboRow {
430 assert_initialized_main_thread!();
431 self.builder.build()
432 }
433}
434
435pub trait ComboRowExt: IsA<ComboRow> + 'static {
436 #[cfg(feature = "v1_4")]
437 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
438 #[doc(alias = "adw_combo_row_get_enable_search")]
439 #[doc(alias = "get_enable_search")]
440 #[doc(alias = "enable-search")]
441 fn enables_search(&self) -> bool {
442 unsafe {
443 from_glib(ffi::adw_combo_row_get_enable_search(
444 self.as_ref().to_glib_none().0,
445 ))
446 }
447 }
448
449 #[doc(alias = "adw_combo_row_get_expression")]
450 #[doc(alias = "get_expression")]
451 fn expression(&self) -> Option<gtk::Expression> {
452 unsafe {
453 from_glib_none(ffi::adw_combo_row_get_expression(
454 self.as_ref().to_glib_none().0,
455 ))
456 }
457 }
458
459 #[doc(alias = "adw_combo_row_get_factory")]
460 #[doc(alias = "get_factory")]
461 fn factory(&self) -> Option<gtk::ListItemFactory> {
462 unsafe {
463 from_glib_none(ffi::adw_combo_row_get_factory(
464 self.as_ref().to_glib_none().0,
465 ))
466 }
467 }
468
469 #[cfg(feature = "v1_6")]
470 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
471 #[doc(alias = "adw_combo_row_get_header_factory")]
472 #[doc(alias = "get_header_factory")]
473 #[doc(alias = "header-factory")]
474 fn header_factory(&self) -> Option<gtk::ListItemFactory> {
475 unsafe {
476 from_glib_none(ffi::adw_combo_row_get_header_factory(
477 self.as_ref().to_glib_none().0,
478 ))
479 }
480 }
481
482 #[doc(alias = "adw_combo_row_get_list_factory")]
483 #[doc(alias = "get_list_factory")]
484 #[doc(alias = "list-factory")]
485 fn list_factory(&self) -> Option<gtk::ListItemFactory> {
486 unsafe {
487 from_glib_none(ffi::adw_combo_row_get_list_factory(
488 self.as_ref().to_glib_none().0,
489 ))
490 }
491 }
492
493 #[doc(alias = "adw_combo_row_get_model")]
494 #[doc(alias = "get_model")]
495 fn model(&self) -> Option<gio::ListModel> {
496 unsafe { from_glib_none(ffi::adw_combo_row_get_model(self.as_ref().to_glib_none().0)) }
497 }
498
499 #[cfg(feature = "v1_6")]
500 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
501 #[doc(alias = "adw_combo_row_get_search_match_mode")]
502 #[doc(alias = "get_search_match_mode")]
503 #[doc(alias = "search-match-mode")]
504 fn search_match_mode(&self) -> gtk::StringFilterMatchMode {
505 unsafe {
506 from_glib(ffi::adw_combo_row_get_search_match_mode(
507 self.as_ref().to_glib_none().0,
508 ))
509 }
510 }
511
512 #[doc(alias = "adw_combo_row_get_selected")]
513 #[doc(alias = "get_selected")]
514 fn selected(&self) -> u32 {
515 unsafe { ffi::adw_combo_row_get_selected(self.as_ref().to_glib_none().0) }
516 }
517
518 #[doc(alias = "adw_combo_row_get_selected_item")]
519 #[doc(alias = "get_selected_item")]
520 #[doc(alias = "selected-item")]
521 fn selected_item(&self) -> Option<glib::Object> {
522 unsafe {
523 from_glib_none(ffi::adw_combo_row_get_selected_item(
524 self.as_ref().to_glib_none().0,
525 ))
526 }
527 }
528
529 #[doc(alias = "adw_combo_row_get_use_subtitle")]
530 #[doc(alias = "get_use_subtitle")]
531 #[doc(alias = "use-subtitle")]
532 fn uses_subtitle(&self) -> bool {
533 unsafe {
534 from_glib(ffi::adw_combo_row_get_use_subtitle(
535 self.as_ref().to_glib_none().0,
536 ))
537 }
538 }
539
540 #[cfg(feature = "v1_4")]
541 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
542 #[doc(alias = "adw_combo_row_set_enable_search")]
543 #[doc(alias = "enable-search")]
544 fn set_enable_search(&self, enable_search: bool) {
545 unsafe {
546 ffi::adw_combo_row_set_enable_search(
547 self.as_ref().to_glib_none().0,
548 enable_search.into_glib(),
549 );
550 }
551 }
552
553 #[doc(alias = "adw_combo_row_set_expression")]
554 #[doc(alias = "expression")]
555 fn set_expression(&self, expression: Option<impl AsRef<gtk::Expression>>) {
556 unsafe {
557 ffi::adw_combo_row_set_expression(
558 self.as_ref().to_glib_none().0,
559 expression.as_ref().map(|p| p.as_ref()).to_glib_none().0,
560 );
561 }
562 }
563
564 #[doc(alias = "adw_combo_row_set_factory")]
565 #[doc(alias = "factory")]
566 fn set_factory(&self, factory: Option<&impl IsA<gtk::ListItemFactory>>) {
567 unsafe {
568 ffi::adw_combo_row_set_factory(
569 self.as_ref().to_glib_none().0,
570 factory.map(|p| p.as_ref()).to_glib_none().0,
571 );
572 }
573 }
574
575 #[cfg(feature = "v1_6")]
576 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
577 #[doc(alias = "adw_combo_row_set_header_factory")]
578 #[doc(alias = "header-factory")]
579 fn set_header_factory(&self, factory: Option<&impl IsA<gtk::ListItemFactory>>) {
580 unsafe {
581 ffi::adw_combo_row_set_header_factory(
582 self.as_ref().to_glib_none().0,
583 factory.map(|p| p.as_ref()).to_glib_none().0,
584 );
585 }
586 }
587
588 #[doc(alias = "adw_combo_row_set_list_factory")]
589 #[doc(alias = "list-factory")]
590 fn set_list_factory(&self, factory: Option<&impl IsA<gtk::ListItemFactory>>) {
591 unsafe {
592 ffi::adw_combo_row_set_list_factory(
593 self.as_ref().to_glib_none().0,
594 factory.map(|p| p.as_ref()).to_glib_none().0,
595 );
596 }
597 }
598
599 #[doc(alias = "adw_combo_row_set_model")]
600 #[doc(alias = "model")]
601 fn set_model(&self, model: Option<&impl IsA<gio::ListModel>>) {
602 unsafe {
603 ffi::adw_combo_row_set_model(
604 self.as_ref().to_glib_none().0,
605 model.map(|p| p.as_ref()).to_glib_none().0,
606 );
607 }
608 }
609
610 #[cfg(feature = "v1_6")]
611 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
612 #[doc(alias = "adw_combo_row_set_search_match_mode")]
613 #[doc(alias = "search-match-mode")]
614 fn set_search_match_mode(&self, search_match_mode: gtk::StringFilterMatchMode) {
615 unsafe {
616 ffi::adw_combo_row_set_search_match_mode(
617 self.as_ref().to_glib_none().0,
618 search_match_mode.into_glib(),
619 );
620 }
621 }
622
623 #[doc(alias = "adw_combo_row_set_selected")]
624 #[doc(alias = "selected")]
625 fn set_selected(&self, position: u32) {
626 unsafe {
627 ffi::adw_combo_row_set_selected(self.as_ref().to_glib_none().0, position);
628 }
629 }
630
631 #[doc(alias = "adw_combo_row_set_use_subtitle")]
632 #[doc(alias = "use-subtitle")]
633 fn set_use_subtitle(&self, use_subtitle: bool) {
634 unsafe {
635 ffi::adw_combo_row_set_use_subtitle(
636 self.as_ref().to_glib_none().0,
637 use_subtitle.into_glib(),
638 );
639 }
640 }
641
642 #[cfg(feature = "v1_4")]
643 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
644 #[doc(alias = "enable-search")]
645 fn connect_enable_search_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
646 unsafe extern "C" fn notify_enable_search_trampoline<
647 P: IsA<ComboRow>,
648 F: Fn(&P) + 'static,
649 >(
650 this: *mut ffi::AdwComboRow,
651 _param_spec: glib::ffi::gpointer,
652 f: glib::ffi::gpointer,
653 ) {
654 let f: &F = &*(f as *const F);
655 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
656 }
657 unsafe {
658 let f: Box_<F> = Box_::new(f);
659 connect_raw(
660 self.as_ptr() as *mut _,
661 c"notify::enable-search".as_ptr() as *const _,
662 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
663 notify_enable_search_trampoline::<Self, F> as *const (),
664 )),
665 Box_::into_raw(f),
666 )
667 }
668 }
669
670 #[doc(alias = "expression")]
671 fn connect_expression_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
672 unsafe extern "C" fn notify_expression_trampoline<P: IsA<ComboRow>, F: Fn(&P) + 'static>(
673 this: *mut ffi::AdwComboRow,
674 _param_spec: glib::ffi::gpointer,
675 f: glib::ffi::gpointer,
676 ) {
677 let f: &F = &*(f as *const F);
678 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
679 }
680 unsafe {
681 let f: Box_<F> = Box_::new(f);
682 connect_raw(
683 self.as_ptr() as *mut _,
684 c"notify::expression".as_ptr() as *const _,
685 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
686 notify_expression_trampoline::<Self, F> as *const (),
687 )),
688 Box_::into_raw(f),
689 )
690 }
691 }
692
693 #[doc(alias = "factory")]
694 fn connect_factory_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
695 unsafe extern "C" fn notify_factory_trampoline<P: IsA<ComboRow>, F: Fn(&P) + 'static>(
696 this: *mut ffi::AdwComboRow,
697 _param_spec: glib::ffi::gpointer,
698 f: glib::ffi::gpointer,
699 ) {
700 let f: &F = &*(f as *const F);
701 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
702 }
703 unsafe {
704 let f: Box_<F> = Box_::new(f);
705 connect_raw(
706 self.as_ptr() as *mut _,
707 c"notify::factory".as_ptr() as *const _,
708 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
709 notify_factory_trampoline::<Self, F> as *const (),
710 )),
711 Box_::into_raw(f),
712 )
713 }
714 }
715
716 #[cfg(feature = "v1_6")]
717 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
718 #[doc(alias = "header-factory")]
719 fn connect_header_factory_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
720 unsafe extern "C" fn notify_header_factory_trampoline<
721 P: IsA<ComboRow>,
722 F: Fn(&P) + 'static,
723 >(
724 this: *mut ffi::AdwComboRow,
725 _param_spec: glib::ffi::gpointer,
726 f: glib::ffi::gpointer,
727 ) {
728 let f: &F = &*(f as *const F);
729 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
730 }
731 unsafe {
732 let f: Box_<F> = Box_::new(f);
733 connect_raw(
734 self.as_ptr() as *mut _,
735 c"notify::header-factory".as_ptr() as *const _,
736 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
737 notify_header_factory_trampoline::<Self, F> as *const (),
738 )),
739 Box_::into_raw(f),
740 )
741 }
742 }
743
744 #[doc(alias = "list-factory")]
745 fn connect_list_factory_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
746 unsafe extern "C" fn notify_list_factory_trampoline<
747 P: IsA<ComboRow>,
748 F: Fn(&P) + 'static,
749 >(
750 this: *mut ffi::AdwComboRow,
751 _param_spec: glib::ffi::gpointer,
752 f: glib::ffi::gpointer,
753 ) {
754 let f: &F = &*(f as *const F);
755 f(ComboRow::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::list-factory".as_ptr() as *const _,
762 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
763 notify_list_factory_trampoline::<Self, F> as *const (),
764 )),
765 Box_::into_raw(f),
766 )
767 }
768 }
769
770 #[doc(alias = "model")]
771 fn connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
772 unsafe extern "C" fn notify_model_trampoline<P: IsA<ComboRow>, F: Fn(&P) + 'static>(
773 this: *mut ffi::AdwComboRow,
774 _param_spec: glib::ffi::gpointer,
775 f: glib::ffi::gpointer,
776 ) {
777 let f: &F = &*(f as *const F);
778 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
779 }
780 unsafe {
781 let f: Box_<F> = Box_::new(f);
782 connect_raw(
783 self.as_ptr() as *mut _,
784 c"notify::model".as_ptr() as *const _,
785 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
786 notify_model_trampoline::<Self, F> as *const (),
787 )),
788 Box_::into_raw(f),
789 )
790 }
791 }
792
793 #[cfg(feature = "v1_6")]
794 #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))]
795 #[doc(alias = "search-match-mode")]
796 fn connect_search_match_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
797 unsafe extern "C" fn notify_search_match_mode_trampoline<
798 P: IsA<ComboRow>,
799 F: Fn(&P) + 'static,
800 >(
801 this: *mut ffi::AdwComboRow,
802 _param_spec: glib::ffi::gpointer,
803 f: glib::ffi::gpointer,
804 ) {
805 let f: &F = &*(f as *const F);
806 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
807 }
808 unsafe {
809 let f: Box_<F> = Box_::new(f);
810 connect_raw(
811 self.as_ptr() as *mut _,
812 c"notify::search-match-mode".as_ptr() as *const _,
813 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
814 notify_search_match_mode_trampoline::<Self, F> as *const (),
815 )),
816 Box_::into_raw(f),
817 )
818 }
819 }
820
821 #[doc(alias = "selected")]
822 fn connect_selected_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
823 unsafe extern "C" fn notify_selected_trampoline<P: IsA<ComboRow>, F: Fn(&P) + 'static>(
824 this: *mut ffi::AdwComboRow,
825 _param_spec: glib::ffi::gpointer,
826 f: glib::ffi::gpointer,
827 ) {
828 let f: &F = &*(f as *const F);
829 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
830 }
831 unsafe {
832 let f: Box_<F> = Box_::new(f);
833 connect_raw(
834 self.as_ptr() as *mut _,
835 c"notify::selected".as_ptr() as *const _,
836 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
837 notify_selected_trampoline::<Self, F> as *const (),
838 )),
839 Box_::into_raw(f),
840 )
841 }
842 }
843
844 #[doc(alias = "selected-item")]
845 fn connect_selected_item_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
846 unsafe extern "C" fn notify_selected_item_trampoline<
847 P: IsA<ComboRow>,
848 F: Fn(&P) + 'static,
849 >(
850 this: *mut ffi::AdwComboRow,
851 _param_spec: glib::ffi::gpointer,
852 f: glib::ffi::gpointer,
853 ) {
854 let f: &F = &*(f as *const F);
855 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
856 }
857 unsafe {
858 let f: Box_<F> = Box_::new(f);
859 connect_raw(
860 self.as_ptr() as *mut _,
861 c"notify::selected-item".as_ptr() as *const _,
862 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
863 notify_selected_item_trampoline::<Self, F> as *const (),
864 )),
865 Box_::into_raw(f),
866 )
867 }
868 }
869
870 #[doc(alias = "use-subtitle")]
871 fn connect_use_subtitle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
872 unsafe extern "C" fn notify_use_subtitle_trampoline<
873 P: IsA<ComboRow>,
874 F: Fn(&P) + 'static,
875 >(
876 this: *mut ffi::AdwComboRow,
877 _param_spec: glib::ffi::gpointer,
878 f: glib::ffi::gpointer,
879 ) {
880 let f: &F = &*(f as *const F);
881 f(ComboRow::from_glib_borrow(this).unsafe_cast_ref())
882 }
883 unsafe {
884 let f: Box_<F> = Box_::new(f);
885 connect_raw(
886 self.as_ptr() as *mut _,
887 c"notify::use-subtitle".as_ptr() as *const _,
888 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
889 notify_use_subtitle_trampoline::<Self, F> as *const (),
890 )),
891 Box_::into_raw(f),
892 )
893 }
894 }
895}
896
897impl<O: IsA<ComboRow>> ComboRowExt for O {}