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