Skip to main content

libadwaita/auto/
breakpoint_bin.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files.git)
4// DO NOT EDIT
5
6use crate::{Breakpoint, 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    ///
18    /// ```text
19    ///
20    /// See [`Breakpoint`][crate::Breakpoint] documentation for details.
21    ///
22    /// ## Properties
23    ///
24    ///
25    /// #### `child`
26    ///  The child widget.
27    ///
28    /// Readable | Writable
29    ///
30    ///
31    /// #### `current-breakpoint`
32    ///  The current breakpoint.
33    ///
34    /// Readable
35    /// <details><summary><h4>Widget</h4></summary>
36    ///
37    ///
38    /// #### `can-focus`
39    ///  Whether the widget or any of its descendents can accept
40    /// the input focus.
41    ///
42    /// This property is meant to be set by widget implementations,
43    /// typically in their instance init function.
44    ///
45    /// Readable | Writable
46    ///
47    ///
48    /// #### `can-target`
49    ///  Whether the widget can receive pointer events.
50    ///
51    /// Readable | Writable
52    ///
53    ///
54    /// #### `css-classes`
55    ///  A list of css classes applied to this widget.
56    ///
57    /// Readable | Writable
58    ///
59    ///
60    /// #### `css-name`
61    ///  The name of this widget in the CSS tree.
62    ///
63    /// This property is meant to be set by widget implementations,
64    /// typically in their instance init function.
65    ///
66    /// Readable | Writable | Construct Only
67    ///
68    ///
69    /// #### `cursor`
70    ///  The cursor used by @widget.
71    ///
72    /// Readable | Writable
73    ///
74    ///
75    /// #### `focus-on-click`
76    ///  Whether the widget should grab focus when it is clicked with the mouse.
77    ///
78    /// This property is only relevant for widgets that can take focus.
79    ///
80    /// Readable | Writable
81    ///
82    ///
83    /// #### `focusable`
84    ///  Whether this widget itself will accept the input focus.
85    ///
86    /// Readable | Writable
87    ///
88    ///
89    /// #### `halign`
90    ///  How to distribute horizontal space if widget gets extra space.
91    ///
92    /// Readable | Writable
93    ///
94    ///
95    /// #### `has-default`
96    ///  Whether the widget is the default widget.
97    ///
98    /// Readable
99    ///
100    ///
101    /// #### `has-focus`
102    ///  Whether the widget has the input focus.
103    ///
104    /// Readable
105    ///
106    ///
107    /// #### `has-tooltip`
108    ///  Enables or disables the emission of the [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip]
109    /// signal on @widget.
110    ///
111    /// A true value indicates that @widget can have a tooltip, in this case
112    /// the widget will be queried using [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] to
113    /// determine whether it will provide a tooltip or not.
114    ///
115    /// Readable | Writable
116    ///
117    ///
118    /// #### `height-request`
119    ///  Overrides for height request of the widget.
120    ///
121    /// If this is -1, the natural request will be used.
122    ///
123    /// Readable | Writable
124    ///
125    ///
126    /// #### `hexpand`
127    ///  Whether to expand horizontally.
128    ///
129    /// Readable | Writable
130    ///
131    ///
132    /// #### `hexpand-set`
133    ///  Whether to use the `hexpand` property.
134    ///
135    /// Readable | Writable
136    ///
137    ///
138    /// #### `layout-manager`
139    ///  The [`gtk::LayoutManager`][crate::gtk::LayoutManager] instance to use to compute
140    /// the preferred size of the widget, and allocate its children.
141    ///
142    /// This property is meant to be set by widget implementations,
143    /// typically in their instance init function.
144    ///
145    /// Readable | Writable
146    ///
147    ///
148    /// #### `limit-events`
149    ///  Makes this widget act like a modal dialog, with respect to
150    /// event delivery.
151    ///
152    /// Global event controllers will not handle events with targets
153    /// inside the widget, unless they are set up to ignore propagation
154    /// limits. See `Gtk::EventController::set_propagation_limit()`.
155    ///
156    /// Readable | Writable
157    ///
158    ///
159    /// #### `margin-bottom`
160    ///  Margin on bottom side of widget.
161    ///
162    /// This property adds margin outside of the widget's normal size
163    /// request, the margin will be added in addition to the size from
164    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
165    ///
166    /// Readable | Writable
167    ///
168    ///
169    /// #### `margin-end`
170    ///  Margin on end of widget, horizontally.
171    ///
172    /// This property supports left-to-right and right-to-left text
173    /// directions.
174    ///
175    /// This property adds margin outside of the widget's normal size
176    /// request, the margin will be added in addition to the size from
177    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
178    ///
179    /// Readable | Writable
180    ///
181    ///
182    /// #### `margin-start`
183    ///  Margin on start of widget, horizontally.
184    ///
185    /// This property supports left-to-right and right-to-left text
186    /// directions.
187    ///
188    /// This property adds margin outside of the widget's normal size
189    /// request, the margin will be added in addition to the size from
190    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
191    ///
192    /// Readable | Writable
193    ///
194    ///
195    /// #### `margin-top`
196    ///  Margin on top side of widget.
197    ///
198    /// This property adds margin outside of the widget's normal size
199    /// request, the margin will be added in addition to the size from
200    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
201    ///
202    /// Readable | Writable
203    ///
204    ///
205    /// #### `name`
206    ///  The name of the widget.
207    ///
208    /// Readable | Writable
209    ///
210    ///
211    /// #### `opacity`
212    ///  The requested opacity of the widget.
213    ///
214    /// Readable | Writable
215    ///
216    ///
217    /// #### `overflow`
218    ///  How content outside the widget's content area is treated.
219    ///
220    /// This property is meant to be set by widget implementations,
221    /// typically in their instance init function.
222    ///
223    /// Readable | Writable
224    ///
225    ///
226    /// #### `parent`
227    ///  The parent widget of this widget.
228    ///
229    /// Readable
230    ///
231    ///
232    /// #### `receives-default`
233    ///  Whether the widget will receive the default action when it is focused.
234    ///
235    /// Readable | Writable
236    ///
237    ///
238    /// #### `root`
239    ///  The [`gtk::Root`][crate::gtk::Root] widget of the widget tree containing this widget.
240    ///
241    /// This will be `NULL` if the widget is not contained in a root widget.
242    ///
243    /// Readable
244    ///
245    ///
246    /// #### `scale-factor`
247    ///  The scale factor of the widget.
248    ///
249    /// Readable
250    ///
251    ///
252    /// #### `sensitive`
253    ///  Whether the widget responds to input.
254    ///
255    /// Readable | Writable
256    ///
257    ///
258    /// #### `tooltip-markup`
259    ///  Sets the text of tooltip to be the given string, which is marked up
260    /// with Pango markup.
261    ///
262    /// Also see `Gtk::Tooltip::set_markup()`.
263    ///
264    /// This is a convenience property which will take care of getting the
265    /// tooltip shown if the given string is not `NULL`:
266    /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
267    /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
268    /// the default signal handler.
269    ///
270    /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
271    /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
272    ///
273    /// Readable | Writable
274    ///
275    ///
276    /// #### `tooltip-text`
277    ///  Sets the text of tooltip to be the given string.
278    ///
279    /// Also see `Gtk::Tooltip::set_text()`.
280    ///
281    /// This is a convenience property which will take care of getting the
282    /// tooltip shown if the given string is not `NULL`:
283    /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
284    /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
285    /// the default signal handler.
286    ///
287    /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
288    /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
289    ///
290    /// Readable | Writable
291    ///
292    ///
293    /// #### `valign`
294    ///  How to distribute vertical space if widget gets extra space.
295    ///
296    /// Readable | Writable
297    ///
298    ///
299    /// #### `vexpand`
300    ///  Whether to expand vertically.
301    ///
302    /// Readable | Writable
303    ///
304    ///
305    /// #### `vexpand-set`
306    ///  Whether to use the `vexpand` property.
307    ///
308    /// Readable | Writable
309    ///
310    ///
311    /// #### `visible`
312    ///  Whether the widget is visible.
313    ///
314    /// Readable | Writable
315    ///
316    ///
317    /// #### `width-request`
318    ///  Overrides for width request of the widget.
319    ///
320    /// If this is -1, the natural request will be used.
321    ///
322    /// Readable | Writable
323    /// </details>
324    /// <details><summary><h4>Accessible</h4></summary>
325    ///
326    ///
327    /// #### `accessible-role`
328    ///  The accessible role of the given [`gtk::Accessible`][crate::gtk::Accessible] implementation.
329    ///
330    /// The accessible role cannot be changed once set.
331    ///
332    /// Readable | Writable
333    /// </details>
334    ///
335    /// # Implements
336    ///
337    /// [`BreakpointBinExt`][trait@crate::prelude::BreakpointBinExt], [`trait@gtk::prelude::WidgetExt`], [`trait@glib::ObjectExt`], [`trait@gtk::prelude::AccessibleExt`], [`trait@gtk::prelude::BuildableExt`], [`trait@gtk::prelude::ConstraintTargetExt`]
338    #[doc(alias = "AdwBreakpointBin")]
339    pub struct BreakpointBin(Object<ffi::AdwBreakpointBin, ffi::AdwBreakpointBinClass>) @extends gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
340
341    match fn {
342        type_ => || ffi::adw_breakpoint_bin_get_type(),
343    }
344}
345
346#[cfg(not(feature = "gtk_v4_10"))]
347glib::wrapper! {
348    #[doc(alias = "AdwBreakpointBin")]
349    pub struct BreakpointBin(Object<ffi::AdwBreakpointBin, ffi::AdwBreakpointBinClass>) @extends gtk::Widget, @implements gtk::Buildable, gtk::ConstraintTarget;
350
351    match fn {
352        type_ => || ffi::adw_breakpoint_bin_get_type(),
353    }
354}
355
356impl BreakpointBin {
357    pub const NONE: Option<&'static BreakpointBin> = None;
358
359    /// Creates a new [`BreakpointBin`][crate::BreakpointBin].
360    ///
361    /// # Returns
362    ///
363    /// the newly created [`BreakpointBin`][crate::BreakpointBin]
364    #[doc(alias = "adw_breakpoint_bin_new")]
365    pub fn new() -> BreakpointBin {
366        assert_initialized_main_thread!();
367        unsafe { gtk::Widget::from_glib_none(ffi::adw_breakpoint_bin_new()).unsafe_cast() }
368    }
369
370    // rustdoc-stripper-ignore-next
371    /// Creates a new builder-pattern struct instance to construct [`BreakpointBin`] objects.
372    ///
373    /// This method returns an instance of [`BreakpointBinBuilder`](crate::builders::BreakpointBinBuilder) which can be used to create [`BreakpointBin`] objects.
374    pub fn builder() -> BreakpointBinBuilder {
375        BreakpointBinBuilder::new()
376    }
377}
378
379#[cfg(feature = "v1_4")]
380#[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
381impl Default for BreakpointBin {
382    fn default() -> Self {
383        Self::new()
384    }
385}
386
387// rustdoc-stripper-ignore-next
388/// A [builder-pattern] type to construct [`BreakpointBin`] objects.
389///
390/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
391#[must_use = "The builder must be built to be used"]
392pub struct BreakpointBinBuilder {
393    builder: glib::object::ObjectBuilder<'static, BreakpointBin>,
394}
395
396impl BreakpointBinBuilder {
397    fn new() -> Self {
398        Self {
399            builder: glib::object::Object::builder(),
400        }
401    }
402
403    /// The child widget.
404    #[cfg(feature = "v1_4")]
405    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
406    pub fn child(self, child: &impl IsA<gtk::Widget>) -> Self {
407        Self {
408            builder: self.builder.property("child", child.clone().upcast()),
409        }
410    }
411
412    /// Whether the widget or any of its descendents can accept
413    /// the input focus.
414    ///
415    /// This property is meant to be set by widget implementations,
416    /// typically in their instance init function.
417    pub fn can_focus(self, can_focus: bool) -> Self {
418        Self {
419            builder: self.builder.property("can-focus", can_focus),
420        }
421    }
422
423    /// Whether the widget can receive pointer events.
424    pub fn can_target(self, can_target: bool) -> Self {
425        Self {
426            builder: self.builder.property("can-target", can_target),
427        }
428    }
429
430    /// A list of css classes applied to this widget.
431    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
432        Self {
433            builder: self.builder.property("css-classes", css_classes.into()),
434        }
435    }
436
437    /// The name of this widget in the CSS tree.
438    ///
439    /// This property is meant to be set by widget implementations,
440    /// typically in their instance init function.
441    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
442        Self {
443            builder: self.builder.property("css-name", css_name.into()),
444        }
445    }
446
447    /// The cursor used by @widget.
448    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
449        Self {
450            builder: self.builder.property("cursor", cursor.clone()),
451        }
452    }
453
454    /// Whether the widget should grab focus when it is clicked with the mouse.
455    ///
456    /// This property is only relevant for widgets that can take focus.
457    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
458        Self {
459            builder: self.builder.property("focus-on-click", focus_on_click),
460        }
461    }
462
463    /// Whether this widget itself will accept the input focus.
464    pub fn focusable(self, focusable: bool) -> Self {
465        Self {
466            builder: self.builder.property("focusable", focusable),
467        }
468    }
469
470    /// How to distribute horizontal space if widget gets extra space.
471    pub fn halign(self, halign: gtk::Align) -> Self {
472        Self {
473            builder: self.builder.property("halign", halign),
474        }
475    }
476
477    /// Enables or disables the emission of the [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip]
478    /// signal on @widget.
479    ///
480    /// A true value indicates that @widget can have a tooltip, in this case
481    /// the widget will be queried using [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] to
482    /// determine whether it will provide a tooltip or not.
483    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
484        Self {
485            builder: self.builder.property("has-tooltip", has_tooltip),
486        }
487    }
488
489    /// Overrides for height request of the widget.
490    ///
491    /// If this is -1, the natural request will be used.
492    pub fn height_request(self, height_request: i32) -> Self {
493        Self {
494            builder: self.builder.property("height-request", height_request),
495        }
496    }
497
498    /// Whether to expand horizontally.
499    pub fn hexpand(self, hexpand: bool) -> Self {
500        Self {
501            builder: self.builder.property("hexpand", hexpand),
502        }
503    }
504
505    /// Whether to use the `hexpand` property.
506    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
507        Self {
508            builder: self.builder.property("hexpand-set", hexpand_set),
509        }
510    }
511
512    /// The [`gtk::LayoutManager`][crate::gtk::LayoutManager] instance to use to compute
513    /// the preferred size of the widget, and allocate its children.
514    ///
515    /// This property is meant to be set by widget implementations,
516    /// typically in their instance init function.
517    pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
518        Self {
519            builder: self
520                .builder
521                .property("layout-manager", layout_manager.clone().upcast()),
522        }
523    }
524
525    /// Makes this widget act like a modal dialog, with respect to
526    /// event delivery.
527    ///
528    /// Global event controllers will not handle events with targets
529    /// inside the widget, unless they are set up to ignore propagation
530    /// limits. See `Gtk::EventController::set_propagation_limit()`.
531    #[cfg(feature = "gtk_v4_18")]
532    #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
533    pub fn limit_events(self, limit_events: bool) -> Self {
534        Self {
535            builder: self.builder.property("limit-events", limit_events),
536        }
537    }
538
539    /// Margin on bottom side of widget.
540    ///
541    /// This property adds margin outside of the widget's normal size
542    /// request, the margin will be added in addition to the size from
543    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
544    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
545        Self {
546            builder: self.builder.property("margin-bottom", margin_bottom),
547        }
548    }
549
550    /// Margin on end of widget, horizontally.
551    ///
552    /// This property supports left-to-right and right-to-left text
553    /// directions.
554    ///
555    /// This property adds margin outside of the widget's normal size
556    /// request, the margin will be added in addition to the size from
557    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
558    pub fn margin_end(self, margin_end: i32) -> Self {
559        Self {
560            builder: self.builder.property("margin-end", margin_end),
561        }
562    }
563
564    /// Margin on start of widget, horizontally.
565    ///
566    /// This property supports left-to-right and right-to-left text
567    /// directions.
568    ///
569    /// This property adds margin outside of the widget's normal size
570    /// request, the margin will be added in addition to the size from
571    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
572    pub fn margin_start(self, margin_start: i32) -> Self {
573        Self {
574            builder: self.builder.property("margin-start", margin_start),
575        }
576    }
577
578    /// Margin on top side of widget.
579    ///
580    /// This property adds margin outside of the widget's normal size
581    /// request, the margin will be added in addition to the size from
582    /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
583    pub fn margin_top(self, margin_top: i32) -> Self {
584        Self {
585            builder: self.builder.property("margin-top", margin_top),
586        }
587    }
588
589    /// The name of the widget.
590    pub fn name(self, name: impl Into<glib::GString>) -> Self {
591        Self {
592            builder: self.builder.property("name", name.into()),
593        }
594    }
595
596    /// The requested opacity of the widget.
597    pub fn opacity(self, opacity: f64) -> Self {
598        Self {
599            builder: self.builder.property("opacity", opacity),
600        }
601    }
602
603    /// How content outside the widget's content area is treated.
604    ///
605    /// This property is meant to be set by widget implementations,
606    /// typically in their instance init function.
607    pub fn overflow(self, overflow: gtk::Overflow) -> Self {
608        Self {
609            builder: self.builder.property("overflow", overflow),
610        }
611    }
612
613    /// Whether the widget will receive the default action when it is focused.
614    pub fn receives_default(self, receives_default: bool) -> Self {
615        Self {
616            builder: self.builder.property("receives-default", receives_default),
617        }
618    }
619
620    /// Whether the widget responds to input.
621    pub fn sensitive(self, sensitive: bool) -> Self {
622        Self {
623            builder: self.builder.property("sensitive", sensitive),
624        }
625    }
626
627    /// Sets the text of tooltip to be the given string, which is marked up
628    /// with Pango markup.
629    ///
630    /// Also see `Gtk::Tooltip::set_markup()`.
631    ///
632    /// This is a convenience property which will take care of getting the
633    /// tooltip shown if the given string is not `NULL`:
634    /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
635    /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
636    /// the default signal handler.
637    ///
638    /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
639    /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
640    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
641        Self {
642            builder: self
643                .builder
644                .property("tooltip-markup", tooltip_markup.into()),
645        }
646    }
647
648    /// Sets the text of tooltip to be the given string.
649    ///
650    /// Also see `Gtk::Tooltip::set_text()`.
651    ///
652    /// This is a convenience property which will take care of getting the
653    /// tooltip shown if the given string is not `NULL`:
654    /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
655    /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
656    /// the default signal handler.
657    ///
658    /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
659    /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
660    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
661        Self {
662            builder: self.builder.property("tooltip-text", tooltip_text.into()),
663        }
664    }
665
666    /// How to distribute vertical space if widget gets extra space.
667    pub fn valign(self, valign: gtk::Align) -> Self {
668        Self {
669            builder: self.builder.property("valign", valign),
670        }
671    }
672
673    /// Whether to expand vertically.
674    pub fn vexpand(self, vexpand: bool) -> Self {
675        Self {
676            builder: self.builder.property("vexpand", vexpand),
677        }
678    }
679
680    /// Whether to use the `vexpand` property.
681    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
682        Self {
683            builder: self.builder.property("vexpand-set", vexpand_set),
684        }
685    }
686
687    /// Whether the widget is visible.
688    pub fn visible(self, visible: bool) -> Self {
689        Self {
690            builder: self.builder.property("visible", visible),
691        }
692    }
693
694    /// Overrides for width request of the widget.
695    ///
696    /// If this is -1, the natural request will be used.
697    pub fn width_request(self, width_request: i32) -> Self {
698        Self {
699            builder: self.builder.property("width-request", width_request),
700        }
701    }
702
703    /// The accessible role of the given [`gtk::Accessible`][crate::gtk::Accessible] implementation.
704    ///
705    /// The accessible role cannot be changed once set.
706    pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
707        Self {
708            builder: self.builder.property("accessible-role", accessible_role),
709        }
710    }
711
712    // rustdoc-stripper-ignore-next
713    /// Build the [`BreakpointBin`].
714    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
715    pub fn build(self) -> BreakpointBin {
716        assert_initialized_main_thread!();
717        self.builder.build()
718    }
719}
720
721/// Trait containing all [`struct@BreakpointBin`] methods.
722///
723/// # Implementors
724///
725/// [`BreakpointBin`][struct@crate::BreakpointBin]
726pub trait BreakpointBinExt: IsA<BreakpointBin> + 'static {
727    /// Adds @breakpoint to @self.
728    /// ## `breakpoint`
729    /// the breakpoint to add
730    #[doc(alias = "adw_breakpoint_bin_add_breakpoint")]
731    fn add_breakpoint(&self, breakpoint: Breakpoint) {
732        unsafe {
733            ffi::adw_breakpoint_bin_add_breakpoint(
734                self.as_ref().to_glib_none().0,
735                breakpoint.into_glib_ptr(),
736            );
737        }
738    }
739
740    /// Gets the child widget of @self.
741    ///
742    /// # Returns
743    ///
744    /// the child widget of @self
745    #[doc(alias = "adw_breakpoint_bin_get_child")]
746    #[doc(alias = "get_child")]
747    fn child(&self) -> Option<gtk::Widget> {
748        unsafe {
749            from_glib_none(ffi::adw_breakpoint_bin_get_child(
750                self.as_ref().to_glib_none().0,
751            ))
752        }
753    }
754
755    /// Gets the current breakpoint.
756    ///
757    /// # Returns
758    ///
759    /// the current breakpoint
760    #[doc(alias = "adw_breakpoint_bin_get_current_breakpoint")]
761    #[doc(alias = "get_current_breakpoint")]
762    #[doc(alias = "current-breakpoint")]
763    fn current_breakpoint(&self) -> Option<Breakpoint> {
764        unsafe {
765            from_glib_none(ffi::adw_breakpoint_bin_get_current_breakpoint(
766                self.as_ref().to_glib_none().0,
767            ))
768        }
769    }
770
771    /// Removes @breakpoint from @self.
772    /// ## `breakpoint`
773    /// a breakpoint to remove
774    #[cfg(feature = "v1_5")]
775    #[cfg_attr(docsrs, doc(cfg(feature = "v1_5")))]
776    #[doc(alias = "adw_breakpoint_bin_remove_breakpoint")]
777    fn remove_breakpoint(&self, breakpoint: &Breakpoint) {
778        unsafe {
779            ffi::adw_breakpoint_bin_remove_breakpoint(
780                self.as_ref().to_glib_none().0,
781                breakpoint.to_glib_none().0,
782            );
783        }
784    }
785
786    /// Sets the child widget of @self.
787    /// ## `child`
788    /// the child widget
789    #[doc(alias = "adw_breakpoint_bin_set_child")]
790    #[doc(alias = "child")]
791    fn set_child(&self, child: Option<&impl IsA<gtk::Widget>>) {
792        unsafe {
793            ffi::adw_breakpoint_bin_set_child(
794                self.as_ref().to_glib_none().0,
795                child.map(|p| p.as_ref()).to_glib_none().0,
796            );
797        }
798    }
799
800    #[cfg(feature = "v1_4")]
801    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
802    #[doc(alias = "child")]
803    fn connect_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
804        unsafe extern "C" fn notify_child_trampoline<P: IsA<BreakpointBin>, F: Fn(&P) + 'static>(
805            this: *mut ffi::AdwBreakpointBin,
806            _param_spec: glib::ffi::gpointer,
807            f: glib::ffi::gpointer,
808        ) {
809            unsafe {
810                let f: &F = &*(f as *const F);
811                f(BreakpointBin::from_glib_borrow(this).unsafe_cast_ref())
812            }
813        }
814        unsafe {
815            let f: Box_<F> = Box_::new(f);
816            connect_raw(
817                self.as_ptr() as *mut _,
818                c"notify::child".as_ptr(),
819                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
820                    notify_child_trampoline::<Self, F> as *const (),
821                )),
822                Box_::into_raw(f),
823            )
824        }
825    }
826
827    #[cfg(feature = "v1_4")]
828    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
829    #[doc(alias = "current-breakpoint")]
830    fn connect_current_breakpoint_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
831        unsafe extern "C" fn notify_current_breakpoint_trampoline<
832            P: IsA<BreakpointBin>,
833            F: Fn(&P) + 'static,
834        >(
835            this: *mut ffi::AdwBreakpointBin,
836            _param_spec: glib::ffi::gpointer,
837            f: glib::ffi::gpointer,
838        ) {
839            unsafe {
840                let f: &F = &*(f as *const F);
841                f(BreakpointBin::from_glib_borrow(this).unsafe_cast_ref())
842            }
843        }
844        unsafe {
845            let f: Box_<F> = Box_::new(f);
846            connect_raw(
847                self.as_ptr() as *mut _,
848                c"notify::current-breakpoint".as_ptr(),
849                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
850                    notify_current_breakpoint_trampoline::<Self, F> as *const (),
851                )),
852                Box_::into_raw(f),
853            )
854        }
855    }
856}
857
858impl<O: IsA<BreakpointBin>> BreakpointBinExt for O {}