Skip to main content

gtk/auto/
shortcuts_window.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::{
6    Align, Application, Bin, Buildable, Container, ResizeMode, Widget, Window, WindowPosition,
7    WindowType,
8};
9use glib::{
10    prelude::*,
11    signal::{connect_raw, SignalHandlerId},
12    translate::*,
13};
14use std::{boxed::Box as Box_, fmt, mem::transmute};
15
16glib::wrapper! {
17    /// A GtkShortcutsWindow shows brief information about the keyboard shortcuts
18    /// and gestures of an application. The shortcuts can be grouped, and you can
19    /// have multiple sections in this window, corresponding to the major modes of
20    /// your application.
21    ///
22    /// Additionally, the shortcuts can be filtered by the current view, to avoid
23    /// showing information that is not relevant in the current application context.
24    ///
25    /// The recommended way to construct a GtkShortcutsWindow is with GtkBuilder,
26    /// by populating a [`ShortcutsWindow`][crate::ShortcutsWindow] with one or more [`ShortcutsSection`][crate::ShortcutsSection]
27    /// objects, which contain `GtkShortcutsGroups` that in turn contain objects of
28    /// class [`ShortcutsShortcut`][crate::ShortcutsShortcut].
29    ///
30    /// # A simple example:
31    ///
32    /// ![](gedit-shortcuts.png)
33    ///
34    /// This example has as single section. As you can see, the shortcut groups
35    /// are arranged in columns, and spread across several pages if there are too
36    /// many to find on a single page.
37    ///
38    /// The .ui file for this example can be found [here](https://git.gnome.org/browse/gtk+/tree/demos/gtk-demo/shortcuts-gedit.ui).
39    ///
40    /// # An example with multiple views:
41    ///
42    /// ![](clocks-shortcuts.png)
43    ///
44    /// This example shows a [`ShortcutsWindow`][crate::ShortcutsWindow] that has been configured to show only
45    /// the shortcuts relevant to the "stopwatch" view.
46    ///
47    /// The .ui file for this example can be found [here](https://git.gnome.org/browse/gtk+/tree/demos/gtk-demo/shortcuts-clocks.ui).
48    ///
49    /// # An example with multiple sections:
50    ///
51    /// ![](builder-shortcuts.png)
52    ///
53    /// This example shows a [`ShortcutsWindow`][crate::ShortcutsWindow] with two sections, "Editor Shortcuts"
54    /// and "Terminal Shortcuts".
55    ///
56    /// The .ui file for this example can be found [here](https://git.gnome.org/browse/gtk+/tree/demos/gtk-demo/shortcuts-builder.ui).
57    ///
58    /// ## Properties
59    ///
60    ///
61    /// #### `section-name`
62    ///  The name of the section to show.
63    ///
64    /// This should be the section-name of one of the [`ShortcutsSection`][crate::ShortcutsSection]
65    /// objects that are in this shortcuts window.
66    ///
67    /// Readable | Writeable
68    ///
69    ///
70    /// #### `view-name`
71    ///  The view name by which to filter the contents.
72    ///
73    /// This should correspond to the [`view`][struct@crate::ShortcutsGroup#view] property of some of
74    /// the [`ShortcutsGroup`][crate::ShortcutsGroup] objects that are inside this shortcuts window.
75    ///
76    /// Set this to [`None`] to show all groups.
77    ///
78    /// Readable | Writeable
79    /// <details><summary><h4>Window</h4></summary>
80    ///
81    ///
82    /// #### `accept-focus`
83    ///  Whether the window should receive the input focus.
84    ///
85    /// Readable | Writeable
86    ///
87    ///
88    /// #### `application`
89    ///  The [`Application`][crate::Application] associated with the window.
90    ///
91    /// The application will be kept alive for at least as long as it
92    /// has any windows associated with it (see [`ApplicationExtManual::hold()`][crate::gio::prelude::ApplicationExtManual::hold()]
93    /// for a way to keep it alive without windows).
94    ///
95    /// Normally, the connection between the application and the window
96    /// will remain until the window is destroyed, but you can explicitly
97    /// remove it by setting the :application property to [`None`].
98    ///
99    /// Readable | Writeable
100    ///
101    ///
102    /// #### `attached-to`
103    ///  The widget to which this window is attached.
104    /// See [`GtkWindowExt::set_attached_to()`][crate::prelude::GtkWindowExt::set_attached_to()].
105    ///
106    /// Examples of places where specifying this relation is useful are
107    /// for instance a [`Menu`][crate::Menu] created by a [`ComboBox`][crate::ComboBox], a completion
108    /// popup window created by [`Entry`][crate::Entry] or a typeahead search entry
109    /// created by [`TreeView`][crate::TreeView].
110    ///
111    /// Readable | Writeable | Construct
112    ///
113    ///
114    /// #### `decorated`
115    ///  Whether the window should be decorated by the window manager.
116    ///
117    /// Readable | Writeable
118    ///
119    ///
120    /// #### `default-height`
121    ///  Readable | Writeable
122    ///
123    ///
124    /// #### `default-width`
125    ///  Readable | Writeable
126    ///
127    ///
128    /// #### `deletable`
129    ///  Whether the window frame should have a close button.
130    ///
131    /// Readable | Writeable
132    ///
133    ///
134    /// #### `destroy-with-parent`
135    ///  Readable | Writeable
136    ///
137    ///
138    /// #### `focus-on-map`
139    ///  Whether the window should receive the input focus when mapped.
140    ///
141    /// Readable | Writeable
142    ///
143    ///
144    /// #### `focus-visible`
145    ///  Whether 'focus rectangles' are currently visible in this window.
146    ///
147    /// This property is maintained by GTK+ based on user input
148    /// and should not be set by applications.
149    ///
150    /// Readable | Writeable
151    ///
152    ///
153    /// #### `gravity`
154    ///  The window gravity of the window. See [`GtkWindowExt::move_()`][crate::prelude::GtkWindowExt::move_()] and [`gdk::Gravity`][crate::gdk::Gravity] for
155    /// more details about window gravity.
156    ///
157    /// Readable | Writeable
158    ///
159    ///
160    /// #### `has-resize-grip`
161    ///  Whether the window has a corner resize grip.
162    ///
163    /// Note that the resize grip is only shown if the window is
164    /// actually resizable and not maximized. Use
165    /// [`resize-grip-visible`][struct@crate::Window#resize-grip-visible] to find out if the resize
166    /// grip is currently shown.
167    ///
168    /// Readable | Writeable
169    ///
170    ///
171    /// #### `has-toplevel-focus`
172    ///  Readable
173    ///
174    ///
175    /// #### `hide-titlebar-when-maximized`
176    ///  Whether the titlebar should be hidden during maximization.
177    ///
178    /// Readable | Writeable
179    ///
180    ///
181    /// #### `icon`
182    ///  Readable | Writeable
183    ///
184    ///
185    /// #### `icon-name`
186    ///  The :icon-name property specifies the name of the themed icon to
187    /// use as the window icon. See [`IconTheme`][crate::IconTheme] for more details.
188    ///
189    /// Readable | Writeable
190    ///
191    ///
192    /// #### `is-active`
193    ///  Readable
194    ///
195    ///
196    /// #### `is-maximized`
197    ///  Readable
198    ///
199    ///
200    /// #### `mnemonics-visible`
201    ///  Whether mnemonics are currently visible in this window.
202    ///
203    /// This property is maintained by GTK+ based on user input,
204    /// and should not be set by applications.
205    ///
206    /// Readable | Writeable
207    ///
208    ///
209    /// #### `modal`
210    ///  Readable | Writeable
211    ///
212    ///
213    /// #### `resizable`
214    ///  Readable | Writeable
215    ///
216    ///
217    /// #### `resize-grip-visible`
218    ///  Whether a corner resize grip is currently shown.
219    ///
220    /// Readable
221    ///
222    ///
223    /// #### `role`
224    ///  Readable | Writeable
225    ///
226    ///
227    /// #### `screen`
228    ///  Readable | Writeable
229    ///
230    ///
231    /// #### `skip-pager-hint`
232    ///  Readable | Writeable
233    ///
234    ///
235    /// #### `skip-taskbar-hint`
236    ///  Readable | Writeable
237    ///
238    ///
239    /// #### `startup-id`
240    ///  The :startup-id is a write-only property for setting window's
241    /// startup notification identifier. See [`GtkWindowExt::set_startup_id()`][crate::prelude::GtkWindowExt::set_startup_id()]
242    /// for more details.
243    ///
244    /// Writeable
245    ///
246    ///
247    /// #### `title`
248    ///  Readable | Writeable
249    ///
250    ///
251    /// #### `transient-for`
252    ///  The transient parent of the window. See [`GtkWindowExt::set_transient_for()`][crate::prelude::GtkWindowExt::set_transient_for()] for
253    /// more details about transient windows.
254    ///
255    /// Readable | Writeable | Construct
256    ///
257    ///
258    /// #### `type`
259    ///  Readable | Writeable | Construct Only
260    ///
261    ///
262    /// #### `type-hint`
263    ///  Readable | Writeable
264    ///
265    ///
266    /// #### `urgency-hint`
267    ///  Readable | Writeable
268    ///
269    ///
270    /// #### `window-position`
271    ///  Readable | Writeable
272    /// </details>
273    /// <details><summary><h4>Container</h4></summary>
274    ///
275    ///
276    /// #### `border-width`
277    ///  Readable | Writeable
278    ///
279    ///
280    /// #### `child`
281    ///  Writeable
282    ///
283    ///
284    /// #### `resize-mode`
285    ///  Readable | Writeable
286    /// </details>
287    /// <details><summary><h4>Widget</h4></summary>
288    ///
289    ///
290    /// #### `app-paintable`
291    ///  Readable | Writeable
292    ///
293    ///
294    /// #### `can-default`
295    ///  Readable | Writeable
296    ///
297    ///
298    /// #### `can-focus`
299    ///  Readable | Writeable
300    ///
301    ///
302    /// #### `composite-child`
303    ///  Readable
304    ///
305    ///
306    /// #### `double-buffered`
307    ///  Whether the widget is double buffered.
308    ///
309    /// Readable | Writeable
310    ///
311    ///
312    /// #### `events`
313    ///  Readable | Writeable
314    ///
315    ///
316    /// #### `expand`
317    ///  Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
318    ///
319    /// Readable | Writeable
320    ///
321    ///
322    /// #### `focus-on-click`
323    ///  Whether the widget should grab focus when it is clicked with the mouse.
324    ///
325    /// This property is only relevant for widgets that can take focus.
326    ///
327    /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
328    /// GtkComboBox) implemented this property individually.
329    ///
330    /// Readable | Writeable
331    ///
332    ///
333    /// #### `halign`
334    ///  How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
335    ///
336    /// Readable | Writeable
337    ///
338    ///
339    /// #### `has-default`
340    ///  Readable | Writeable
341    ///
342    ///
343    /// #### `has-focus`
344    ///  Readable | Writeable
345    ///
346    ///
347    /// #### `has-tooltip`
348    ///  Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
349    /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
350    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
351    /// whether it will provide a tooltip or not.
352    ///
353    /// Note that setting this property to [`true`] for the first time will change
354    /// the event masks of the GdkWindows of this widget to include leave-notify
355    /// and motion-notify events. This cannot and will not be undone when the
356    /// property is set to [`false`] again.
357    ///
358    /// Readable | Writeable
359    ///
360    ///
361    /// #### `height-request`
362    ///  Readable | Writeable
363    ///
364    ///
365    /// #### `hexpand`
366    ///  Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
367    ///
368    /// Readable | Writeable
369    ///
370    ///
371    /// #### `hexpand-set`
372    ///  Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
373    ///
374    /// Readable | Writeable
375    ///
376    ///
377    /// #### `is-focus`
378    ///  Readable | Writeable
379    ///
380    ///
381    /// #### `margin`
382    ///  Sets all four sides' margin at once. If read, returns max
383    /// margin on any side.
384    ///
385    /// Readable | Writeable
386    ///
387    ///
388    /// #### `margin-bottom`
389    ///  Margin on bottom side of widget.
390    ///
391    /// This property adds margin outside of the widget's normal size
392    /// request, the margin will be added in addition to the size from
393    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
394    ///
395    /// Readable | Writeable
396    ///
397    ///
398    /// #### `margin-end`
399    ///  Margin on end of widget, horizontally. This property supports
400    /// left-to-right and right-to-left text directions.
401    ///
402    /// This property adds margin outside of the widget's normal size
403    /// request, the margin will be added in addition to the size from
404    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
405    ///
406    /// Readable | Writeable
407    ///
408    ///
409    /// #### `margin-left`
410    ///  Margin on left side of widget.
411    ///
412    /// This property adds margin outside of the widget's normal size
413    /// request, the margin will be added in addition to the size from
414    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
415    ///
416    /// Readable | Writeable
417    ///
418    ///
419    /// #### `margin-right`
420    ///  Margin on right side of widget.
421    ///
422    /// This property adds margin outside of the widget's normal size
423    /// request, the margin will be added in addition to the size from
424    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
425    ///
426    /// Readable | Writeable
427    ///
428    ///
429    /// #### `margin-start`
430    ///  Margin on start of widget, horizontally. This property supports
431    /// left-to-right and right-to-left text directions.
432    ///
433    /// This property adds margin outside of the widget's normal size
434    /// request, the margin will be added in addition to the size from
435    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
436    ///
437    /// Readable | Writeable
438    ///
439    ///
440    /// #### `margin-top`
441    ///  Margin on top side of widget.
442    ///
443    /// This property adds margin outside of the widget's normal size
444    /// request, the margin will be added in addition to the size from
445    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
446    ///
447    /// Readable | Writeable
448    ///
449    ///
450    /// #### `name`
451    ///  Readable | Writeable
452    ///
453    ///
454    /// #### `no-show-all`
455    ///  Readable | Writeable
456    ///
457    ///
458    /// #### `opacity`
459    ///  The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
460    /// more details about window opacity.
461    ///
462    /// Before 3.8 this was only available in GtkWindow
463    ///
464    /// Readable | Writeable
465    ///
466    ///
467    /// #### `parent`
468    ///  Readable | Writeable
469    ///
470    ///
471    /// #### `receives-default`
472    ///  Readable | Writeable
473    ///
474    ///
475    /// #### `scale-factor`
476    ///  The scale factor of the widget. See [`WidgetExt::scale_factor()`][crate::prelude::WidgetExt::scale_factor()] for
477    /// more details about widget scaling.
478    ///
479    /// Readable
480    ///
481    ///
482    /// #### `sensitive`
483    ///  Readable | Writeable
484    ///
485    ///
486    /// #### `style`
487    ///  The style of the widget, which contains information about how it will look (colors, etc).
488    ///
489    /// Readable | Writeable
490    ///
491    ///
492    /// #### `tooltip-markup`
493    ///  Sets the text of tooltip to be the given string, which is marked up
494    /// with the [Pango text markup language][PangoMarkupFormat].
495    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
496    ///
497    /// This is a convenience property which will take care of getting the
498    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
499    /// will automatically be set to [`true`] and there will be taken care of
500    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
501    ///
502    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
503    /// are set, the last one wins.
504    ///
505    /// Readable | Writeable
506    ///
507    ///
508    /// #### `tooltip-text`
509    ///  Sets the text of tooltip to be the given string.
510    ///
511    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
512    ///
513    /// This is a convenience property which will take care of getting the
514    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
515    /// will automatically be set to [`true`] and there will be taken care of
516    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
517    ///
518    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
519    /// are set, the last one wins.
520    ///
521    /// Readable | Writeable
522    ///
523    ///
524    /// #### `valign`
525    ///  How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
526    ///
527    /// Readable | Writeable
528    ///
529    ///
530    /// #### `vexpand`
531    ///  Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
532    ///
533    /// Readable | Writeable
534    ///
535    ///
536    /// #### `vexpand-set`
537    ///  Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
538    ///
539    /// Readable | Writeable
540    ///
541    ///
542    /// #### `visible`
543    ///  Readable | Writeable
544    ///
545    ///
546    /// #### `width-request`
547    ///  Readable | Writeable
548    ///
549    ///
550    /// #### `window`
551    ///  The widget's window if it is realized, [`None`] otherwise.
552    ///
553    /// Readable
554    /// </details>
555    ///
556    /// ## Signals
557    ///
558    ///
559    /// #### `close`
560    ///  The ::close signal is a
561    /// [keybinding signal][GtkBindingSignal]
562    /// which gets emitted when the user uses a keybinding to close
563    /// the window.
564    ///
565    /// The default binding for this signal is the Escape key.
566    ///
567    /// Action
568    ///
569    ///
570    /// #### `search`
571    ///  The ::search signal is a
572    /// [keybinding signal][GtkBindingSignal]
573    /// which gets emitted when the user uses a keybinding to start a search.
574    ///
575    /// The default binding for this signal is Control-F.
576    ///
577    /// Action
578    /// <details><summary><h4>Window</h4></summary>
579    ///
580    ///
581    /// #### `activate-default`
582    ///  The ::activate-default signal is a
583    /// [keybinding signal][GtkBindingSignal]
584    /// which gets emitted when the user activates the default widget
585    /// of `window`.
586    ///
587    /// Action
588    ///
589    ///
590    /// #### `activate-focus`
591    ///  The ::activate-focus signal is a
592    /// [keybinding signal][GtkBindingSignal]
593    /// which gets emitted when the user activates the currently
594    /// focused widget of `window`.
595    ///
596    /// Action
597    ///
598    ///
599    /// #### `enable-debugging`
600    ///  The ::enable-debugging signal is a [keybinding signal][GtkBindingSignal]
601    /// which gets emitted when the user enables or disables interactive
602    /// debugging. When `toggle` is [`true`], interactive debugging is toggled
603    /// on or off, when it is [`false`], the debugger will be pointed at the
604    /// widget under the pointer.
605    ///
606    /// The default bindings for this signal are Ctrl-Shift-I
607    /// and Ctrl-Shift-D.
608    ///
609    /// Action
610    ///
611    ///
612    /// #### `keys-changed`
613    ///  The ::keys-changed signal gets emitted when the set of accelerators
614    /// or mnemonics that are associated with `window` changes.
615    ///
616    ///
617    ///
618    ///
619    /// #### `set-focus`
620    ///  This signal is emitted whenever the currently focused widget in
621    /// this window changes.
622    ///
623    ///
624    /// </details>
625    /// <details><summary><h4>Container</h4></summary>
626    ///
627    ///
628    /// #### `add`
629    ///
630    ///
631    ///
632    /// #### `check-resize`
633    ///
634    ///
635    ///
636    /// #### `remove`
637    ///
638    ///
639    ///
640    /// #### `set-focus-child`
641    ///
642    /// </details>
643    /// <details><summary><h4>Widget</h4></summary>
644    ///
645    ///
646    /// #### `accel-closures-changed`
647    ///
648    ///
649    ///
650    /// #### `button-press-event`
651    ///  The ::button-press-event signal will be emitted when a button
652    /// (typically from a mouse) is pressed.
653    ///
654    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
655    /// widget needs to enable the [`gdk::EventMask::BUTTON_PRESS_MASK`][crate::gdk::EventMask::BUTTON_PRESS_MASK] mask.
656    ///
657    /// This signal will be sent to the grab widget if there is one.
658    ///
659    ///
660    ///
661    ///
662    /// #### `button-release-event`
663    ///  The ::button-release-event signal will be emitted when a button
664    /// (typically from a mouse) is released.
665    ///
666    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
667    /// widget needs to enable the [`gdk::EventMask::BUTTON_RELEASE_MASK`][crate::gdk::EventMask::BUTTON_RELEASE_MASK] mask.
668    ///
669    /// This signal will be sent to the grab widget if there is one.
670    ///
671    ///
672    ///
673    ///
674    /// #### `can-activate-accel`
675    ///  Determines whether an accelerator that activates the signal
676    /// identified by `signal_id` can currently be activated.
677    /// This signal is present to allow applications and derived
678    /// widgets to override the default [`Widget`][crate::Widget] handling
679    /// for determining whether an accelerator can be activated.
680    ///
681    ///
682    ///
683    ///
684    /// #### `child-notify`
685    ///  The ::child-notify signal is emitted for each
686    /// [child property][child-properties] that has
687    /// changed on an object. The signal's detail holds the property name.
688    ///
689    /// Detailed
690    ///
691    ///
692    /// #### `composited-changed`
693    ///  The ::composited-changed signal is emitted when the composited
694    /// status of `widgets` screen changes.
695    /// See [`Screen::is_composited()`][crate::gdk::Screen::is_composited()].
696    ///
697    /// Action
698    ///
699    ///
700    /// #### `configure-event`
701    ///  The ::configure-event signal will be emitted when the size, position or
702    /// stacking of the `widget`'s window has changed.
703    ///
704    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
705    /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
706    /// automatically for all new windows.
707    ///
708    ///
709    ///
710    ///
711    /// #### `damage-event`
712    ///  Emitted when a redirected window belonging to `widget` gets drawn into.
713    /// The region/area members of the event shows what area of the redirected
714    /// drawable was drawn into.
715    ///
716    ///
717    ///
718    ///
719    /// #### `delete-event`
720    ///  The ::delete-event signal is emitted if a user requests that
721    /// a toplevel window is closed. The default handler for this signal
722    /// destroys the window. Connecting [`WidgetExtManual::hide_on_delete()`][crate::prelude::WidgetExtManual::hide_on_delete()] to
723    /// this signal will cause the window to be hidden instead, so that
724    /// it can later be shown again without reconstructing it.
725    ///
726    ///
727    ///
728    ///
729    /// #### `destroy`
730    ///  Signals that all holders of a reference to the widget should release
731    /// the reference that they hold. May result in finalization of the widget
732    /// if all references are released.
733    ///
734    /// This signal is not suitable for saving widget state.
735    ///
736    ///
737    ///
738    ///
739    /// #### `destroy-event`
740    ///  The ::destroy-event signal is emitted when a [`gdk::Window`][crate::gdk::Window] is destroyed.
741    /// You rarely get this signal, because most widgets disconnect themselves
742    /// from their window before they destroy it, so no widget owns the
743    /// window at destroy time.
744    ///
745    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
746    /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
747    /// automatically for all new windows.
748    ///
749    ///
750    ///
751    ///
752    /// #### `direction-changed`
753    ///  The ::direction-changed signal is emitted when the text direction
754    /// of a widget changes.
755    ///
756    ///
757    ///
758    ///
759    /// #### `drag-begin`
760    ///  The ::drag-begin signal is emitted on the drag source when a drag is
761    /// started. A typical reason to connect to this signal is to set up a
762    /// custom drag icon with e.g. [`WidgetExt::drag_source_set_icon_pixbuf()`][crate::prelude::WidgetExt::drag_source_set_icon_pixbuf()].
763    ///
764    /// Note that some widgets set up a drag icon in the default handler of
765    /// this signal, so you may have to use `g_signal_connect_after()` to
766    /// override what the default handler did.
767    ///
768    ///
769    ///
770    ///
771    /// #### `drag-data-delete`
772    ///  The ::drag-data-delete signal is emitted on the drag source when a drag
773    /// with the action [`gdk::DragAction::MOVE`][crate::gdk::DragAction::MOVE] is successfully completed. The signal
774    /// handler is responsible for deleting the data that has been dropped. What
775    /// "delete" means depends on the context of the drag operation.
776    ///
777    ///
778    ///
779    ///
780    /// #### `drag-data-get`
781    ///  The ::drag-data-get signal is emitted on the drag source when the drop
782    /// site requests the data which is dragged. It is the responsibility of
783    /// the signal handler to fill `data` with the data in the format which
784    /// is indicated by `info`. See [`SelectionData::set()`][crate::SelectionData::set()] and
785    /// [`SelectionData::set_text()`][crate::SelectionData::set_text()].
786    ///
787    ///
788    ///
789    ///
790    /// #### `drag-data-received`
791    ///  The ::drag-data-received signal is emitted on the drop site when the
792    /// dragged data has been received. If the data was received in order to
793    /// determine whether the drop will be accepted, the handler is expected
794    /// to call `gdk_drag_status()` and not finish the drag.
795    /// If the data was received in response to a [`drag-drop`][struct@crate::Widget#drag-drop] signal
796    /// (and this is the last target to be received), the handler for this
797    /// signal is expected to process the received data and then call
798    /// `gtk_drag_finish()`, setting the `success` parameter depending on
799    /// whether the data was processed successfully.
800    ///
801    /// Applications must create some means to determine why the signal was emitted
802    /// and therefore whether to call `gdk_drag_status()` or `gtk_drag_finish()`.
803    ///
804    /// The handler may inspect the selected action with
805    /// [`DragContext::selected_action()`][crate::gdk::DragContext::selected_action()] before calling
806    /// `gtk_drag_finish()`, e.g. to implement [`gdk::DragAction::ASK`][crate::gdk::DragAction::ASK] as
807    /// shown in the following example:
808    ///
809    ///
810    /// **⚠️ The following code is in C ⚠️**
811    ///
812    /// ```C
813    /// void
814    /// drag_data_received (GtkWidget          *widget,
815    ///                     GdkDragContext     *context,
816    ///                     gint                x,
817    ///                     gint                y,
818    ///                     GtkSelectionData   *data,
819    ///                     guint               info,
820    ///                     guint               time)
821    /// {
822    ///   if ((data->length >= 0) && (data->format == 8))
823    ///     {
824    ///       GdkDragAction action;
825    ///
826    ///       // handle data here
827    ///
828    ///       action = gdk_drag_context_get_selected_action (context);
829    ///       if (action == GDK_ACTION_ASK)
830    ///         {
831    ///           GtkWidget *dialog;
832    ///           gint response;
833    ///
834    ///           dialog = gtk_message_dialog_new (NULL,
835    ///                                            GTK_DIALOG_MODAL |
836    ///                                            GTK_DIALOG_DESTROY_WITH_PARENT,
837    ///                                            GTK_MESSAGE_INFO,
838    ///                                            GTK_BUTTONS_YES_NO,
839    ///                                            "Move the data ?\n");
840    ///           response = gtk_dialog_run (GTK_DIALOG (dialog));
841    ///           gtk_widget_destroy (dialog);
842    ///
843    ///           if (response == GTK_RESPONSE_YES)
844    ///             action = GDK_ACTION_MOVE;
845    ///           else
846    ///             action = GDK_ACTION_COPY;
847    ///          }
848    ///
849    ///       gtk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time);
850    ///     }
851    ///   else
852    ///     gtk_drag_finish (context, FALSE, FALSE, time);
853    ///  }
854    /// ```
855    ///
856    ///
857    ///
858    ///
859    /// #### `drag-drop`
860    ///  The ::drag-drop signal is emitted on the drop site when the user drops
861    /// the data onto the widget. The signal handler must determine whether
862    /// the cursor position is in a drop zone or not. If it is not in a drop
863    /// zone, it returns [`false`] and no further processing is necessary.
864    /// Otherwise, the handler returns [`true`]. In this case, the handler must
865    /// ensure that `gtk_drag_finish()` is called to let the source know that
866    /// the drop is done. The call to `gtk_drag_finish()` can be done either
867    /// directly or in a [`drag-data-received`][struct@crate::Widget#drag-data-received] handler which gets
868    /// triggered by calling [`WidgetExt::drag_get_data()`][crate::prelude::WidgetExt::drag_get_data()] to receive the data for one
869    /// or more of the supported targets.
870    ///
871    ///
872    ///
873    ///
874    /// #### `drag-end`
875    ///  The ::drag-end signal is emitted on the drag source when a drag is
876    /// finished. A typical reason to connect to this signal is to undo
877    /// things done in [`drag-begin`][struct@crate::Widget#drag-begin].
878    ///
879    ///
880    ///
881    ///
882    /// #### `drag-failed`
883    ///  The ::drag-failed signal is emitted on the drag source when a drag has
884    /// failed. The signal handler may hook custom code to handle a failed DnD
885    /// operation based on the type of error, it returns [`true`] is the failure has
886    /// been already handled (not showing the default "drag operation failed"
887    /// animation), otherwise it returns [`false`].
888    ///
889    ///
890    ///
891    ///
892    /// #### `drag-leave`
893    ///  The ::drag-leave signal is emitted on the drop site when the cursor
894    /// leaves the widget. A typical reason to connect to this signal is to
895    /// undo things done in [`drag-motion`][struct@crate::Widget#drag-motion], e.g. undo highlighting
896    /// with [`WidgetExt::drag_unhighlight()`][crate::prelude::WidgetExt::drag_unhighlight()].
897    ///
898    ///
899    /// Likewise, the [`drag-leave`][struct@crate::Widget#drag-leave] signal is also emitted before the
900    /// ::drag-drop signal, for instance to allow cleaning up of a preview item
901    /// created in the [`drag-motion`][struct@crate::Widget#drag-motion] signal handler.
902    ///
903    ///
904    ///
905    ///
906    /// #### `drag-motion`
907    ///  The ::drag-motion signal is emitted on the drop site when the user
908    /// moves the cursor over the widget during a drag. The signal handler
909    /// must determine whether the cursor position is in a drop zone or not.
910    /// If it is not in a drop zone, it returns [`false`] and no further processing
911    /// is necessary. Otherwise, the handler returns [`true`]. In this case, the
912    /// handler is responsible for providing the necessary information for
913    /// displaying feedback to the user, by calling `gdk_drag_status()`.
914    ///
915    /// If the decision whether the drop will be accepted or rejected can't be
916    /// made based solely on the cursor position and the type of the data, the
917    /// handler may inspect the dragged data by calling [`WidgetExt::drag_get_data()`][crate::prelude::WidgetExt::drag_get_data()] and
918    /// defer the `gdk_drag_status()` call to the [`drag-data-received`][struct@crate::Widget#drag-data-received]
919    /// handler. Note that you must pass [`DestDefaults::DROP`][crate::DestDefaults::DROP],
920    /// [`DestDefaults::MOTION`][crate::DestDefaults::MOTION] or [`DestDefaults::ALL`][crate::DestDefaults::ALL] to [`WidgetExtManual::drag_dest_set()`][crate::prelude::WidgetExtManual::drag_dest_set()]
921    /// when using the drag-motion signal that way.
922    ///
923    /// Also note that there is no drag-enter signal. The drag receiver has to
924    /// keep track of whether he has received any drag-motion signals since the
925    /// last [`drag-leave`][struct@crate::Widget#drag-leave] and if not, treat the drag-motion signal as
926    /// an "enter" signal. Upon an "enter", the handler will typically highlight
927    /// the drop site with [`WidgetExt::drag_highlight()`][crate::prelude::WidgetExt::drag_highlight()].
928    ///
929    ///
930    /// **⚠️ The following code is in C ⚠️**
931    ///
932    /// ```C
933    /// static void
934    /// drag_motion (GtkWidget      *widget,
935    ///              GdkDragContext *context,
936    ///              gint            x,
937    ///              gint            y,
938    ///              guint           time)
939    /// {
940    ///   GdkAtom target;
941    ///
942    ///   PrivateData *private_data = GET_PRIVATE_DATA (widget);
943    ///
944    ///   if (!private_data->drag_highlight)
945    ///    {
946    ///      private_data->drag_highlight = 1;
947    ///      gtk_drag_highlight (widget);
948    ///    }
949    ///
950    ///   target = gtk_drag_dest_find_target (widget, context, NULL);
951    ///   if (target == GDK_NONE)
952    ///     gdk_drag_status (context, 0, time);
953    ///   else
954    ///    {
955    ///      private_data->pending_status
956    ///         = gdk_drag_context_get_suggested_action (context);
957    ///      gtk_drag_get_data (widget, context, target, time);
958    ///    }
959    ///
960    ///   return TRUE;
961    /// }
962    ///
963    /// static void
964    /// drag_data_received (GtkWidget        *widget,
965    ///                     GdkDragContext   *context,
966    ///                     gint              x,
967    ///                     gint              y,
968    ///                     GtkSelectionData *selection_data,
969    ///                     guint             info,
970    ///                     guint             time)
971    /// {
972    ///   PrivateData *private_data = GET_PRIVATE_DATA (widget);
973    ///
974    ///   if (private_data->suggested_action)
975    ///    {
976    ///      private_data->suggested_action = 0;
977    ///
978    ///      // We are getting this data due to a request in drag_motion,
979    ///      // rather than due to a request in drag_drop, so we are just
980    ///      // supposed to call gdk_drag_status(), not actually paste in
981    ///      // the data.
982    ///
983    ///      str = gtk_selection_data_get_text (selection_data);
984    ///      if (!data_is_acceptable (str))
985    ///        gdk_drag_status (context, 0, time);
986    ///      else
987    ///        gdk_drag_status (context,
988    ///                         private_data->suggested_action,
989    ///                         time);
990    ///    }
991    ///   else
992    ///    {
993    ///      // accept the drop
994    ///    }
995    /// }
996    /// ```
997    ///
998    ///
999    ///
1000    ///
1001    /// #### `draw`
1002    ///  This signal is emitted when a widget is supposed to render itself.
1003    /// The `widget`'s top left corner must be painted at the origin of
1004    /// the passed in context and be sized to the values returned by
1005    /// [`WidgetExt::allocated_width()`][crate::prelude::WidgetExt::allocated_width()] and
1006    /// [`WidgetExt::allocated_height()`][crate::prelude::WidgetExt::allocated_height()].
1007    ///
1008    /// Signal handlers connected to this signal can modify the cairo
1009    /// context passed as `cr` in any way they like and don't need to
1010    /// restore it. The signal emission takes care of calling `cairo_save()`
1011    /// before and `cairo_restore()` after invoking the handler.
1012    ///
1013    /// The signal handler will get a `cr` with a clip region already set to the
1014    /// widget's dirty region, i.e. to the area that needs repainting. Complicated
1015    /// widgets that want to avoid redrawing themselves completely can get the full
1016    /// extents of the clip region with `gdk_cairo_get_clip_rectangle()`, or they can
1017    /// get a finer-grained representation of the dirty region with
1018    /// `cairo_copy_clip_rectangle_list()`.
1019    ///
1020    ///
1021    ///
1022    ///
1023    /// #### `enter-notify-event`
1024    ///  The ::enter-notify-event will be emitted when the pointer enters
1025    /// the `widget`'s window.
1026    ///
1027    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1028    /// to enable the [`gdk::EventMask::ENTER_NOTIFY_MASK`][crate::gdk::EventMask::ENTER_NOTIFY_MASK] mask.
1029    ///
1030    /// This signal will be sent to the grab widget if there is one.
1031    ///
1032    ///
1033    ///
1034    ///
1035    /// #### `event`
1036    ///  The GTK+ main loop will emit three signals for each GDK event delivered
1037    /// to a widget: one generic ::event signal, another, more specific,
1038    /// signal that matches the type of event delivered (e.g.
1039    /// [`key-press-event`][struct@crate::Widget#key-press-event]) and finally a generic
1040    /// [`event-after`][struct@crate::Widget#event-after] signal.
1041    ///
1042    ///
1043    ///
1044    ///
1045    /// #### `event-after`
1046    ///  After the emission of the [`event`][struct@crate::Widget#event] signal and (optionally)
1047    /// the second more specific signal, ::event-after will be emitted
1048    /// regardless of the previous two signals handlers return values.
1049    ///
1050    ///
1051    ///
1052    ///
1053    /// #### `focus`
1054    ///
1055    ///
1056    ///
1057    /// #### `focus-in-event`
1058    ///  The ::focus-in-event signal will be emitted when the keyboard focus
1059    /// enters the `widget`'s window.
1060    ///
1061    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1062    /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
1063    ///
1064    ///
1065    ///
1066    ///
1067    /// #### `focus-out-event`
1068    ///  The ::focus-out-event signal will be emitted when the keyboard focus
1069    /// leaves the `widget`'s window.
1070    ///
1071    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1072    /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
1073    ///
1074    ///
1075    ///
1076    ///
1077    /// #### `grab-broken-event`
1078    ///  Emitted when a pointer or keyboard grab on a window belonging
1079    /// to `widget` gets broken.
1080    ///
1081    /// On X11, this happens when the grab window becomes unviewable
1082    /// (i.e. it or one of its ancestors is unmapped), or if the same
1083    /// application grabs the pointer or keyboard again.
1084    ///
1085    ///
1086    ///
1087    ///
1088    /// #### `grab-focus`
1089    ///  Action
1090    ///
1091    ///
1092    /// #### `grab-notify`
1093    ///  The ::grab-notify signal is emitted when a widget becomes
1094    /// shadowed by a GTK+ grab (not a pointer or keyboard grab) on
1095    /// another widget, or when it becomes unshadowed due to a grab
1096    /// being removed.
1097    ///
1098    /// A widget is shadowed by a [`WidgetExt::grab_add()`][crate::prelude::WidgetExt::grab_add()] when the topmost
1099    /// grab widget in the grab stack of its window group is not
1100    /// its ancestor.
1101    ///
1102    ///
1103    ///
1104    ///
1105    /// #### `hide`
1106    ///  The ::hide signal is emitted when `widget` is hidden, for example with
1107    /// [`WidgetExt::hide()`][crate::prelude::WidgetExt::hide()].
1108    ///
1109    ///
1110    ///
1111    ///
1112    /// #### `hierarchy-changed`
1113    ///  The ::hierarchy-changed signal is emitted when the
1114    /// anchored state of a widget changes. A widget is
1115    /// “anchored” when its toplevel
1116    /// ancestor is a [`Window`][crate::Window]. This signal is emitted when
1117    /// a widget changes from un-anchored to anchored or vice-versa.
1118    ///
1119    ///
1120    ///
1121    ///
1122    /// #### `key-press-event`
1123    ///  The ::key-press-event signal is emitted when a key is pressed. The signal
1124    /// emission will reoccur at the key-repeat rate when the key is kept pressed.
1125    ///
1126    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1127    /// to enable the [`gdk::EventMask::KEY_PRESS_MASK`][crate::gdk::EventMask::KEY_PRESS_MASK] mask.
1128    ///
1129    /// This signal will be sent to the grab widget if there is one.
1130    ///
1131    ///
1132    ///
1133    ///
1134    /// #### `key-release-event`
1135    ///  The ::key-release-event signal is emitted when a key is released.
1136    ///
1137    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1138    /// to enable the [`gdk::EventMask::KEY_RELEASE_MASK`][crate::gdk::EventMask::KEY_RELEASE_MASK] mask.
1139    ///
1140    /// This signal will be sent to the grab widget if there is one.
1141    ///
1142    ///
1143    ///
1144    ///
1145    /// #### `keynav-failed`
1146    ///  Gets emitted if keyboard navigation fails.
1147    /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
1148    ///
1149    ///
1150    ///
1151    ///
1152    /// #### `leave-notify-event`
1153    ///  The ::leave-notify-event will be emitted when the pointer leaves
1154    /// the `widget`'s window.
1155    ///
1156    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1157    /// to enable the [`gdk::EventMask::LEAVE_NOTIFY_MASK`][crate::gdk::EventMask::LEAVE_NOTIFY_MASK] mask.
1158    ///
1159    /// This signal will be sent to the grab widget if there is one.
1160    ///
1161    ///
1162    ///
1163    ///
1164    /// #### `map`
1165    ///  The ::map signal is emitted when `widget` is going to be mapped, that is
1166    /// when the widget is visible (which is controlled with
1167    /// [`WidgetExt::set_visible()`][crate::prelude::WidgetExt::set_visible()]) and all its parents up to the toplevel widget
1168    /// are also visible. Once the map has occurred, [`map-event`][struct@crate::Widget#map-event] will
1169    /// be emitted.
1170    ///
1171    /// The ::map signal can be used to determine whether a widget will be drawn,
1172    /// for instance it can resume an animation that was stopped during the
1173    /// emission of [`unmap`][struct@crate::Widget#unmap].
1174    ///
1175    ///
1176    ///
1177    ///
1178    /// #### `map-event`
1179    ///  The ::map-event signal will be emitted when the `widget`'s window is
1180    /// mapped. A window is mapped when it becomes visible on the screen.
1181    ///
1182    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1183    /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
1184    /// automatically for all new windows.
1185    ///
1186    ///
1187    ///
1188    ///
1189    /// #### `mnemonic-activate`
1190    ///  The default handler for this signal activates `widget` if `group_cycling`
1191    /// is [`false`], or just makes `widget` grab focus if `group_cycling` is [`true`].
1192    ///
1193    ///
1194    ///
1195    ///
1196    /// #### `motion-notify-event`
1197    ///  The ::motion-notify-event signal is emitted when the pointer moves
1198    /// over the widget's [`gdk::Window`][crate::gdk::Window].
1199    ///
1200    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget
1201    /// needs to enable the [`gdk::EventMask::POINTER_MOTION_MASK`][crate::gdk::EventMask::POINTER_MOTION_MASK] mask.
1202    ///
1203    /// This signal will be sent to the grab widget if there is one.
1204    ///
1205    ///
1206    ///
1207    ///
1208    /// #### `move-focus`
1209    ///  Action
1210    ///
1211    ///
1212    /// #### `parent-set`
1213    ///  The ::parent-set signal is emitted when a new parent
1214    /// has been set on a widget.
1215    ///
1216    ///
1217    ///
1218    ///
1219    /// #### `popup-menu`
1220    ///  This signal gets emitted whenever a widget should pop up a context
1221    /// menu. This usually happens through the standard key binding mechanism;
1222    /// by pressing a certain key while a widget is focused, the user can cause
1223    /// the widget to pop up a menu. For example, the [`Entry`][crate::Entry] widget creates
1224    /// a menu with clipboard commands. See the
1225    /// [Popup Menu Migration Checklist][checklist-popup-menu]
1226    /// for an example of how to use this signal.
1227    ///
1228    /// Action
1229    ///
1230    ///
1231    /// #### `property-notify-event`
1232    ///  The ::property-notify-event signal will be emitted when a property on
1233    /// the `widget`'s window has been changed or deleted.
1234    ///
1235    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1236    /// to enable the [`gdk::EventMask::PROPERTY_CHANGE_MASK`][crate::gdk::EventMask::PROPERTY_CHANGE_MASK] mask.
1237    ///
1238    ///
1239    ///
1240    ///
1241    /// #### `proximity-in-event`
1242    ///  To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1243    /// to enable the [`gdk::EventMask::PROXIMITY_IN_MASK`][crate::gdk::EventMask::PROXIMITY_IN_MASK] mask.
1244    ///
1245    /// This signal will be sent to the grab widget if there is one.
1246    ///
1247    ///
1248    ///
1249    ///
1250    /// #### `proximity-out-event`
1251    ///  To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1252    /// to enable the [`gdk::EventMask::PROXIMITY_OUT_MASK`][crate::gdk::EventMask::PROXIMITY_OUT_MASK] mask.
1253    ///
1254    /// This signal will be sent to the grab widget if there is one.
1255    ///
1256    ///
1257    ///
1258    ///
1259    /// #### `query-tooltip`
1260    ///  Emitted when [`has-tooltip`][struct@crate::Widget#has-tooltip] is [`true`] and the hover timeout
1261    /// has expired with the cursor hovering "above" `widget`; or emitted when `widget` got
1262    /// focus in keyboard mode.
1263    ///
1264    /// Using the given coordinates, the signal handler should determine
1265    /// whether a tooltip should be shown for `widget`. If this is the case
1266    /// [`true`] should be returned, [`false`] otherwise. Note that if
1267    /// `keyboard_mode` is [`true`], the values of `x` and `y` are undefined and
1268    /// should not be used.
1269    ///
1270    /// The signal handler is free to manipulate `tooltip` with the therefore
1271    /// destined function calls.
1272    ///
1273    ///
1274    ///
1275    ///
1276    /// #### `realize`
1277    ///  The ::realize signal is emitted when `widget` is associated with a
1278    /// [`gdk::Window`][crate::gdk::Window], which means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called or the
1279    /// widget has been mapped (that is, it is going to be drawn).
1280    ///
1281    ///
1282    ///
1283    ///
1284    /// #### `screen-changed`
1285    ///  The ::screen-changed signal gets emitted when the
1286    /// screen of a widget has changed.
1287    ///
1288    ///
1289    ///
1290    ///
1291    /// #### `scroll-event`
1292    ///  The ::scroll-event signal is emitted when a button in the 4 to 7
1293    /// range is pressed. Wheel mice are usually configured to generate
1294    /// button press events for buttons 4 and 5 when the wheel is turned.
1295    ///
1296    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1297    /// to enable the [`gdk::EventMask::SCROLL_MASK`][crate::gdk::EventMask::SCROLL_MASK] mask.
1298    ///
1299    /// This signal will be sent to the grab widget if there is one.
1300    ///
1301    ///
1302    ///
1303    ///
1304    /// #### `selection-clear-event`
1305    ///  The ::selection-clear-event signal will be emitted when the
1306    /// the `widget`'s window has lost ownership of a selection.
1307    ///
1308    ///
1309    ///
1310    ///
1311    /// #### `selection-get`
1312    ///
1313    ///
1314    ///
1315    /// #### `selection-notify-event`
1316    ///
1317    ///
1318    ///
1319    /// #### `selection-received`
1320    ///
1321    ///
1322    ///
1323    /// #### `selection-request-event`
1324    ///  The ::selection-request-event signal will be emitted when
1325    /// another client requests ownership of the selection owned by
1326    /// the `widget`'s window.
1327    ///
1328    ///
1329    ///
1330    ///
1331    /// #### `show`
1332    ///  The ::show signal is emitted when `widget` is shown, for example with
1333    /// [`WidgetExt::show()`][crate::prelude::WidgetExt::show()].
1334    ///
1335    ///
1336    ///
1337    ///
1338    /// #### `show-help`
1339    ///  Action
1340    ///
1341    ///
1342    /// #### `size-allocate`
1343    ///
1344    ///
1345    ///
1346    /// #### `state-changed`
1347    ///  The ::state-changed signal is emitted when the widget state changes.
1348    /// See `gtk_widget_get_state()`.
1349    ///
1350    ///
1351    ///
1352    ///
1353    /// #### `state-flags-changed`
1354    ///  The ::state-flags-changed signal is emitted when the widget state
1355    /// changes, see [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
1356    ///
1357    ///
1358    ///
1359    ///
1360    /// #### `style-set`
1361    ///  The ::style-set signal is emitted when a new style has been set
1362    /// on a widget. Note that style-modifying functions like
1363    /// `gtk_widget_modify_base()` also cause this signal to be emitted.
1364    ///
1365    /// Note that this signal is emitted for changes to the deprecated
1366    /// `GtkStyle`. To track changes to the [`StyleContext`][crate::StyleContext] associated
1367    /// with a widget, use the [`style-updated`][struct@crate::Widget#style-updated] signal.
1368    ///
1369    ///
1370    ///
1371    ///
1372    /// #### `style-updated`
1373    ///  The ::style-updated signal is a convenience signal that is emitted when the
1374    /// [`changed`][struct@crate::StyleContext#changed] signal is emitted on the `widget`'s associated
1375    /// [`StyleContext`][crate::StyleContext] as returned by [`WidgetExt::style_context()`][crate::prelude::WidgetExt::style_context()].
1376    ///
1377    /// Note that style-modifying functions like `gtk_widget_override_color()` also
1378    /// cause this signal to be emitted.
1379    ///
1380    ///
1381    ///
1382    ///
1383    /// #### `touch-event`
1384    ///
1385    ///
1386    ///
1387    /// #### `unmap`
1388    ///  The ::unmap signal is emitted when `widget` is going to be unmapped, which
1389    /// means that either it or any of its parents up to the toplevel widget have
1390    /// been set as hidden.
1391    ///
1392    /// As ::unmap indicates that a widget will not be shown any longer, it can be
1393    /// used to, for example, stop an animation on the widget.
1394    ///
1395    ///
1396    ///
1397    ///
1398    /// #### `unmap-event`
1399    ///  The ::unmap-event signal will be emitted when the `widget`'s window is
1400    /// unmapped. A window is unmapped when it becomes invisible on the screen.
1401    ///
1402    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1403    /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
1404    /// automatically for all new windows.
1405    ///
1406    ///
1407    ///
1408    ///
1409    /// #### `unrealize`
1410    ///  The ::unrealize signal is emitted when the [`gdk::Window`][crate::gdk::Window] associated with
1411    /// `widget` is destroyed, which means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been
1412    /// called or the widget has been unmapped (that is, it is going to be
1413    /// hidden).
1414    ///
1415    ///
1416    ///
1417    ///
1418    /// #### `visibility-notify-event`
1419    ///  The ::visibility-notify-event will be emitted when the `widget`'s
1420    /// window is obscured or unobscured.
1421    ///
1422    /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
1423    /// to enable the [`gdk::EventMask::VISIBILITY_NOTIFY_MASK`][crate::gdk::EventMask::VISIBILITY_NOTIFY_MASK] mask.
1424    ///
1425    ///
1426    ///
1427    ///
1428    /// #### `window-state-event`
1429    ///  The ::window-state-event will be emitted when the state of the
1430    /// toplevel window associated to the `widget` changes.
1431    ///
1432    /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget
1433    /// needs to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable
1434    /// this mask automatically for all new windows.
1435    ///
1436    ///
1437    /// </details>
1438    ///
1439    /// # Implements
1440    ///
1441    /// [`ShortcutsWindowExt`][trait@crate::prelude::ShortcutsWindowExt], [`GtkWindowExt`][trait@crate::prelude::GtkWindowExt], [`BinExt`][trait@crate::prelude::BinExt], [`ContainerExt`][trait@crate::prelude::ContainerExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`GtkWindowExtManual`][trait@crate::prelude::GtkWindowExtManual], [`ContainerExtManual`][trait@crate::prelude::ContainerExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
1442    #[doc(alias = "GtkShortcutsWindow")]
1443    pub struct ShortcutsWindow(Object<ffi::GtkShortcutsWindow, ffi::GtkShortcutsWindowClass>) @extends Window, Bin, Container, Widget, @implements Buildable;
1444
1445    match fn {
1446        type_ => || ffi::gtk_shortcuts_window_get_type(),
1447    }
1448}
1449
1450impl ShortcutsWindow {
1451    pub const NONE: Option<&'static ShortcutsWindow> = None;
1452
1453    // rustdoc-stripper-ignore-next
1454    /// Creates a new builder-pattern struct instance to construct [`ShortcutsWindow`] objects.
1455    ///
1456    /// This method returns an instance of [`ShortcutsWindowBuilder`](crate::builders::ShortcutsWindowBuilder) which can be used to create [`ShortcutsWindow`] objects.
1457    pub fn builder() -> ShortcutsWindowBuilder {
1458        ShortcutsWindowBuilder::new()
1459    }
1460}
1461
1462// rustdoc-stripper-ignore-next
1463/// A [builder-pattern] type to construct [`ShortcutsWindow`] objects.
1464///
1465/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1466#[must_use = "The builder must be built to be used"]
1467pub struct ShortcutsWindowBuilder {
1468    builder: glib::object::ObjectBuilder<'static, ShortcutsWindow>,
1469}
1470
1471impl ShortcutsWindowBuilder {
1472    fn new() -> Self {
1473        Self {
1474            builder: glib::object::Object::builder(),
1475        }
1476    }
1477
1478    /// The name of the section to show.
1479    ///
1480    /// This should be the section-name of one of the [`ShortcutsSection`][crate::ShortcutsSection]
1481    /// objects that are in this shortcuts window.
1482    pub fn section_name(self, section_name: impl Into<glib::GString>) -> Self {
1483        Self {
1484            builder: self.builder.property("section-name", section_name.into()),
1485        }
1486    }
1487
1488    /// The view name by which to filter the contents.
1489    ///
1490    /// This should correspond to the [`view`][struct@crate::ShortcutsGroup#view] property of some of
1491    /// the [`ShortcutsGroup`][crate::ShortcutsGroup] objects that are inside this shortcuts window.
1492    ///
1493    /// Set this to [`None`] to show all groups.
1494    pub fn view_name(self, view_name: impl Into<glib::GString>) -> Self {
1495        Self {
1496            builder: self.builder.property("view-name", view_name.into()),
1497        }
1498    }
1499
1500    /// Whether the window should receive the input focus.
1501    pub fn accept_focus(self, accept_focus: bool) -> Self {
1502        Self {
1503            builder: self.builder.property("accept-focus", accept_focus),
1504        }
1505    }
1506
1507    /// The [`Application`][crate::Application] associated with the window.
1508    ///
1509    /// The application will be kept alive for at least as long as it
1510    /// has any windows associated with it (see [`ApplicationExtManual::hold()`][crate::gio::prelude::ApplicationExtManual::hold()]
1511    /// for a way to keep it alive without windows).
1512    ///
1513    /// Normally, the connection between the application and the window
1514    /// will remain until the window is destroyed, but you can explicitly
1515    /// remove it by setting the :application property to [`None`].
1516    pub fn application(self, application: &impl IsA<Application>) -> Self {
1517        Self {
1518            builder: self
1519                .builder
1520                .property("application", application.clone().upcast()),
1521        }
1522    }
1523
1524    /// The widget to which this window is attached.
1525    /// See [`GtkWindowExt::set_attached_to()`][crate::prelude::GtkWindowExt::set_attached_to()].
1526    ///
1527    /// Examples of places where specifying this relation is useful are
1528    /// for instance a [`Menu`][crate::Menu] created by a [`ComboBox`][crate::ComboBox], a completion
1529    /// popup window created by [`Entry`][crate::Entry] or a typeahead search entry
1530    /// created by [`TreeView`][crate::TreeView].
1531    pub fn attached_to(self, attached_to: &impl IsA<Widget>) -> Self {
1532        Self {
1533            builder: self
1534                .builder
1535                .property("attached-to", attached_to.clone().upcast()),
1536        }
1537    }
1538
1539    /// Whether the window should be decorated by the window manager.
1540    pub fn decorated(self, decorated: bool) -> Self {
1541        Self {
1542            builder: self.builder.property("decorated", decorated),
1543        }
1544    }
1545
1546    pub fn default_height(self, default_height: i32) -> Self {
1547        Self {
1548            builder: self.builder.property("default-height", default_height),
1549        }
1550    }
1551
1552    pub fn default_width(self, default_width: i32) -> Self {
1553        Self {
1554            builder: self.builder.property("default-width", default_width),
1555        }
1556    }
1557
1558    /// Whether the window frame should have a close button.
1559    pub fn deletable(self, deletable: bool) -> Self {
1560        Self {
1561            builder: self.builder.property("deletable", deletable),
1562        }
1563    }
1564
1565    pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
1566        Self {
1567            builder: self
1568                .builder
1569                .property("destroy-with-parent", destroy_with_parent),
1570        }
1571    }
1572
1573    /// Whether the window should receive the input focus when mapped.
1574    pub fn focus_on_map(self, focus_on_map: bool) -> Self {
1575        Self {
1576            builder: self.builder.property("focus-on-map", focus_on_map),
1577        }
1578    }
1579
1580    /// Whether 'focus rectangles' are currently visible in this window.
1581    ///
1582    /// This property is maintained by GTK+ based on user input
1583    /// and should not be set by applications.
1584    pub fn focus_visible(self, focus_visible: bool) -> Self {
1585        Self {
1586            builder: self.builder.property("focus-visible", focus_visible),
1587        }
1588    }
1589
1590    /// The window gravity of the window. See [`GtkWindowExt::move_()`][crate::prelude::GtkWindowExt::move_()] and [`gdk::Gravity`][crate::gdk::Gravity] for
1591    /// more details about window gravity.
1592    pub fn gravity(self, gravity: gdk::Gravity) -> Self {
1593        Self {
1594            builder: self.builder.property("gravity", gravity),
1595        }
1596    }
1597
1598    /// Whether the titlebar should be hidden during maximization.
1599    pub fn hide_titlebar_when_maximized(self, hide_titlebar_when_maximized: bool) -> Self {
1600        Self {
1601            builder: self
1602                .builder
1603                .property("hide-titlebar-when-maximized", hide_titlebar_when_maximized),
1604        }
1605    }
1606
1607    pub fn icon(self, icon: &gdk_pixbuf::Pixbuf) -> Self {
1608        Self {
1609            builder: self.builder.property("icon", icon.clone()),
1610        }
1611    }
1612
1613    /// The :icon-name property specifies the name of the themed icon to
1614    /// use as the window icon. See [`IconTheme`][crate::IconTheme] for more details.
1615    pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
1616        Self {
1617            builder: self.builder.property("icon-name", icon_name.into()),
1618        }
1619    }
1620
1621    /// Whether mnemonics are currently visible in this window.
1622    ///
1623    /// This property is maintained by GTK+ based on user input,
1624    /// and should not be set by applications.
1625    pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
1626        Self {
1627            builder: self
1628                .builder
1629                .property("mnemonics-visible", mnemonics_visible),
1630        }
1631    }
1632
1633    pub fn modal(self, modal: bool) -> Self {
1634        Self {
1635            builder: self.builder.property("modal", modal),
1636        }
1637    }
1638
1639    pub fn resizable(self, resizable: bool) -> Self {
1640        Self {
1641            builder: self.builder.property("resizable", resizable),
1642        }
1643    }
1644
1645    pub fn role(self, role: impl Into<glib::GString>) -> Self {
1646        Self {
1647            builder: self.builder.property("role", role.into()),
1648        }
1649    }
1650
1651    pub fn screen(self, screen: &gdk::Screen) -> Self {
1652        Self {
1653            builder: self.builder.property("screen", screen.clone()),
1654        }
1655    }
1656
1657    pub fn skip_pager_hint(self, skip_pager_hint: bool) -> Self {
1658        Self {
1659            builder: self.builder.property("skip-pager-hint", skip_pager_hint),
1660        }
1661    }
1662
1663    pub fn skip_taskbar_hint(self, skip_taskbar_hint: bool) -> Self {
1664        Self {
1665            builder: self
1666                .builder
1667                .property("skip-taskbar-hint", skip_taskbar_hint),
1668        }
1669    }
1670
1671    /// The :startup-id is a write-only property for setting window's
1672    /// startup notification identifier. See [`GtkWindowExt::set_startup_id()`][crate::prelude::GtkWindowExt::set_startup_id()]
1673    /// for more details.
1674    pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
1675        Self {
1676            builder: self.builder.property("startup-id", startup_id.into()),
1677        }
1678    }
1679
1680    pub fn title(self, title: impl Into<glib::GString>) -> Self {
1681        Self {
1682            builder: self.builder.property("title", title.into()),
1683        }
1684    }
1685
1686    /// The transient parent of the window. See [`GtkWindowExt::set_transient_for()`][crate::prelude::GtkWindowExt::set_transient_for()] for
1687    /// more details about transient windows.
1688    pub fn transient_for(self, transient_for: &impl IsA<Window>) -> Self {
1689        Self {
1690            builder: self
1691                .builder
1692                .property("transient-for", transient_for.clone().upcast()),
1693        }
1694    }
1695
1696    pub fn type_(self, type_: WindowType) -> Self {
1697        Self {
1698            builder: self.builder.property("type", type_),
1699        }
1700    }
1701
1702    pub fn type_hint(self, type_hint: gdk::WindowTypeHint) -> Self {
1703        Self {
1704            builder: self.builder.property("type-hint", type_hint),
1705        }
1706    }
1707
1708    pub fn urgency_hint(self, urgency_hint: bool) -> Self {
1709        Self {
1710            builder: self.builder.property("urgency-hint", urgency_hint),
1711        }
1712    }
1713
1714    pub fn window_position(self, window_position: WindowPosition) -> Self {
1715        Self {
1716            builder: self.builder.property("window-position", window_position),
1717        }
1718    }
1719
1720    pub fn border_width(self, border_width: u32) -> Self {
1721        Self {
1722            builder: self.builder.property("border-width", border_width),
1723        }
1724    }
1725
1726    pub fn child(self, child: &impl IsA<Widget>) -> Self {
1727        Self {
1728            builder: self.builder.property("child", child.clone().upcast()),
1729        }
1730    }
1731
1732    pub fn resize_mode(self, resize_mode: ResizeMode) -> Self {
1733        Self {
1734            builder: self.builder.property("resize-mode", resize_mode),
1735        }
1736    }
1737
1738    pub fn app_paintable(self, app_paintable: bool) -> Self {
1739        Self {
1740            builder: self.builder.property("app-paintable", app_paintable),
1741        }
1742    }
1743
1744    pub fn can_default(self, can_default: bool) -> Self {
1745        Self {
1746            builder: self.builder.property("can-default", can_default),
1747        }
1748    }
1749
1750    pub fn can_focus(self, can_focus: bool) -> Self {
1751        Self {
1752            builder: self.builder.property("can-focus", can_focus),
1753        }
1754    }
1755
1756    pub fn events(self, events: gdk::EventMask) -> Self {
1757        Self {
1758            builder: self.builder.property("events", events),
1759        }
1760    }
1761
1762    /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
1763    pub fn expand(self, expand: bool) -> Self {
1764        Self {
1765            builder: self.builder.property("expand", expand),
1766        }
1767    }
1768
1769    /// Whether the widget should grab focus when it is clicked with the mouse.
1770    ///
1771    /// This property is only relevant for widgets that can take focus.
1772    ///
1773    /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
1774    /// GtkComboBox) implemented this property individually.
1775    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
1776        Self {
1777            builder: self.builder.property("focus-on-click", focus_on_click),
1778        }
1779    }
1780
1781    /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
1782    pub fn halign(self, halign: Align) -> Self {
1783        Self {
1784            builder: self.builder.property("halign", halign),
1785        }
1786    }
1787
1788    pub fn has_default(self, has_default: bool) -> Self {
1789        Self {
1790            builder: self.builder.property("has-default", has_default),
1791        }
1792    }
1793
1794    pub fn has_focus(self, has_focus: bool) -> Self {
1795        Self {
1796            builder: self.builder.property("has-focus", has_focus),
1797        }
1798    }
1799
1800    /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
1801    /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
1802    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
1803    /// whether it will provide a tooltip or not.
1804    ///
1805    /// Note that setting this property to [`true`] for the first time will change
1806    /// the event masks of the GdkWindows of this widget to include leave-notify
1807    /// and motion-notify events. This cannot and will not be undone when the
1808    /// property is set to [`false`] again.
1809    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
1810        Self {
1811            builder: self.builder.property("has-tooltip", has_tooltip),
1812        }
1813    }
1814
1815    pub fn height_request(self, height_request: i32) -> Self {
1816        Self {
1817            builder: self.builder.property("height-request", height_request),
1818        }
1819    }
1820
1821    /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
1822    pub fn hexpand(self, hexpand: bool) -> Self {
1823        Self {
1824            builder: self.builder.property("hexpand", hexpand),
1825        }
1826    }
1827
1828    /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
1829    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
1830        Self {
1831            builder: self.builder.property("hexpand-set", hexpand_set),
1832        }
1833    }
1834
1835    pub fn is_focus(self, is_focus: bool) -> Self {
1836        Self {
1837            builder: self.builder.property("is-focus", is_focus),
1838        }
1839    }
1840
1841    /// Sets all four sides' margin at once. If read, returns max
1842    /// margin on any side.
1843    pub fn margin(self, margin: i32) -> Self {
1844        Self {
1845            builder: self.builder.property("margin", margin),
1846        }
1847    }
1848
1849    /// Margin on bottom side of widget.
1850    ///
1851    /// This property adds margin outside of the widget's normal size
1852    /// request, the margin will be added in addition to the size from
1853    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1854    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
1855        Self {
1856            builder: self.builder.property("margin-bottom", margin_bottom),
1857        }
1858    }
1859
1860    /// Margin on end of widget, horizontally. This property supports
1861    /// left-to-right and right-to-left text directions.
1862    ///
1863    /// This property adds margin outside of the widget's normal size
1864    /// request, the margin will be added in addition to the size from
1865    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1866    pub fn margin_end(self, margin_end: i32) -> Self {
1867        Self {
1868            builder: self.builder.property("margin-end", margin_end),
1869        }
1870    }
1871
1872    /// Margin on start of widget, horizontally. This property supports
1873    /// left-to-right and right-to-left text directions.
1874    ///
1875    /// This property adds margin outside of the widget's normal size
1876    /// request, the margin will be added in addition to the size from
1877    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1878    pub fn margin_start(self, margin_start: i32) -> Self {
1879        Self {
1880            builder: self.builder.property("margin-start", margin_start),
1881        }
1882    }
1883
1884    /// Margin on top side of widget.
1885    ///
1886    /// This property adds margin outside of the widget's normal size
1887    /// request, the margin will be added in addition to the size from
1888    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1889    pub fn margin_top(self, margin_top: i32) -> Self {
1890        Self {
1891            builder: self.builder.property("margin-top", margin_top),
1892        }
1893    }
1894
1895    pub fn name(self, name: impl Into<glib::GString>) -> Self {
1896        Self {
1897            builder: self.builder.property("name", name.into()),
1898        }
1899    }
1900
1901    pub fn no_show_all(self, no_show_all: bool) -> Self {
1902        Self {
1903            builder: self.builder.property("no-show-all", no_show_all),
1904        }
1905    }
1906
1907    /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
1908    /// more details about window opacity.
1909    ///
1910    /// Before 3.8 this was only available in GtkWindow
1911    pub fn opacity(self, opacity: f64) -> Self {
1912        Self {
1913            builder: self.builder.property("opacity", opacity),
1914        }
1915    }
1916
1917    pub fn parent(self, parent: &impl IsA<Container>) -> Self {
1918        Self {
1919            builder: self.builder.property("parent", parent.clone().upcast()),
1920        }
1921    }
1922
1923    pub fn receives_default(self, receives_default: bool) -> Self {
1924        Self {
1925            builder: self.builder.property("receives-default", receives_default),
1926        }
1927    }
1928
1929    pub fn sensitive(self, sensitive: bool) -> Self {
1930        Self {
1931            builder: self.builder.property("sensitive", sensitive),
1932        }
1933    }
1934
1935    /// Sets the text of tooltip to be the given string, which is marked up
1936    /// with the [Pango text markup language][PangoMarkupFormat].
1937    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
1938    ///
1939    /// This is a convenience property which will take care of getting the
1940    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
1941    /// will automatically be set to [`true`] and there will be taken care of
1942    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
1943    ///
1944    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
1945    /// are set, the last one wins.
1946    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
1947        Self {
1948            builder: self
1949                .builder
1950                .property("tooltip-markup", tooltip_markup.into()),
1951        }
1952    }
1953
1954    /// Sets the text of tooltip to be the given string.
1955    ///
1956    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
1957    ///
1958    /// This is a convenience property which will take care of getting the
1959    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
1960    /// will automatically be set to [`true`] and there will be taken care of
1961    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
1962    ///
1963    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
1964    /// are set, the last one wins.
1965    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
1966        Self {
1967            builder: self.builder.property("tooltip-text", tooltip_text.into()),
1968        }
1969    }
1970
1971    /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
1972    pub fn valign(self, valign: Align) -> Self {
1973        Self {
1974            builder: self.builder.property("valign", valign),
1975        }
1976    }
1977
1978    /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
1979    pub fn vexpand(self, vexpand: bool) -> Self {
1980        Self {
1981            builder: self.builder.property("vexpand", vexpand),
1982        }
1983    }
1984
1985    /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
1986    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
1987        Self {
1988            builder: self.builder.property("vexpand-set", vexpand_set),
1989        }
1990    }
1991
1992    pub fn visible(self, visible: bool) -> Self {
1993        Self {
1994            builder: self.builder.property("visible", visible),
1995        }
1996    }
1997
1998    pub fn width_request(self, width_request: i32) -> Self {
1999        Self {
2000            builder: self.builder.property("width-request", width_request),
2001        }
2002    }
2003
2004    // rustdoc-stripper-ignore-next
2005    /// Build the [`ShortcutsWindow`].
2006    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
2007    pub fn build(self) -> ShortcutsWindow {
2008        self.builder.build()
2009    }
2010}
2011
2012mod sealed {
2013    pub trait Sealed {}
2014    impl<T: super::IsA<super::ShortcutsWindow>> Sealed for T {}
2015}
2016
2017/// Trait containing all [`struct@ShortcutsWindow`] methods.
2018///
2019/// # Implementors
2020///
2021/// [`ShortcutsWindow`][struct@crate::ShortcutsWindow]
2022pub trait ShortcutsWindowExt: IsA<ShortcutsWindow> + sealed::Sealed + 'static {
2023    /// The name of the section to show.
2024    ///
2025    /// This should be the section-name of one of the [`ShortcutsSection`][crate::ShortcutsSection]
2026    /// objects that are in this shortcuts window.
2027    #[doc(alias = "section-name")]
2028    fn section_name(&self) -> Option<glib::GString> {
2029        ObjectExt::property(self.as_ref(), "section-name")
2030    }
2031
2032    /// The name of the section to show.
2033    ///
2034    /// This should be the section-name of one of the [`ShortcutsSection`][crate::ShortcutsSection]
2035    /// objects that are in this shortcuts window.
2036    #[doc(alias = "section-name")]
2037    fn set_section_name(&self, section_name: Option<&str>) {
2038        ObjectExt::set_property(self.as_ref(), "section-name", section_name)
2039    }
2040
2041    /// The view name by which to filter the contents.
2042    ///
2043    /// This should correspond to the [`view`][struct@crate::ShortcutsGroup#view] property of some of
2044    /// the [`ShortcutsGroup`][crate::ShortcutsGroup] objects that are inside this shortcuts window.
2045    ///
2046    /// Set this to [`None`] to show all groups.
2047    #[doc(alias = "view-name")]
2048    fn view_name(&self) -> Option<glib::GString> {
2049        ObjectExt::property(self.as_ref(), "view-name")
2050    }
2051
2052    /// The view name by which to filter the contents.
2053    ///
2054    /// This should correspond to the [`view`][struct@crate::ShortcutsGroup#view] property of some of
2055    /// the [`ShortcutsGroup`][crate::ShortcutsGroup] objects that are inside this shortcuts window.
2056    ///
2057    /// Set this to [`None`] to show all groups.
2058    #[doc(alias = "view-name")]
2059    fn set_view_name(&self, view_name: Option<&str>) {
2060        ObjectExt::set_property(self.as_ref(), "view-name", view_name)
2061    }
2062
2063    /// The ::close signal is a
2064    /// [keybinding signal][GtkBindingSignal]
2065    /// which gets emitted when the user uses a keybinding to close
2066    /// the window.
2067    ///
2068    /// The default binding for this signal is the Escape key.
2069    #[doc(alias = "close")]
2070    fn connect_close<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2071        unsafe extern "C" fn close_trampoline<P: IsA<ShortcutsWindow>, F: Fn(&P) + 'static>(
2072            this: *mut ffi::GtkShortcutsWindow,
2073            f: glib::ffi::gpointer,
2074        ) {
2075            let f: &F = &*(f as *const F);
2076            f(ShortcutsWindow::from_glib_borrow(this).unsafe_cast_ref())
2077        }
2078        unsafe {
2079            let f: Box_<F> = Box_::new(f);
2080            connect_raw(
2081                self.as_ptr() as *mut _,
2082                b"close\0".as_ptr() as *const _,
2083                Some(transmute::<_, unsafe extern "C" fn()>(
2084                    close_trampoline::<Self, F> as *const (),
2085                )),
2086                Box_::into_raw(f),
2087            )
2088        }
2089    }
2090
2091    fn emit_close(&self) {
2092        self.emit_by_name::<()>("close", &[]);
2093    }
2094
2095    /// The ::search signal is a
2096    /// [keybinding signal][GtkBindingSignal]
2097    /// which gets emitted when the user uses a keybinding to start a search.
2098    ///
2099    /// The default binding for this signal is Control-F.
2100    #[doc(alias = "search")]
2101    fn connect_search<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2102        unsafe extern "C" fn search_trampoline<P: IsA<ShortcutsWindow>, F: Fn(&P) + 'static>(
2103            this: *mut ffi::GtkShortcutsWindow,
2104            f: glib::ffi::gpointer,
2105        ) {
2106            let f: &F = &*(f as *const F);
2107            f(ShortcutsWindow::from_glib_borrow(this).unsafe_cast_ref())
2108        }
2109        unsafe {
2110            let f: Box_<F> = Box_::new(f);
2111            connect_raw(
2112                self.as_ptr() as *mut _,
2113                b"search\0".as_ptr() as *const _,
2114                Some(transmute::<_, unsafe extern "C" fn()>(
2115                    search_trampoline::<Self, F> as *const (),
2116                )),
2117                Box_::into_raw(f),
2118            )
2119        }
2120    }
2121
2122    fn emit_search(&self) {
2123        self.emit_by_name::<()>("search", &[]);
2124    }
2125
2126    #[doc(alias = "section-name")]
2127    fn connect_section_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2128        unsafe extern "C" fn notify_section_name_trampoline<
2129            P: IsA<ShortcutsWindow>,
2130            F: Fn(&P) + 'static,
2131        >(
2132            this: *mut ffi::GtkShortcutsWindow,
2133            _param_spec: glib::ffi::gpointer,
2134            f: glib::ffi::gpointer,
2135        ) {
2136            let f: &F = &*(f as *const F);
2137            f(ShortcutsWindow::from_glib_borrow(this).unsafe_cast_ref())
2138        }
2139        unsafe {
2140            let f: Box_<F> = Box_::new(f);
2141            connect_raw(
2142                self.as_ptr() as *mut _,
2143                b"notify::section-name\0".as_ptr() as *const _,
2144                Some(transmute::<_, unsafe extern "C" fn()>(
2145                    notify_section_name_trampoline::<Self, F> as *const (),
2146                )),
2147                Box_::into_raw(f),
2148            )
2149        }
2150    }
2151
2152    #[doc(alias = "view-name")]
2153    fn connect_view_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2154        unsafe extern "C" fn notify_view_name_trampoline<
2155            P: IsA<ShortcutsWindow>,
2156            F: Fn(&P) + 'static,
2157        >(
2158            this: *mut ffi::GtkShortcutsWindow,
2159            _param_spec: glib::ffi::gpointer,
2160            f: glib::ffi::gpointer,
2161        ) {
2162            let f: &F = &*(f as *const F);
2163            f(ShortcutsWindow::from_glib_borrow(this).unsafe_cast_ref())
2164        }
2165        unsafe {
2166            let f: Box_<F> = Box_::new(f);
2167            connect_raw(
2168                self.as_ptr() as *mut _,
2169                b"notify::view-name\0".as_ptr() as *const _,
2170                Some(transmute::<_, unsafe extern "C" fn()>(
2171                    notify_view_name_trampoline::<Self, F> as *const (),
2172                )),
2173                Box_::into_raw(f),
2174            )
2175        }
2176    }
2177}
2178
2179impl<O: IsA<ShortcutsWindow>> ShortcutsWindowExt for O {}
2180
2181impl fmt::Display for ShortcutsWindow {
2182    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2183        f.write_str("ShortcutsWindow")
2184    }
2185}