Skip to main content

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