gtk/auto/range.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{Adjustment, Buildable, Orientable, ScrollType, SensitivityType, Widget, ffi};
6use glib::{
7 object::ObjectType as _,
8 prelude::*,
9 signal::{SignalHandlerId, connect_raw},
10 translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15 /// [`Range`][crate::Range] is the common base class for widgets which visualize an
16 /// adjustment, e.g [`Scale`][crate::Scale] or [`Scrollbar`][crate::Scrollbar].
17 ///
18 /// Apart from signals for monitoring the parameters of the adjustment,
19 /// [`Range`][crate::Range] provides properties and methods for influencing the sensitivity
20 /// of the “steppers”. It also provides properties and methods for setting a
21 /// “fill level” on range widgets. See [`RangeExt::set_fill_level()`][crate::prelude::RangeExt::set_fill_level()].
22 ///
23 /// This is an Abstract Base Class, you cannot instantiate it.
24 ///
25 /// ## Properties
26 ///
27 ///
28 /// #### `adjustment`
29 /// Readable | Writable | Construct
30 ///
31 ///
32 /// #### `fill-level`
33 /// The fill level (e.g. prebuffering of a network stream).
34 /// See [`RangeExt::set_fill_level()`][crate::prelude::RangeExt::set_fill_level()].
35 ///
36 /// Readable | Writable
37 ///
38 ///
39 /// #### `inverted`
40 /// Readable | Writable
41 ///
42 ///
43 /// #### `lower-stepper-sensitivity`
44 /// Readable | Writable
45 ///
46 ///
47 /// #### `restrict-to-fill-level`
48 /// The restrict-to-fill-level property controls whether slider
49 /// movement is restricted to an upper boundary set by the
50 /// fill level. See [`RangeExt::set_restrict_to_fill_level()`][crate::prelude::RangeExt::set_restrict_to_fill_level()].
51 ///
52 /// Readable | Writable
53 ///
54 ///
55 /// #### `round-digits`
56 /// The number of digits to round the value to when
57 /// it changes, or -1. See [`change-value`][struct@crate::Range#change-value].
58 ///
59 /// Readable | Writable
60 ///
61 ///
62 /// #### `show-fill-level`
63 /// The show-fill-level property controls whether fill level indicator
64 /// graphics are displayed on the trough. See
65 /// [`RangeExt::set_show_fill_level()`][crate::prelude::RangeExt::set_show_fill_level()].
66 ///
67 /// Readable | Writable
68 ///
69 ///
70 /// #### `upper-stepper-sensitivity`
71 /// Readable | Writable
72 /// <details><summary><h4>Widget</h4></summary>
73 ///
74 ///
75 /// #### `app-paintable`
76 /// Readable | Writable
77 ///
78 ///
79 /// #### `can-default`
80 /// Readable | Writable
81 ///
82 ///
83 /// #### `can-focus`
84 /// Readable | Writable
85 ///
86 ///
87 /// #### `composite-child`
88 /// Readable
89 ///
90 ///
91 /// #### `double-buffered`
92 /// Whether the widget is double buffered.
93 ///
94 /// Readable | Writable
95 ///
96 ///
97 /// #### `events`
98 /// Readable | Writable
99 ///
100 ///
101 /// #### `expand`
102 /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
103 ///
104 /// Readable | Writable
105 ///
106 ///
107 /// #### `focus-on-click`
108 /// Whether the widget should grab focus when it is clicked with the mouse.
109 ///
110 /// This property is only relevant for widgets that can take focus.
111 ///
112 /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
113 /// GtkComboBox) implemented this property individually.
114 ///
115 /// Readable | Writable
116 ///
117 ///
118 /// #### `halign`
119 /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
120 ///
121 /// Readable | Writable
122 ///
123 ///
124 /// #### `has-default`
125 /// Readable | Writable
126 ///
127 ///
128 /// #### `has-focus`
129 /// Readable | Writable
130 ///
131 ///
132 /// #### `has-tooltip`
133 /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
134 /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
135 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
136 /// whether it will provide a tooltip or not.
137 ///
138 /// Note that setting this property to [`true`] for the first time will change
139 /// the event masks of the GdkWindows of this widget to include leave-notify
140 /// and motion-notify events. This cannot and will not be undone when the
141 /// property is set to [`false`] again.
142 ///
143 /// Readable | Writable
144 ///
145 ///
146 /// #### `height-request`
147 /// Readable | Writable
148 ///
149 ///
150 /// #### `hexpand`
151 /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
152 ///
153 /// Readable | Writable
154 ///
155 ///
156 /// #### `hexpand-set`
157 /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
158 ///
159 /// Readable | Writable
160 ///
161 ///
162 /// #### `is-focus`
163 /// Readable | Writable
164 ///
165 ///
166 /// #### `margin`
167 /// Sets all four sides' margin at once. If read, returns max
168 /// margin on any side.
169 ///
170 /// Readable | Writable
171 ///
172 ///
173 /// #### `margin-bottom`
174 /// Margin on bottom side of widget.
175 ///
176 /// This property adds margin outside of the widget's normal size
177 /// request, the margin will be added in addition to the size from
178 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
179 ///
180 /// Readable | Writable
181 ///
182 ///
183 /// #### `margin-end`
184 /// Margin on end of widget, horizontally. This property supports
185 /// left-to-right and right-to-left text directions.
186 ///
187 /// This property adds margin outside of the widget's normal size
188 /// request, the margin will be added in addition to the size from
189 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
190 ///
191 /// Readable | Writable
192 ///
193 ///
194 /// #### `margin-left`
195 /// Margin on left side of widget.
196 ///
197 /// This property adds margin outside of the widget's normal size
198 /// request, the margin will be added in addition to the size from
199 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
200 ///
201 /// Readable | Writable
202 ///
203 ///
204 /// #### `margin-right`
205 /// Margin on right side of widget.
206 ///
207 /// This property adds margin outside of the widget's normal size
208 /// request, the margin will be added in addition to the size from
209 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
210 ///
211 /// Readable | Writable
212 ///
213 ///
214 /// #### `margin-start`
215 /// Margin on start of widget, horizontally. This property supports
216 /// left-to-right and right-to-left text directions.
217 ///
218 /// This property adds margin outside of the widget's normal size
219 /// request, the margin will be added in addition to the size from
220 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
221 ///
222 /// Readable | Writable
223 ///
224 ///
225 /// #### `margin-top`
226 /// Margin on top side of widget.
227 ///
228 /// This property adds margin outside of the widget's normal size
229 /// request, the margin will be added in addition to the size from
230 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
231 ///
232 /// Readable | Writable
233 ///
234 ///
235 /// #### `name`
236 /// Readable | Writable
237 ///
238 ///
239 /// #### `no-show-all`
240 /// Readable | Writable
241 ///
242 ///
243 /// #### `opacity`
244 /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
245 /// more details about window opacity.
246 ///
247 /// Before 3.8 this was only available in GtkWindow
248 ///
249 /// Readable | Writable
250 ///
251 ///
252 /// #### `parent`
253 /// Readable | Writable
254 ///
255 ///
256 /// #### `receives-default`
257 /// Readable | Writable
258 ///
259 ///
260 /// #### `scale-factor`
261 /// The scale factor of the widget. See [`WidgetExt::scale_factor()`][crate::prelude::WidgetExt::scale_factor()] for
262 /// more details about widget scaling.
263 ///
264 /// Readable
265 ///
266 ///
267 /// #### `sensitive`
268 /// Readable | Writable
269 ///
270 ///
271 /// #### `style`
272 /// The style of the widget, which contains information about how it will look (colors, etc).
273 ///
274 /// Readable | Writable
275 ///
276 ///
277 /// #### `tooltip-markup`
278 /// Sets the text of tooltip to be the given string, which is marked up
279 /// with the [Pango text markup language][PangoMarkupFormat].
280 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
281 ///
282 /// This is a convenience property which will take care of getting the
283 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
284 /// will automatically be set to [`true`] and there will be taken care of
285 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
286 ///
287 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
288 /// are set, the last one wins.
289 ///
290 /// Readable | Writable
291 ///
292 ///
293 /// #### `tooltip-text`
294 /// Sets the text of tooltip to be the given string.
295 ///
296 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
297 ///
298 /// This is a convenience property which will take care of getting the
299 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
300 /// will automatically be set to [`true`] and there will be taken care of
301 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
302 ///
303 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
304 /// are set, the last one wins.
305 ///
306 /// Readable | Writable
307 ///
308 ///
309 /// #### `valign`
310 /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
311 ///
312 /// Readable | Writable
313 ///
314 ///
315 /// #### `vexpand`
316 /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
317 ///
318 /// Readable | Writable
319 ///
320 ///
321 /// #### `vexpand-set`
322 /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
323 ///
324 /// Readable | Writable
325 ///
326 ///
327 /// #### `visible`
328 /// Readable | Writable
329 ///
330 ///
331 /// #### `width-request`
332 /// Readable | Writable
333 ///
334 ///
335 /// #### `window`
336 /// The widget's window if it is realized, [`None`] otherwise.
337 ///
338 /// Readable
339 /// </details>
340 /// <details><summary><h4>Orientable</h4></summary>
341 ///
342 ///
343 /// #### `orientation`
344 /// The orientation of the orientable.
345 ///
346 /// Readable | Writable
347 /// </details>
348 ///
349 /// ## Signals
350 ///
351 ///
352 /// #### `adjust-bounds`
353 /// Emitted before clamping a value, to give the application a
354 /// chance to adjust the bounds.
355 ///
356 ///
357 ///
358 ///
359 /// #### `change-value`
360 /// The [`change-value`][struct@crate::Range#change-value] signal is emitted when a scroll action is
361 /// performed on a range. It allows an application to determine the
362 /// type of scroll event that occurred and the resultant new value.
363 /// The application can handle the event itself and return [`true`] to
364 /// prevent further processing. Or, by returning [`false`], it can pass
365 /// the event to other handlers until the default GTK+ handler is
366 /// reached.
367 ///
368 /// The value parameter is unrounded. An application that overrides
369 /// the GtkRange::change-value signal is responsible for clamping the
370 /// value to the desired number of decimal digits; the default GTK+
371 /// handler clamps the value based on [`round-digits`][struct@crate::Range#round-digits].
372 ///
373 ///
374 ///
375 ///
376 /// #### `move-slider`
377 /// Virtual function that moves the slider. Used for keybindings.
378 ///
379 /// Action
380 ///
381 ///
382 /// #### `value-changed`
383 /// Emitted when the range value changes.
384 ///
385 ///
386 /// <details><summary><h4>Widget</h4></summary>
387 ///
388 ///
389 /// #### `accel-closures-changed`
390 ///
391 ///
392 ///
393 /// #### `button-press-event`
394 /// The ::button-press-event signal will be emitted when a button
395 /// (typically from a mouse) is pressed.
396 ///
397 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
398 /// widget needs to enable the [`gdk::EventMask::BUTTON_PRESS_MASK`][crate::gdk::EventMask::BUTTON_PRESS_MASK] mask.
399 ///
400 /// This signal will be sent to the grab widget if there is one.
401 ///
402 ///
403 ///
404 ///
405 /// #### `button-release-event`
406 /// The ::button-release-event signal will be emitted when a button
407 /// (typically from a mouse) is released.
408 ///
409 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
410 /// widget needs to enable the [`gdk::EventMask::BUTTON_RELEASE_MASK`][crate::gdk::EventMask::BUTTON_RELEASE_MASK] mask.
411 ///
412 /// This signal will be sent to the grab widget if there is one.
413 ///
414 ///
415 ///
416 ///
417 /// #### `can-activate-accel`
418 /// Determines whether an accelerator that activates the signal
419 /// identified by `signal_id` can currently be activated.
420 /// This signal is present to allow applications and derived
421 /// widgets to override the default [`Widget`][crate::Widget] handling
422 /// for determining whether an accelerator can be activated.
423 ///
424 ///
425 ///
426 ///
427 /// #### `child-notify`
428 /// The ::child-notify signal is emitted for each
429 /// [child property][child-properties] that has
430 /// changed on an object. The signal's detail holds the property name.
431 ///
432 /// Detailed
433 ///
434 ///
435 /// #### `composited-changed`
436 /// The ::composited-changed signal is emitted when the composited
437 /// status of `widgets` screen changes.
438 /// See [`Screen::is_composited()`][crate::gdk::Screen::is_composited()].
439 ///
440 /// Action
441 ///
442 ///
443 /// #### `configure-event`
444 /// The ::configure-event signal will be emitted when the size, position or
445 /// stacking of the `widget`'s window has changed.
446 ///
447 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
448 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
449 /// automatically for all new windows.
450 ///
451 ///
452 ///
453 ///
454 /// #### `damage-event`
455 /// Emitted when a redirected window belonging to `widget` gets drawn into.
456 /// The region/area members of the event shows what area of the redirected
457 /// drawable was drawn into.
458 ///
459 ///
460 ///
461 ///
462 /// #### `delete-event`
463 /// The ::delete-event signal is emitted if a user requests that
464 /// a toplevel window is closed. The default handler for this signal
465 /// destroys the window. Connecting [`WidgetExtManual::hide_on_delete()`][crate::prelude::WidgetExtManual::hide_on_delete()] to
466 /// this signal will cause the window to be hidden instead, so that
467 /// it can later be shown again without reconstructing it.
468 ///
469 ///
470 ///
471 ///
472 /// #### `destroy`
473 /// Signals that all holders of a reference to the widget should release
474 /// the reference that they hold. May result in finalization of the widget
475 /// if all references are released.
476 ///
477 /// This signal is not suitable for saving widget state.
478 ///
479 ///
480 ///
481 ///
482 /// #### `destroy-event`
483 /// The ::destroy-event signal is emitted when a [`gdk::Window`][crate::gdk::Window] is destroyed.
484 /// You rarely get this signal, because most widgets disconnect themselves
485 /// from their window before they destroy it, so no widget owns the
486 /// window at destroy time.
487 ///
488 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
489 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
490 /// automatically for all new windows.
491 ///
492 ///
493 ///
494 ///
495 /// #### `direction-changed`
496 /// The ::direction-changed signal is emitted when the text direction
497 /// of a widget changes.
498 ///
499 ///
500 ///
501 ///
502 /// #### `drag-begin`
503 /// The ::drag-begin signal is emitted on the drag source when a drag is
504 /// started. A typical reason to connect to this signal is to set up a
505 /// custom drag icon with e.g. [`WidgetExt::drag_source_set_icon_pixbuf()`][crate::prelude::WidgetExt::drag_source_set_icon_pixbuf()].
506 ///
507 /// Note that some widgets set up a drag icon in the default handler of
508 /// this signal, so you may have to use `g_signal_connect_after()` to
509 /// override what the default handler did.
510 ///
511 ///
512 ///
513 ///
514 /// #### `drag-data-delete`
515 /// The ::drag-data-delete signal is emitted on the drag source when a drag
516 /// with the action [`gdk::DragAction::MOVE`][crate::gdk::DragAction::MOVE] is successfully completed. The signal
517 /// handler is responsible for deleting the data that has been dropped. What
518 /// "delete" means depends on the context of the drag operation.
519 ///
520 ///
521 ///
522 ///
523 /// #### `drag-data-get`
524 /// The ::drag-data-get signal is emitted on the drag source when the drop
525 /// site requests the data which is dragged. It is the responsibility of
526 /// the signal handler to fill `data` with the data in the format which
527 /// is indicated by `info`. See [`SelectionData::set()`][crate::SelectionData::set()] and
528 /// [`SelectionData::set_text()`][crate::SelectionData::set_text()].
529 ///
530 ///
531 ///
532 ///
533 /// #### `drag-data-received`
534 /// format == 8))
535 /// {
536 /// GdkDragAction action;
537 ///
538 /// // handle data here
539 ///
540 /// action = gdk_drag_context_get_selected_action (context);
541 /// if (action == GDK_ACTION_ASK)
542 /// {
543 /// GtkWidget *dialog;
544 /// gint response;
545 ///
546 /// dialog = gtk_message_dialog_new (NULL,
547 /// GTK_DIALOG_MODAL |
548 /// GTK_DIALOG_DESTROY_WITH_PARENT,
549 /// GTK_MESSAGE_INFO,
550 /// GTK_BUTTONS_YES_NO,
551 /// "Move the data ?\n");
552 /// response = gtk_dialog_run (GTK_DIALOG (dialog));
553 /// gtk_widget_destroy (dialog);
554 ///
555 /// if (response == GTK_RESPONSE_YES)
556 /// action = GDK_ACTION_MOVE;
557 /// else
558 /// action = GDK_ACTION_COPY;
559 /// }
560 ///
561 /// gtk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time);
562 /// }
563 /// else
564 /// gtk_drag_finish (context, FALSE, FALSE, time);
565 /// }
566 /// ]|
567 ///
568 ///
569 ///
570 ///
571 /// #### `drag-drop`
572 /// The ::drag-drop signal is emitted on the drop site when the user drops
573 /// the data onto the widget. The signal handler must determine whether
574 /// the cursor position is in a drop zone or not. If it is not in a drop
575 /// zone, it returns [`false`] and no further processing is necessary.
576 /// Otherwise, the handler returns [`true`]. In this case, the handler must
577 /// ensure that `gtk_drag_finish()` is called to let the source know that
578 /// the drop is done. The call to `gtk_drag_finish()` can be done either
579 /// directly or in a [`drag-data-received`][struct@crate::Widget#drag-data-received] handler which gets
580 /// triggered by calling [`WidgetExt::drag_get_data()`][crate::prelude::WidgetExt::drag_get_data()] to receive the data for one
581 /// or more of the supported targets.
582 ///
583 ///
584 ///
585 ///
586 /// #### `drag-end`
587 /// The ::drag-end signal is emitted on the drag source when a drag is
588 /// finished. A typical reason to connect to this signal is to undo
589 /// things done in [`drag-begin`][struct@crate::Widget#drag-begin].
590 ///
591 ///
592 ///
593 ///
594 /// #### `drag-failed`
595 /// The ::drag-failed signal is emitted on the drag source when a drag has
596 /// failed. The signal handler may hook custom code to handle a failed DnD
597 /// operation based on the type of error, it returns [`true`] is the failure has
598 /// been already handled (not showing the default "drag operation failed"
599 /// animation), otherwise it returns [`false`].
600 ///
601 ///
602 ///
603 ///
604 /// #### `drag-leave`
605 /// The ::drag-leave signal is emitted on the drop site when the cursor
606 /// leaves the widget. A typical reason to connect to this signal is to
607 /// undo things done in [`drag-motion`][struct@crate::Widget#drag-motion], e.g. undo highlighting
608 /// with [`WidgetExt::drag_unhighlight()`][crate::prelude::WidgetExt::drag_unhighlight()].
609 ///
610 ///
611 /// Likewise, the [`drag-leave`][struct@crate::Widget#drag-leave] signal is also emitted before the
612 /// ::drag-drop signal, for instance to allow cleaning up of a preview item
613 /// created in the [`drag-motion`][struct@crate::Widget#drag-motion] signal handler.
614 ///
615 ///
616 ///
617 ///
618 /// #### `drag-motion`
619 /// suggested_action,
620 /// time);
621 /// }
622 /// else
623 /// {
624 /// // accept the drop
625 /// }
626 /// }
627 /// ]|
628 ///
629 ///
630 ///
631 ///
632 /// #### `draw`
633 /// This signal is emitted when a widget is supposed to render itself.
634 /// The `widget`'s top left corner must be painted at the origin of
635 /// the passed in context and be sized to the values returned by
636 /// [`WidgetExt::allocated_width()`][crate::prelude::WidgetExt::allocated_width()] and
637 /// [`WidgetExt::allocated_height()`][crate::prelude::WidgetExt::allocated_height()].
638 ///
639 /// Signal handlers connected to this signal can modify the cairo
640 /// context passed as `cr` in any way they like and don't need to
641 /// restore it. The signal emission takes care of calling `cairo_save()`
642 /// before and `cairo_restore()` after invoking the handler.
643 ///
644 /// The signal handler will get a `cr` with a clip region already set to the
645 /// widget's dirty region, i.e. to the area that needs repainting. Complicated
646 /// widgets that want to avoid redrawing themselves completely can get the full
647 /// extents of the clip region with `gdk_cairo_get_clip_rectangle()`, or they can
648 /// get a finer-grained representation of the dirty region with
649 /// `cairo_copy_clip_rectangle_list()`.
650 ///
651 ///
652 ///
653 ///
654 /// #### `enter-notify-event`
655 /// The ::enter-notify-event will be emitted when the pointer enters
656 /// the `widget`'s window.
657 ///
658 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
659 /// to enable the [`gdk::EventMask::ENTER_NOTIFY_MASK`][crate::gdk::EventMask::ENTER_NOTIFY_MASK] mask.
660 ///
661 /// This signal will be sent to the grab widget if there is one.
662 ///
663 ///
664 ///
665 ///
666 /// #### `event`
667 /// The GTK+ main loop will emit three signals for each GDK event delivered
668 /// to a widget: one generic ::event signal, another, more specific,
669 /// signal that matches the type of event delivered (e.g.
670 /// [`key-press-event`][struct@crate::Widget#key-press-event]) and finally a generic
671 /// [`event-after`][struct@crate::Widget#event-after] signal.
672 ///
673 ///
674 ///
675 ///
676 /// #### `event-after`
677 /// After the emission of the [`event`][struct@crate::Widget#event] signal and (optionally)
678 /// the second more specific signal, ::event-after will be emitted
679 /// regardless of the previous two signals handlers return values.
680 ///
681 ///
682 ///
683 ///
684 /// #### `focus`
685 ///
686 ///
687 ///
688 /// #### `focus-in-event`
689 /// The ::focus-in-event signal will be emitted when the keyboard focus
690 /// enters the `widget`'s window.
691 ///
692 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
693 /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
694 ///
695 ///
696 ///
697 ///
698 /// #### `focus-out-event`
699 /// The ::focus-out-event signal will be emitted when the keyboard focus
700 /// leaves the `widget`'s window.
701 ///
702 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
703 /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
704 ///
705 ///
706 ///
707 ///
708 /// #### `grab-broken-event`
709 /// Emitted when a pointer or keyboard grab on a window belonging
710 /// to `widget` gets broken.
711 ///
712 /// On X11, this happens when the grab window becomes unviewable
713 /// (i.e. it or one of its ancestors is unmapped), or if the same
714 /// application grabs the pointer or keyboard again.
715 ///
716 ///
717 ///
718 ///
719 /// #### `grab-focus`
720 /// Action
721 ///
722 ///
723 /// #### `grab-notify`
724 /// The ::grab-notify signal is emitted when a widget becomes
725 /// shadowed by a GTK+ grab (not a pointer or keyboard grab) on
726 /// another widget, or when it becomes unshadowed due to a grab
727 /// being removed.
728 ///
729 /// A widget is shadowed by a [`WidgetExt::grab_add()`][crate::prelude::WidgetExt::grab_add()] when the topmost
730 /// grab widget in the grab stack of its window group is not
731 /// its ancestor.
732 ///
733 ///
734 ///
735 ///
736 /// #### `hide`
737 /// The ::hide signal is emitted when `widget` is hidden, for example with
738 /// [`WidgetExt::hide()`][crate::prelude::WidgetExt::hide()].
739 ///
740 ///
741 ///
742 ///
743 /// #### `hierarchy-changed`
744 /// The ::hierarchy-changed signal is emitted when the
745 /// anchored state of a widget changes. A widget is
746 /// “anchored” when its toplevel
747 /// ancestor is a [`Window`][crate::Window]. This signal is emitted when
748 /// a widget changes from un-anchored to anchored or vice-versa.
749 ///
750 ///
751 ///
752 ///
753 /// #### `key-press-event`
754 /// The ::key-press-event signal is emitted when a key is pressed. The signal
755 /// emission will reoccur at the key-repeat rate when the key is kept pressed.
756 ///
757 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
758 /// to enable the [`gdk::EventMask::KEY_PRESS_MASK`][crate::gdk::EventMask::KEY_PRESS_MASK] mask.
759 ///
760 /// This signal will be sent to the grab widget if there is one.
761 ///
762 ///
763 ///
764 ///
765 /// #### `key-release-event`
766 /// The ::key-release-event signal is emitted when a key is released.
767 ///
768 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
769 /// to enable the [`gdk::EventMask::KEY_RELEASE_MASK`][crate::gdk::EventMask::KEY_RELEASE_MASK] mask.
770 ///
771 /// This signal will be sent to the grab widget if there is one.
772 ///
773 ///
774 ///
775 ///
776 /// #### `keynav-failed`
777 /// Gets emitted if keyboard navigation fails.
778 /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
779 ///
780 ///
781 ///
782 ///
783 /// #### `leave-notify-event`
784 /// The ::leave-notify-event will be emitted when the pointer leaves
785 /// the `widget`'s window.
786 ///
787 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
788 /// to enable the [`gdk::EventMask::LEAVE_NOTIFY_MASK`][crate::gdk::EventMask::LEAVE_NOTIFY_MASK] mask.
789 ///
790 /// This signal will be sent to the grab widget if there is one.
791 ///
792 ///
793 ///
794 ///
795 /// #### `map`
796 /// The ::map signal is emitted when `widget` is going to be mapped, that is
797 /// when the widget is visible (which is controlled with
798 /// [`WidgetExt::set_visible()`][crate::prelude::WidgetExt::set_visible()]) and all its parents up to the toplevel widget
799 /// are also visible. Once the map has occurred, [`map-event`][struct@crate::Widget#map-event] will
800 /// be emitted.
801 ///
802 /// The ::map signal can be used to determine whether a widget will be drawn,
803 /// for instance it can resume an animation that was stopped during the
804 /// emission of [`unmap`][struct@crate::Widget#unmap].
805 ///
806 ///
807 ///
808 ///
809 /// #### `map-event`
810 /// The ::map-event signal will be emitted when the `widget`'s window is
811 /// mapped. A window is mapped when it becomes visible on the screen.
812 ///
813 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
814 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
815 /// automatically for all new windows.
816 ///
817 ///
818 ///
819 ///
820 /// #### `mnemonic-activate`
821 /// The default handler for this signal activates `widget` if `group_cycling`
822 /// is [`false`], or just makes `widget` grab focus if `group_cycling` is [`true`].
823 ///
824 ///
825 ///
826 ///
827 /// #### `motion-notify-event`
828 /// The ::motion-notify-event signal is emitted when the pointer moves
829 /// over the widget's [`gdk::Window`][crate::gdk::Window].
830 ///
831 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget
832 /// needs to enable the [`gdk::EventMask::POINTER_MOTION_MASK`][crate::gdk::EventMask::POINTER_MOTION_MASK] mask.
833 ///
834 /// This signal will be sent to the grab widget if there is one.
835 ///
836 ///
837 ///
838 ///
839 /// #### `move-focus`
840 /// Action
841 ///
842 ///
843 /// #### `parent-set`
844 /// The ::parent-set signal is emitted when a new parent
845 /// has been set on a widget.
846 ///
847 ///
848 ///
849 ///
850 /// #### `popup-menu`
851 /// This signal gets emitted whenever a widget should pop up a context
852 /// menu. This usually happens through the standard key binding mechanism;
853 /// by pressing a certain key while a widget is focused, the user can cause
854 /// the widget to pop up a menu. For example, the [`Entry`][crate::Entry] widget creates
855 /// a menu with clipboard commands. See the
856 /// [Popup Menu Migration Checklist][checklist-popup-menu]
857 /// for an example of how to use this signal.
858 ///
859 /// Action
860 ///
861 ///
862 /// #### `property-notify-event`
863 /// The ::property-notify-event signal will be emitted when a property on
864 /// the `widget`'s window has been changed or deleted.
865 ///
866 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
867 /// to enable the [`gdk::EventMask::PROPERTY_CHANGE_MASK`][crate::gdk::EventMask::PROPERTY_CHANGE_MASK] mask.
868 ///
869 ///
870 ///
871 ///
872 /// #### `proximity-in-event`
873 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
874 /// to enable the [`gdk::EventMask::PROXIMITY_IN_MASK`][crate::gdk::EventMask::PROXIMITY_IN_MASK] mask.
875 ///
876 /// This signal will be sent to the grab widget if there is one.
877 ///
878 ///
879 ///
880 ///
881 /// #### `proximity-out-event`
882 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
883 /// to enable the [`gdk::EventMask::PROXIMITY_OUT_MASK`][crate::gdk::EventMask::PROXIMITY_OUT_MASK] mask.
884 ///
885 /// This signal will be sent to the grab widget if there is one.
886 ///
887 ///
888 ///
889 ///
890 /// #### `query-tooltip`
891 /// Emitted when [`has-tooltip`][struct@crate::Widget#has-tooltip] is [`true`] and the hover timeout
892 /// has expired with the cursor hovering "above" `widget`; or emitted when `widget` got
893 /// focus in keyboard mode.
894 ///
895 /// Using the given coordinates, the signal handler should determine
896 /// whether a tooltip should be shown for `widget`. If this is the case
897 /// [`true`] should be returned, [`false`] otherwise. Note that if
898 /// `keyboard_mode` is [`true`], the values of `x` and `y` are undefined and
899 /// should not be used.
900 ///
901 /// The signal handler is free to manipulate `tooltip` with the therefore
902 /// destined function calls.
903 ///
904 ///
905 ///
906 ///
907 /// #### `realize`
908 /// The ::realize signal is emitted when `widget` is associated with a
909 /// [`gdk::Window`][crate::gdk::Window], which means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called or the
910 /// widget has been mapped (that is, it is going to be drawn).
911 ///
912 ///
913 ///
914 ///
915 /// #### `screen-changed`
916 /// The ::screen-changed signal gets emitted when the
917 /// screen of a widget has changed.
918 ///
919 ///
920 ///
921 ///
922 /// #### `scroll-event`
923 /// The ::scroll-event signal is emitted when a button in the 4 to 7
924 /// range is pressed. Wheel mice are usually configured to generate
925 /// button press events for buttons 4 and 5 when the wheel is turned.
926 ///
927 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
928 /// to enable the [`gdk::EventMask::SCROLL_MASK`][crate::gdk::EventMask::SCROLL_MASK] mask.
929 ///
930 /// This signal will be sent to the grab widget if there is one.
931 ///
932 ///
933 ///
934 ///
935 /// #### `selection-clear-event`
936 /// The ::selection-clear-event signal will be emitted when the
937 /// the `widget`'s window has lost ownership of a selection.
938 ///
939 ///
940 ///
941 ///
942 /// #### `selection-get`
943 ///
944 ///
945 ///
946 /// #### `selection-notify-event`
947 ///
948 ///
949 ///
950 /// #### `selection-received`
951 ///
952 ///
953 ///
954 /// #### `selection-request-event`
955 /// The ::selection-request-event signal will be emitted when
956 /// another client requests ownership of the selection owned by
957 /// the `widget`'s window.
958 ///
959 ///
960 ///
961 ///
962 /// #### `show`
963 /// The ::show signal is emitted when `widget` is shown, for example with
964 /// [`WidgetExt::show()`][crate::prelude::WidgetExt::show()].
965 ///
966 ///
967 ///
968 ///
969 /// #### `show-help`
970 /// Action
971 ///
972 ///
973 /// #### `size-allocate`
974 ///
975 ///
976 ///
977 /// #### `state-changed`
978 /// The ::state-changed signal is emitted when the widget state changes.
979 /// See `gtk_widget_get_state()`.
980 ///
981 ///
982 ///
983 ///
984 /// #### `state-flags-changed`
985 /// The ::state-flags-changed signal is emitted when the widget state
986 /// changes, see [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
987 ///
988 ///
989 ///
990 ///
991 /// #### `style-set`
992 /// The ::style-set signal is emitted when a new style has been set
993 /// on a widget. Note that style-modifying functions like
994 /// `gtk_widget_modify_base()` also cause this signal to be emitted.
995 ///
996 /// Note that this signal is emitted for changes to the deprecated
997 /// `GtkStyle`. To track changes to the [`StyleContext`][crate::StyleContext] associated
998 /// with a widget, use the [`style-updated`][struct@crate::Widget#style-updated] signal.
999 ///
1000 ///
1001 ///
1002 ///
1003 /// #### `style-updated`
1004 /// The ::style-updated signal is a convenience signal that is emitted when the
1005 /// [`changed`][struct@crate::StyleContext#changed] signal is emitted on the `widget`'s associated
1006 /// [`StyleContext`][crate::StyleContext] as returned by [`WidgetExt::style_context()`][crate::prelude::WidgetExt::style_context()].
1007 ///
1008 /// Note that style-modifying functions like `gtk_widget_override_color()` also
1009 /// cause this signal to be emitted.
1010 ///
1011 ///
1012 ///
1013 ///
1014 /// #### `touch-event`
1015 ///
1016 ///
1017 ///
1018 /// #### `unmap`
1019 /// The ::unmap signal is emitted when `widget` is going to be unmapped, which
1020 /// means that either it or any of its parents up to the toplevel widget have
1021 /// been set as hidden.
1022 ///
1023 /// As ::unmap indicates that a widget will not be shown any longer, it can be
1024 /// used to, for example, stop an animation on the widget.
1025 ///
1026 ///
1027 ///
1028 ///
1029 /// #### `unmap-event`
1030 /// The ::unmap-event signal will be emitted when the `widget`'s window is
1031 /// unmapped. A window is unmapped when it becomes invisible on the screen.
1032 ///
1033 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1034 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
1035 /// automatically for all new windows.
1036 ///
1037 ///
1038 ///
1039 ///
1040 /// #### `unrealize`
1041 /// The ::unrealize signal is emitted when the [`gdk::Window`][crate::gdk::Window] associated with
1042 /// `widget` is destroyed, which means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been
1043 /// called or the widget has been unmapped (that is, it is going to be
1044 /// hidden).
1045 ///
1046 ///
1047 ///
1048 ///
1049 /// #### `visibility-notify-event`
1050 /// The ::visibility-notify-event will be emitted when the `widget`'s
1051 /// window is obscured or unobscured.
1052 ///
1053 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1054 /// to enable the [`gdk::EventMask::VISIBILITY_NOTIFY_MASK`][crate::gdk::EventMask::VISIBILITY_NOTIFY_MASK] mask.
1055 ///
1056 ///
1057 ///
1058 ///
1059 /// #### `window-state-event`
1060 /// The ::window-state-event will be emitted when the state of the
1061 /// toplevel window associated to the `widget` changes.
1062 ///
1063 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget
1064 /// needs to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable
1065 /// this mask automatically for all new windows.
1066 ///
1067 ///
1068 /// </details>
1069 ///
1070 /// # Implements
1071 ///
1072 /// [`RangeExt`][trait@crate::prelude::RangeExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`OrientableExt`][trait@crate::prelude::OrientableExt], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
1073 #[doc(alias = "GtkRange")]
1074 pub struct Range(Object<ffi::GtkRange, ffi::GtkRangeClass>) @extends Widget, @implements Buildable, Orientable;
1075
1076 match fn {
1077 type_ => || ffi::gtk_range_get_type(),
1078 }
1079}
1080
1081impl Range {
1082 pub const NONE: Option<&'static Range> = None;
1083}
1084
1085/// Trait containing all [`struct@Range`] methods.
1086///
1087/// # Implementors
1088///
1089/// [`Range`][struct@crate::Range], [`Scale`][struct@crate::Scale], [`Scrollbar`][struct@crate::Scrollbar]
1090pub trait RangeExt: IsA<Range> + 'static {
1091 /// Get the [`Adjustment`][crate::Adjustment] which is the “model” object for [`Range`][crate::Range].
1092 /// See [`set_adjustment()`][Self::set_adjustment()] for details.
1093 /// The return value does not have a reference added, so should not
1094 /// be unreferenced.
1095 ///
1096 /// # Returns
1097 ///
1098 /// a [`Adjustment`][crate::Adjustment]
1099 #[doc(alias = "gtk_range_get_adjustment")]
1100 #[doc(alias = "get_adjustment")]
1101 fn adjustment(&self) -> Adjustment {
1102 unsafe {
1103 from_glib_none(ffi::gtk_range_get_adjustment(
1104 self.as_ref().to_glib_none().0,
1105 ))
1106 }
1107 }
1108
1109 /// Gets the current position of the fill level indicator.
1110 ///
1111 /// # Returns
1112 ///
1113 /// The current fill level
1114 #[doc(alias = "gtk_range_get_fill_level")]
1115 #[doc(alias = "get_fill_level")]
1116 #[doc(alias = "fill-level")]
1117 fn fill_level(&self) -> f64 {
1118 unsafe { ffi::gtk_range_get_fill_level(self.as_ref().to_glib_none().0) }
1119 }
1120
1121 /// Gets the value set by [`set_flippable()`][Self::set_flippable()].
1122 ///
1123 /// # Returns
1124 ///
1125 /// [`true`] if the range is flippable
1126 #[doc(alias = "gtk_range_get_flippable")]
1127 #[doc(alias = "get_flippable")]
1128 fn is_flippable(&self) -> bool {
1129 unsafe { from_glib(ffi::gtk_range_get_flippable(self.as_ref().to_glib_none().0)) }
1130 }
1131
1132 /// Gets the value set by [`set_inverted()`][Self::set_inverted()].
1133 ///
1134 /// # Returns
1135 ///
1136 /// [`true`] if the range is inverted
1137 #[doc(alias = "gtk_range_get_inverted")]
1138 #[doc(alias = "get_inverted")]
1139 #[doc(alias = "inverted")]
1140 fn is_inverted(&self) -> bool {
1141 unsafe { from_glib(ffi::gtk_range_get_inverted(self.as_ref().to_glib_none().0)) }
1142 }
1143
1144 /// Gets the sensitivity policy for the stepper that points to the
1145 /// 'lower' end of the GtkRange’s adjustment.
1146 ///
1147 /// # Returns
1148 ///
1149 /// The lower stepper’s sensitivity policy.
1150 #[doc(alias = "gtk_range_get_lower_stepper_sensitivity")]
1151 #[doc(alias = "get_lower_stepper_sensitivity")]
1152 #[doc(alias = "lower-stepper-sensitivity")]
1153 fn lower_stepper_sensitivity(&self) -> SensitivityType {
1154 unsafe {
1155 from_glib(ffi::gtk_range_get_lower_stepper_sensitivity(
1156 self.as_ref().to_glib_none().0,
1157 ))
1158 }
1159 }
1160
1161 /// window coordinates.
1162 ///
1163 /// This function is useful mainly for [`Range`][crate::Range] subclasses.
1164 ///
1165 /// # Returns
1166 ///
1167 ///
1168 /// ## `range_rect`
1169 /// return location for the range rectangle
1170 #[doc(alias = "gtk_range_get_range_rect")]
1171 #[doc(alias = "get_range_rect")]
1172 fn range_rect(&self) -> gdk::Rectangle {
1173 unsafe {
1174 let mut range_rect = gdk::Rectangle::uninitialized();
1175 ffi::gtk_range_get_range_rect(
1176 self.as_ref().to_glib_none().0,
1177 range_rect.to_glib_none_mut().0,
1178 );
1179 range_rect
1180 }
1181 }
1182
1183 /// Gets whether the range is restricted to the fill level.
1184 ///
1185 /// # Returns
1186 ///
1187 /// [`true`] if `self` is restricted to the fill level.
1188 #[doc(alias = "gtk_range_get_restrict_to_fill_level")]
1189 #[doc(alias = "get_restrict_to_fill_level")]
1190 #[doc(alias = "restrict-to-fill-level")]
1191 fn restricts_to_fill_level(&self) -> bool {
1192 unsafe {
1193 from_glib(ffi::gtk_range_get_restrict_to_fill_level(
1194 self.as_ref().to_glib_none().0,
1195 ))
1196 }
1197 }
1198
1199 /// Gets the number of digits to round the value to when
1200 /// it changes. See [`change-value`][struct@crate::Range#change-value].
1201 ///
1202 /// # Returns
1203 ///
1204 /// the number of digits to round to
1205 #[doc(alias = "gtk_range_get_round_digits")]
1206 #[doc(alias = "get_round_digits")]
1207 #[doc(alias = "round-digits")]
1208 fn round_digits(&self) -> i32 {
1209 unsafe { ffi::gtk_range_get_round_digits(self.as_ref().to_glib_none().0) }
1210 }
1211
1212 /// Gets whether the range displays the fill level graphically.
1213 ///
1214 /// # Returns
1215 ///
1216 /// [`true`] if `self` shows the fill level.
1217 #[doc(alias = "gtk_range_get_show_fill_level")]
1218 #[doc(alias = "get_show_fill_level")]
1219 #[doc(alias = "show-fill-level")]
1220 fn shows_fill_level(&self) -> bool {
1221 unsafe {
1222 from_glib(ffi::gtk_range_get_show_fill_level(
1223 self.as_ref().to_glib_none().0,
1224 ))
1225 }
1226 }
1227
1228 /// window coordinates.
1229 ///
1230 /// This function is useful mainly for [`Range`][crate::Range] subclasses.
1231 ///
1232 /// # Returns
1233 ///
1234 ///
1235 /// ## `slider_start`
1236 /// return location for the slider's
1237 /// start, or [`None`]
1238 ///
1239 /// ## `slider_end`
1240 /// return location for the slider's
1241 /// end, or [`None`]
1242 #[doc(alias = "gtk_range_get_slider_range")]
1243 #[doc(alias = "get_slider_range")]
1244 fn slider_range(&self) -> (i32, i32) {
1245 unsafe {
1246 let mut slider_start = std::mem::MaybeUninit::uninit();
1247 let mut slider_end = std::mem::MaybeUninit::uninit();
1248 ffi::gtk_range_get_slider_range(
1249 self.as_ref().to_glib_none().0,
1250 slider_start.as_mut_ptr(),
1251 slider_end.as_mut_ptr(),
1252 );
1253 (slider_start.assume_init(), slider_end.assume_init())
1254 }
1255 }
1256
1257 /// This function is useful mainly for [`Range`][crate::Range] subclasses.
1258 ///
1259 /// See [`set_slider_size_fixed()`][Self::set_slider_size_fixed()].
1260 ///
1261 /// # Returns
1262 ///
1263 /// whether the range’s slider has a fixed size.
1264 #[doc(alias = "gtk_range_get_slider_size_fixed")]
1265 #[doc(alias = "get_slider_size_fixed")]
1266 fn is_slider_size_fixed(&self) -> bool {
1267 unsafe {
1268 from_glib(ffi::gtk_range_get_slider_size_fixed(
1269 self.as_ref().to_glib_none().0,
1270 ))
1271 }
1272 }
1273
1274 /// Gets the sensitivity policy for the stepper that points to the
1275 /// 'upper' end of the GtkRange’s adjustment.
1276 ///
1277 /// # Returns
1278 ///
1279 /// The upper stepper’s sensitivity policy.
1280 #[doc(alias = "gtk_range_get_upper_stepper_sensitivity")]
1281 #[doc(alias = "get_upper_stepper_sensitivity")]
1282 #[doc(alias = "upper-stepper-sensitivity")]
1283 fn upper_stepper_sensitivity(&self) -> SensitivityType {
1284 unsafe {
1285 from_glib(ffi::gtk_range_get_upper_stepper_sensitivity(
1286 self.as_ref().to_glib_none().0,
1287 ))
1288 }
1289 }
1290
1291 /// Gets the current value of the range.
1292 ///
1293 /// # Returns
1294 ///
1295 /// current value of the range.
1296 #[doc(alias = "gtk_range_get_value")]
1297 #[doc(alias = "get_value")]
1298 fn value(&self) -> f64 {
1299 unsafe { ffi::gtk_range_get_value(self.as_ref().to_glib_none().0) }
1300 }
1301
1302 /// Sets the adjustment to be used as the “model” object for this range
1303 /// widget. The adjustment indicates the current range value, the
1304 /// minimum and maximum range values, the step/page increments used
1305 /// for keybindings and scrolling, and the page size. The page size
1306 /// is normally 0 for [`Scale`][crate::Scale] and nonzero for [`Scrollbar`][crate::Scrollbar], and
1307 /// indicates the size of the visible area of the widget being scrolled.
1308 /// The page size affects the size of the scrollbar slider.
1309 /// ## `adjustment`
1310 /// a [`Adjustment`][crate::Adjustment]
1311 #[doc(alias = "gtk_range_set_adjustment")]
1312 #[doc(alias = "adjustment")]
1313 fn set_adjustment(&self, adjustment: &impl IsA<Adjustment>) {
1314 unsafe {
1315 ffi::gtk_range_set_adjustment(
1316 self.as_ref().to_glib_none().0,
1317 adjustment.as_ref().to_glib_none().0,
1318 );
1319 }
1320 }
1321
1322 /// Set the new position of the fill level indicator.
1323 ///
1324 /// The “fill level” is probably best described by its most prominent
1325 /// use case, which is an indicator for the amount of pre-buffering in
1326 /// a streaming media player. In that use case, the value of the range
1327 /// would indicate the current play position, and the fill level would
1328 /// be the position up to which the file/stream has been downloaded.
1329 ///
1330 /// This amount of prebuffering can be displayed on the range’s trough
1331 /// and is themeable separately from the trough. To enable fill level
1332 /// display, use [`set_show_fill_level()`][Self::set_show_fill_level()]. The range defaults
1333 /// to not showing the fill level.
1334 ///
1335 /// Additionally, it’s possible to restrict the range’s slider position
1336 /// to values which are smaller than the fill level. This is controller
1337 /// by [`set_restrict_to_fill_level()`][Self::set_restrict_to_fill_level()] and is by default
1338 /// enabled.
1339 /// ## `fill_level`
1340 /// the new position of the fill level indicator
1341 #[doc(alias = "gtk_range_set_fill_level")]
1342 #[doc(alias = "fill-level")]
1343 fn set_fill_level(&self, fill_level: f64) {
1344 unsafe {
1345 ffi::gtk_range_set_fill_level(self.as_ref().to_glib_none().0, fill_level);
1346 }
1347 }
1348
1349 /// If a range is flippable, it will switch its direction if it is
1350 /// horizontal and its direction is [`TextDirection::Rtl`][crate::TextDirection::Rtl].
1351 ///
1352 /// See [`WidgetExt::direction()`][crate::prelude::WidgetExt::direction()].
1353 /// ## `flippable`
1354 /// [`true`] to make the range flippable
1355 #[doc(alias = "gtk_range_set_flippable")]
1356 fn set_flippable(&self, flippable: bool) {
1357 unsafe {
1358 ffi::gtk_range_set_flippable(self.as_ref().to_glib_none().0, flippable.into_glib());
1359 }
1360 }
1361
1362 /// Sets the step and page sizes for the range.
1363 /// The step size is used when the user clicks the [`Scrollbar`][crate::Scrollbar]
1364 /// arrows or moves [`Scale`][crate::Scale] via arrow keys. The page size
1365 /// is used for example when moving via Page Up or Page Down keys.
1366 /// ## `step`
1367 /// step size
1368 /// ## `page`
1369 /// page size
1370 #[doc(alias = "gtk_range_set_increments")]
1371 fn set_increments(&self, step: f64, page: f64) {
1372 unsafe {
1373 ffi::gtk_range_set_increments(self.as_ref().to_glib_none().0, step, page);
1374 }
1375 }
1376
1377 /// Ranges normally move from lower to higher values as the
1378 /// slider moves from top to bottom or left to right. Inverted
1379 /// ranges have higher values at the top or on the right rather than
1380 /// on the bottom or left.
1381 /// ## `setting`
1382 /// [`true`] to invert the range
1383 #[doc(alias = "gtk_range_set_inverted")]
1384 #[doc(alias = "inverted")]
1385 fn set_inverted(&self, setting: bool) {
1386 unsafe {
1387 ffi::gtk_range_set_inverted(self.as_ref().to_glib_none().0, setting.into_glib());
1388 }
1389 }
1390
1391 /// Sets the sensitivity policy for the stepper that points to the
1392 /// 'lower' end of the GtkRange’s adjustment.
1393 /// ## `sensitivity`
1394 /// the lower stepper’s sensitivity policy.
1395 #[doc(alias = "gtk_range_set_lower_stepper_sensitivity")]
1396 #[doc(alias = "lower-stepper-sensitivity")]
1397 fn set_lower_stepper_sensitivity(&self, sensitivity: SensitivityType) {
1398 unsafe {
1399 ffi::gtk_range_set_lower_stepper_sensitivity(
1400 self.as_ref().to_glib_none().0,
1401 sensitivity.into_glib(),
1402 );
1403 }
1404 }
1405
1406 /// Sets the allowable values in the [`Range`][crate::Range], and clamps the range
1407 /// value to be between `min` and `max`. (If the range has a non-zero
1408 /// page size, it is clamped between `min` and `max` - page-size.)
1409 /// ## `min`
1410 /// minimum range value
1411 /// ## `max`
1412 /// maximum range value
1413 #[doc(alias = "gtk_range_set_range")]
1414 fn set_range(&self, min: f64, max: f64) {
1415 unsafe {
1416 ffi::gtk_range_set_range(self.as_ref().to_glib_none().0, min, max);
1417 }
1418 }
1419
1420 /// Sets whether the slider is restricted to the fill level. See
1421 /// [`set_fill_level()`][Self::set_fill_level()] for a general description of the fill
1422 /// level concept.
1423 /// ## `restrict_to_fill_level`
1424 /// Whether the fill level restricts slider movement.
1425 #[doc(alias = "gtk_range_set_restrict_to_fill_level")]
1426 #[doc(alias = "restrict-to-fill-level")]
1427 fn set_restrict_to_fill_level(&self, restrict_to_fill_level: bool) {
1428 unsafe {
1429 ffi::gtk_range_set_restrict_to_fill_level(
1430 self.as_ref().to_glib_none().0,
1431 restrict_to_fill_level.into_glib(),
1432 );
1433 }
1434 }
1435
1436 /// Sets the number of digits to round the value to when
1437 /// it changes. See [`change-value`][struct@crate::Range#change-value].
1438 /// ## `round_digits`
1439 /// the precision in digits, or -1
1440 #[doc(alias = "gtk_range_set_round_digits")]
1441 #[doc(alias = "round-digits")]
1442 fn set_round_digits(&self, round_digits: i32) {
1443 unsafe {
1444 ffi::gtk_range_set_round_digits(self.as_ref().to_glib_none().0, round_digits);
1445 }
1446 }
1447
1448 /// Sets whether a graphical fill level is show on the trough. See
1449 /// [`set_fill_level()`][Self::set_fill_level()] for a general description of the fill
1450 /// level concept.
1451 /// ## `show_fill_level`
1452 /// Whether a fill level indicator graphics is shown.
1453 #[doc(alias = "gtk_range_set_show_fill_level")]
1454 #[doc(alias = "show-fill-level")]
1455 fn set_show_fill_level(&self, show_fill_level: bool) {
1456 unsafe {
1457 ffi::gtk_range_set_show_fill_level(
1458 self.as_ref().to_glib_none().0,
1459 show_fill_level.into_glib(),
1460 );
1461 }
1462 }
1463
1464 /// Sets whether the range’s slider has a fixed size, or a size that
1465 /// depends on its adjustment’s page size.
1466 ///
1467 /// This function is useful mainly for [`Range`][crate::Range] subclasses.
1468 /// ## `size_fixed`
1469 /// [`true`] to make the slider size constant
1470 #[doc(alias = "gtk_range_set_slider_size_fixed")]
1471 fn set_slider_size_fixed(&self, size_fixed: bool) {
1472 unsafe {
1473 ffi::gtk_range_set_slider_size_fixed(
1474 self.as_ref().to_glib_none().0,
1475 size_fixed.into_glib(),
1476 );
1477 }
1478 }
1479
1480 /// Sets the sensitivity policy for the stepper that points to the
1481 /// 'upper' end of the GtkRange’s adjustment.
1482 /// ## `sensitivity`
1483 /// the upper stepper’s sensitivity policy.
1484 #[doc(alias = "gtk_range_set_upper_stepper_sensitivity")]
1485 #[doc(alias = "upper-stepper-sensitivity")]
1486 fn set_upper_stepper_sensitivity(&self, sensitivity: SensitivityType) {
1487 unsafe {
1488 ffi::gtk_range_set_upper_stepper_sensitivity(
1489 self.as_ref().to_glib_none().0,
1490 sensitivity.into_glib(),
1491 );
1492 }
1493 }
1494
1495 /// Sets the current value of the range; if the value is outside the
1496 /// minimum or maximum range values, it will be clamped to fit inside
1497 /// them. The range emits the [`value-changed`][struct@crate::Range#value-changed] signal if the
1498 /// value changes.
1499 /// ## `value`
1500 /// new value of the range
1501 #[doc(alias = "gtk_range_set_value")]
1502 fn set_value(&self, value: f64) {
1503 unsafe {
1504 ffi::gtk_range_set_value(self.as_ref().to_glib_none().0, value);
1505 }
1506 }
1507
1508 /// Emitted before clamping a value, to give the application a
1509 /// chance to adjust the bounds.
1510 /// ## `value`
1511 /// the value before we clamp
1512 #[doc(alias = "adjust-bounds")]
1513 fn connect_adjust_bounds<F: Fn(&Self, f64) + 'static>(&self, f: F) -> SignalHandlerId {
1514 unsafe extern "C" fn adjust_bounds_trampoline<P: IsA<Range>, F: Fn(&P, f64) + 'static>(
1515 this: *mut ffi::GtkRange,
1516 value: std::ffi::c_double,
1517 f: glib::ffi::gpointer,
1518 ) {
1519 unsafe {
1520 let f: &F = &*(f as *const F);
1521 f(Range::from_glib_borrow(this).unsafe_cast_ref(), value)
1522 }
1523 }
1524 unsafe {
1525 let f: Box_<F> = Box_::new(f);
1526 connect_raw(
1527 self.as_ptr() as *mut _,
1528 c"adjust-bounds".as_ptr(),
1529 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1530 adjust_bounds_trampoline::<Self, F> as *const (),
1531 )),
1532 Box_::into_raw(f),
1533 )
1534 }
1535 }
1536
1537 /// The [`change-value`][struct@crate::Range#change-value] signal is emitted when a scroll action is
1538 /// performed on a range. It allows an application to determine the
1539 /// type of scroll event that occurred and the resultant new value.
1540 /// The application can handle the event itself and return [`true`] to
1541 /// prevent further processing. Or, by returning [`false`], it can pass
1542 /// the event to other handlers until the default GTK+ handler is
1543 /// reached.
1544 ///
1545 /// The value parameter is unrounded. An application that overrides
1546 /// the GtkRange::change-value signal is responsible for clamping the
1547 /// value to the desired number of decimal digits; the default GTK+
1548 /// handler clamps the value based on [`round-digits`][struct@crate::Range#round-digits].
1549 /// ## `scroll`
1550 /// the type of scroll action that was performed
1551 /// ## `value`
1552 /// the new value resulting from the scroll action
1553 ///
1554 /// # Returns
1555 ///
1556 /// [`true`] to prevent other handlers from being invoked for
1557 /// the signal, [`false`] to propagate the signal further
1558 #[doc(alias = "change-value")]
1559 fn connect_change_value<F: Fn(&Self, ScrollType, f64) -> glib::Propagation + 'static>(
1560 &self,
1561 f: F,
1562 ) -> SignalHandlerId {
1563 unsafe extern "C" fn change_value_trampoline<
1564 P: IsA<Range>,
1565 F: Fn(&P, ScrollType, f64) -> glib::Propagation + 'static,
1566 >(
1567 this: *mut ffi::GtkRange,
1568 scroll: ffi::GtkScrollType,
1569 value: std::ffi::c_double,
1570 f: glib::ffi::gpointer,
1571 ) -> glib::ffi::gboolean {
1572 unsafe {
1573 let f: &F = &*(f as *const F);
1574 f(
1575 Range::from_glib_borrow(this).unsafe_cast_ref(),
1576 from_glib(scroll),
1577 value,
1578 )
1579 .into_glib()
1580 }
1581 }
1582 unsafe {
1583 let f: Box_<F> = Box_::new(f);
1584 connect_raw(
1585 self.as_ptr() as *mut _,
1586 c"change-value".as_ptr(),
1587 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1588 change_value_trampoline::<Self, F> as *const (),
1589 )),
1590 Box_::into_raw(f),
1591 )
1592 }
1593 }
1594
1595 /// Virtual function that moves the slider. Used for keybindings.
1596 /// ## `step`
1597 /// how to move the slider
1598 #[doc(alias = "move-slider")]
1599 fn connect_move_slider<F: Fn(&Self, ScrollType) + 'static>(&self, f: F) -> SignalHandlerId {
1600 unsafe extern "C" fn move_slider_trampoline<
1601 P: IsA<Range>,
1602 F: Fn(&P, ScrollType) + 'static,
1603 >(
1604 this: *mut ffi::GtkRange,
1605 step: ffi::GtkScrollType,
1606 f: glib::ffi::gpointer,
1607 ) {
1608 unsafe {
1609 let f: &F = &*(f as *const F);
1610 f(
1611 Range::from_glib_borrow(this).unsafe_cast_ref(),
1612 from_glib(step),
1613 )
1614 }
1615 }
1616 unsafe {
1617 let f: Box_<F> = Box_::new(f);
1618 connect_raw(
1619 self.as_ptr() as *mut _,
1620 c"move-slider".as_ptr(),
1621 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1622 move_slider_trampoline::<Self, F> as *const (),
1623 )),
1624 Box_::into_raw(f),
1625 )
1626 }
1627 }
1628
1629 fn emit_move_slider(&self, step: ScrollType) {
1630 self.emit_by_name::<()>("move-slider", &[&step]);
1631 }
1632
1633 /// Emitted when the range value changes.
1634 #[doc(alias = "value-changed")]
1635 fn connect_value_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1636 unsafe extern "C" fn value_changed_trampoline<P: IsA<Range>, F: Fn(&P) + 'static>(
1637 this: *mut ffi::GtkRange,
1638 f: glib::ffi::gpointer,
1639 ) {
1640 unsafe {
1641 let f: &F = &*(f as *const F);
1642 f(Range::from_glib_borrow(this).unsafe_cast_ref())
1643 }
1644 }
1645 unsafe {
1646 let f: Box_<F> = Box_::new(f);
1647 connect_raw(
1648 self.as_ptr() as *mut _,
1649 c"value-changed".as_ptr(),
1650 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1651 value_changed_trampoline::<Self, F> as *const (),
1652 )),
1653 Box_::into_raw(f),
1654 )
1655 }
1656 }
1657
1658 #[doc(alias = "adjustment")]
1659 fn connect_adjustment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1660 unsafe extern "C" fn notify_adjustment_trampoline<P: IsA<Range>, F: Fn(&P) + 'static>(
1661 this: *mut ffi::GtkRange,
1662 _param_spec: glib::ffi::gpointer,
1663 f: glib::ffi::gpointer,
1664 ) {
1665 unsafe {
1666 let f: &F = &*(f as *const F);
1667 f(Range::from_glib_borrow(this).unsafe_cast_ref())
1668 }
1669 }
1670 unsafe {
1671 let f: Box_<F> = Box_::new(f);
1672 connect_raw(
1673 self.as_ptr() as *mut _,
1674 c"notify::adjustment".as_ptr(),
1675 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1676 notify_adjustment_trampoline::<Self, F> as *const (),
1677 )),
1678 Box_::into_raw(f),
1679 )
1680 }
1681 }
1682
1683 #[doc(alias = "fill-level")]
1684 fn connect_fill_level_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1685 unsafe extern "C" fn notify_fill_level_trampoline<P: IsA<Range>, F: Fn(&P) + 'static>(
1686 this: *mut ffi::GtkRange,
1687 _param_spec: glib::ffi::gpointer,
1688 f: glib::ffi::gpointer,
1689 ) {
1690 unsafe {
1691 let f: &F = &*(f as *const F);
1692 f(Range::from_glib_borrow(this).unsafe_cast_ref())
1693 }
1694 }
1695 unsafe {
1696 let f: Box_<F> = Box_::new(f);
1697 connect_raw(
1698 self.as_ptr() as *mut _,
1699 c"notify::fill-level".as_ptr(),
1700 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1701 notify_fill_level_trampoline::<Self, F> as *const (),
1702 )),
1703 Box_::into_raw(f),
1704 )
1705 }
1706 }
1707
1708 #[doc(alias = "inverted")]
1709 fn connect_inverted_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1710 unsafe extern "C" fn notify_inverted_trampoline<P: IsA<Range>, F: Fn(&P) + 'static>(
1711 this: *mut ffi::GtkRange,
1712 _param_spec: glib::ffi::gpointer,
1713 f: glib::ffi::gpointer,
1714 ) {
1715 unsafe {
1716 let f: &F = &*(f as *const F);
1717 f(Range::from_glib_borrow(this).unsafe_cast_ref())
1718 }
1719 }
1720 unsafe {
1721 let f: Box_<F> = Box_::new(f);
1722 connect_raw(
1723 self.as_ptr() as *mut _,
1724 c"notify::inverted".as_ptr(),
1725 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1726 notify_inverted_trampoline::<Self, F> as *const (),
1727 )),
1728 Box_::into_raw(f),
1729 )
1730 }
1731 }
1732
1733 #[doc(alias = "lower-stepper-sensitivity")]
1734 fn connect_lower_stepper_sensitivity_notify<F: Fn(&Self) + 'static>(
1735 &self,
1736 f: F,
1737 ) -> SignalHandlerId {
1738 unsafe extern "C" fn notify_lower_stepper_sensitivity_trampoline<
1739 P: IsA<Range>,
1740 F: Fn(&P) + 'static,
1741 >(
1742 this: *mut ffi::GtkRange,
1743 _param_spec: glib::ffi::gpointer,
1744 f: glib::ffi::gpointer,
1745 ) {
1746 unsafe {
1747 let f: &F = &*(f as *const F);
1748 f(Range::from_glib_borrow(this).unsafe_cast_ref())
1749 }
1750 }
1751 unsafe {
1752 let f: Box_<F> = Box_::new(f);
1753 connect_raw(
1754 self.as_ptr() as *mut _,
1755 c"notify::lower-stepper-sensitivity".as_ptr(),
1756 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1757 notify_lower_stepper_sensitivity_trampoline::<Self, F> as *const (),
1758 )),
1759 Box_::into_raw(f),
1760 )
1761 }
1762 }
1763
1764 #[doc(alias = "restrict-to-fill-level")]
1765 fn connect_restrict_to_fill_level_notify<F: Fn(&Self) + 'static>(
1766 &self,
1767 f: F,
1768 ) -> SignalHandlerId {
1769 unsafe extern "C" fn notify_restrict_to_fill_level_trampoline<
1770 P: IsA<Range>,
1771 F: Fn(&P) + 'static,
1772 >(
1773 this: *mut ffi::GtkRange,
1774 _param_spec: glib::ffi::gpointer,
1775 f: glib::ffi::gpointer,
1776 ) {
1777 unsafe {
1778 let f: &F = &*(f as *const F);
1779 f(Range::from_glib_borrow(this).unsafe_cast_ref())
1780 }
1781 }
1782 unsafe {
1783 let f: Box_<F> = Box_::new(f);
1784 connect_raw(
1785 self.as_ptr() as *mut _,
1786 c"notify::restrict-to-fill-level".as_ptr(),
1787 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1788 notify_restrict_to_fill_level_trampoline::<Self, F> as *const (),
1789 )),
1790 Box_::into_raw(f),
1791 )
1792 }
1793 }
1794
1795 #[doc(alias = "round-digits")]
1796 fn connect_round_digits_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1797 unsafe extern "C" fn notify_round_digits_trampoline<P: IsA<Range>, F: Fn(&P) + 'static>(
1798 this: *mut ffi::GtkRange,
1799 _param_spec: glib::ffi::gpointer,
1800 f: glib::ffi::gpointer,
1801 ) {
1802 unsafe {
1803 let f: &F = &*(f as *const F);
1804 f(Range::from_glib_borrow(this).unsafe_cast_ref())
1805 }
1806 }
1807 unsafe {
1808 let f: Box_<F> = Box_::new(f);
1809 connect_raw(
1810 self.as_ptr() as *mut _,
1811 c"notify::round-digits".as_ptr(),
1812 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1813 notify_round_digits_trampoline::<Self, F> as *const (),
1814 )),
1815 Box_::into_raw(f),
1816 )
1817 }
1818 }
1819
1820 #[doc(alias = "show-fill-level")]
1821 fn connect_show_fill_level_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1822 unsafe extern "C" fn notify_show_fill_level_trampoline<
1823 P: IsA<Range>,
1824 F: Fn(&P) + 'static,
1825 >(
1826 this: *mut ffi::GtkRange,
1827 _param_spec: glib::ffi::gpointer,
1828 f: glib::ffi::gpointer,
1829 ) {
1830 unsafe {
1831 let f: &F = &*(f as *const F);
1832 f(Range::from_glib_borrow(this).unsafe_cast_ref())
1833 }
1834 }
1835 unsafe {
1836 let f: Box_<F> = Box_::new(f);
1837 connect_raw(
1838 self.as_ptr() as *mut _,
1839 c"notify::show-fill-level".as_ptr(),
1840 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1841 notify_show_fill_level_trampoline::<Self, F> as *const (),
1842 )),
1843 Box_::into_raw(f),
1844 )
1845 }
1846 }
1847
1848 #[doc(alias = "upper-stepper-sensitivity")]
1849 fn connect_upper_stepper_sensitivity_notify<F: Fn(&Self) + 'static>(
1850 &self,
1851 f: F,
1852 ) -> SignalHandlerId {
1853 unsafe extern "C" fn notify_upper_stepper_sensitivity_trampoline<
1854 P: IsA<Range>,
1855 F: Fn(&P) + 'static,
1856 >(
1857 this: *mut ffi::GtkRange,
1858 _param_spec: glib::ffi::gpointer,
1859 f: glib::ffi::gpointer,
1860 ) {
1861 unsafe {
1862 let f: &F = &*(f as *const F);
1863 f(Range::from_glib_borrow(this).unsafe_cast_ref())
1864 }
1865 }
1866 unsafe {
1867 let f: Box_<F> = Box_::new(f);
1868 connect_raw(
1869 self.as_ptr() as *mut _,
1870 c"notify::upper-stepper-sensitivity".as_ptr(),
1871 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1872 notify_upper_stepper_sensitivity_trampoline::<Self, F> as *const (),
1873 )),
1874 Box_::into_raw(f),
1875 )
1876 }
1877 }
1878}
1879
1880impl<O: IsA<Range>> RangeExt for O {}