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