Skip to main content

gtk/auto/
flow_box_child.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::{Align, Bin, Buildable, Container, ResizeMode, Widget};
6use glib::{
7    prelude::*,
8    signal::{connect_raw, SignalHandlerId},
9    translate::*,
10};
11use std::{boxed::Box as Box_, fmt, mem::transmute};
12
13glib::wrapper! {
14    ///
15    ///
16    /// ## Signals
17    ///
18    ///
19    /// #### `activate`
20    ///  The ::activate signal is emitted when the user activates
21    /// a child widget in a [`FlowBox`][crate::FlowBox], either by clicking or
22    /// double-clicking, or by using the Space or Enter key.
23    ///
24    /// While this signal is used as a
25    /// [keybinding signal][GtkBindingSignal],
26    /// it can be used by applications for their own purposes.
27    ///
28    /// Action
29    /// <details><summary><h4>Container</h4></summary>
30    ///
31    ///
32    /// #### `add`
33    ///
34    ///
35    ///
36    /// #### `check-resize`
37    ///
38    ///
39    ///
40    /// #### `remove`
41    ///
42    ///
43    ///
44    /// #### `set-focus-child`
45    ///
46    /// </details>
47    /// <details><summary><h4>Widget</h4></summary>
48    ///
49    ///
50    /// #### `accel-closures-changed`
51    ///
52    ///
53    ///
54    /// #### `button-press-event`
55    ///  The ::button-press-event signal will be emitted when a button
56    /// (typically from a mouse) is pressed.
57    ///
58    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
59    /// widget needs to enable the [`gdk::EventMask::BUTTON_PRESS_MASK`][crate::gdk::EventMask::BUTTON_PRESS_MASK] mask.
60    ///
61    /// This signal will be sent to the grab widget if there is one.
62    ///
63    ///
64    ///
65    ///
66    /// #### `button-release-event`
67    ///  The ::button-release-event signal will be emitted when a button
68    /// (typically from a mouse) is released.
69    ///
70    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
71    /// widget needs to enable the [`gdk::EventMask::BUTTON_RELEASE_MASK`][crate::gdk::EventMask::BUTTON_RELEASE_MASK] mask.
72    ///
73    /// This signal will be sent to the grab widget if there is one.
74    ///
75    ///
76    ///
77    ///
78    /// #### `can-activate-accel`
79    ///  Determines whether an accelerator that activates the signal
80    /// identified by `signal_id` can currently be activated.
81    /// This signal is present to allow applications and derived
82    /// widgets to override the default [`Widget`][crate::Widget] handling
83    /// for determining whether an accelerator can be activated.
84    ///
85    ///
86    ///
87    ///
88    /// #### `child-notify`
89    ///  The ::child-notify signal is emitted for each
90    /// [child property][child-properties] that has
91    /// changed on an object. The signal's detail holds the property name.
92    ///
93    /// Detailed
94    ///
95    ///
96    /// #### `composited-changed`
97    ///  The ::composited-changed signal is emitted when the composited
98    /// status of `widgets` screen changes.
99    /// See [`Screen::is_composited()`][crate::gdk::Screen::is_composited()].
100    ///
101    /// Action
102    ///
103    ///
104    /// #### `configure-event`
105    ///  The ::configure-event signal will be emitted when the size, position or
106    /// stacking of the `widget`'s window has changed.
107    ///
108    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
109    /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
110    /// automatically for all new windows.
111    ///
112    ///
113    ///
114    ///
115    /// #### `damage-event`
116    ///  Emitted when a redirected window belonging to `widget` gets drawn into.
117    /// The region/area members of the event shows what area of the redirected
118    /// drawable was drawn into.
119    ///
120    ///
121    ///
122    ///
123    /// #### `delete-event`
124    ///  The ::delete-event signal is emitted if a user requests that
125    /// a toplevel window is closed. The default handler for this signal
126    /// destroys the window. Connecting [`WidgetExtManual::hide_on_delete()`][crate::prelude::WidgetExtManual::hide_on_delete()] to
127    /// this signal will cause the window to be hidden instead, so that
128    /// it can later be shown again without reconstructing it.
129    ///
130    ///
131    ///
132    ///
133    /// #### `destroy`
134    ///  Signals that all holders of a reference to the widget should release
135    /// the reference that they hold. May result in finalization of the widget
136    /// if all references are released.
137    ///
138    /// This signal is not suitable for saving widget state.
139    ///
140    ///
141    ///
142    ///
143    /// #### `destroy-event`
144    ///  The ::destroy-event signal is emitted when a [`gdk::Window`][crate::gdk::Window] is destroyed.
145    /// You rarely get this signal, because most widgets disconnect themselves
146    /// from their window before they destroy it, so no widget owns the
147    /// window at destroy time.
148    ///
149    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
150    /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
151    /// automatically for all new windows.
152    ///
153    ///
154    ///
155    ///
156    /// #### `direction-changed`
157    ///  The ::direction-changed signal is emitted when the text direction
158    /// of a widget changes.
159    ///
160    ///
161    ///
162    ///
163    /// #### `drag-begin`
164    ///  The ::drag-begin signal is emitted on the drag source when a drag is
165    /// started. A typical reason to connect to this signal is to set up a
166    /// custom drag icon with e.g. [`WidgetExt::drag_source_set_icon_pixbuf()`][crate::prelude::WidgetExt::drag_source_set_icon_pixbuf()].
167    ///
168    /// Note that some widgets set up a drag icon in the default handler of
169    /// this signal, so you may have to use `g_signal_connect_after()` to
170    /// override what the default handler did.
171    ///
172    ///
173    ///
174    ///
175    /// #### `drag-data-delete`
176    ///  The ::drag-data-delete signal is emitted on the drag source when a drag
177    /// with the action [`gdk::DragAction::MOVE`][crate::gdk::DragAction::MOVE] is successfully completed. The signal
178    /// handler is responsible for deleting the data that has been dropped. What
179    /// "delete" means depends on the context of the drag operation.
180    ///
181    ///
182    ///
183    ///
184    /// #### `drag-data-get`
185    ///  The ::drag-data-get signal is emitted on the drag source when the drop
186    /// site requests the data which is dragged. It is the responsibility of
187    /// the signal handler to fill `data` with the data in the format which
188    /// is indicated by `info`. See [`SelectionData::set()`][crate::SelectionData::set()] and
189    /// [`SelectionData::set_text()`][crate::SelectionData::set_text()].
190    ///
191    ///
192    ///
193    ///
194    /// #### `drag-data-received`
195    ///  The ::drag-data-received signal is emitted on the drop site when the
196    /// dragged data has been received. If the data was received in order to
197    /// determine whether the drop will be accepted, the handler is expected
198    /// to call `gdk_drag_status()` and not finish the drag.
199    /// If the data was received in response to a [`drag-drop`][struct@crate::Widget#drag-drop] signal
200    /// (and this is the last target to be received), the handler for this
201    /// signal is expected to process the received data and then call
202    /// `gtk_drag_finish()`, setting the `success` parameter depending on
203    /// whether the data was processed successfully.
204    ///
205    /// Applications must create some means to determine why the signal was emitted
206    /// and therefore whether to call `gdk_drag_status()` or `gtk_drag_finish()`.
207    ///
208    /// The handler may inspect the selected action with
209    /// [`DragContext::selected_action()`][crate::gdk::DragContext::selected_action()] before calling
210    /// `gtk_drag_finish()`, e.g. to implement [`gdk::DragAction::ASK`][crate::gdk::DragAction::ASK] as
211    /// shown in the following example:
212    ///
213    ///
214    /// **⚠️ The following code is in C ⚠️**
215    ///
216    /// ```C
217    /// void
218    /// drag_data_received (GtkWidget          *widget,
219    ///                     GdkDragContext     *context,
220    ///                     gint                x,
221    ///                     gint                y,
222    ///                     GtkSelectionData   *data,
223    ///                     guint               info,
224    ///                     guint               time)
225    /// {
226    ///   if ((data->length >= 0) && (data->format == 8))
227    ///     {
228    ///       GdkDragAction action;
229    ///
230    ///       // handle data here
231    ///
232    ///       action = gdk_drag_context_get_selected_action (context);
233    ///       if (action == GDK_ACTION_ASK)
234    ///         {
235    ///           GtkWidget *dialog;
236    ///           gint response;
237    ///
238    ///           dialog = gtk_message_dialog_new (NULL,
239    ///                                            GTK_DIALOG_MODAL |
240    ///                                            GTK_DIALOG_DESTROY_WITH_PARENT,
241    ///                                            GTK_MESSAGE_INFO,
242    ///                                            GTK_BUTTONS_YES_NO,
243    ///                                            "Move the data ?\n");
244    ///           response = gtk_dialog_run (GTK_DIALOG (dialog));
245    ///           gtk_widget_destroy (dialog);
246    ///
247    ///           if (response == GTK_RESPONSE_YES)
248    ///             action = GDK_ACTION_MOVE;
249    ///           else
250    ///             action = GDK_ACTION_COPY;
251    ///          }
252    ///
253    ///       gtk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time);
254    ///     }
255    ///   else
256    ///     gtk_drag_finish (context, FALSE, FALSE, time);
257    ///  }
258    /// ```
259    ///
260    ///
261    ///
262    ///
263    /// #### `drag-drop`
264    ///  The ::drag-drop signal is emitted on the drop site when the user drops
265    /// the data onto the widget. The signal handler must determine whether
266    /// the cursor position is in a drop zone or not. If it is not in a drop
267    /// zone, it returns [`false`] and no further processing is necessary.
268    /// Otherwise, the handler returns [`true`]. In this case, the handler must
269    /// ensure that `gtk_drag_finish()` is called to let the source know that
270    /// the drop is done. The call to `gtk_drag_finish()` can be done either
271    /// directly or in a [`drag-data-received`][struct@crate::Widget#drag-data-received] handler which gets
272    /// triggered by calling [`WidgetExt::drag_get_data()`][crate::prelude::WidgetExt::drag_get_data()] to receive the data for one
273    /// or more of the supported targets.
274    ///
275    ///
276    ///
277    ///
278    /// #### `drag-end`
279    ///  The ::drag-end signal is emitted on the drag source when a drag is
280    /// finished. A typical reason to connect to this signal is to undo
281    /// things done in [`drag-begin`][struct@crate::Widget#drag-begin].
282    ///
283    ///
284    ///
285    ///
286    /// #### `drag-failed`
287    ///  The ::drag-failed signal is emitted on the drag source when a drag has
288    /// failed. The signal handler may hook custom code to handle a failed DnD
289    /// operation based on the type of error, it returns [`true`] is the failure has
290    /// been already handled (not showing the default "drag operation failed"
291    /// animation), otherwise it returns [`false`].
292    ///
293    ///
294    ///
295    ///
296    /// #### `drag-leave`
297    ///  The ::drag-leave signal is emitted on the drop site when the cursor
298    /// leaves the widget. A typical reason to connect to this signal is to
299    /// undo things done in [`drag-motion`][struct@crate::Widget#drag-motion], e.g. undo highlighting
300    /// with [`WidgetExt::drag_unhighlight()`][crate::prelude::WidgetExt::drag_unhighlight()].
301    ///
302    ///
303    /// Likewise, the [`drag-leave`][struct@crate::Widget#drag-leave] signal is also emitted before the
304    /// ::drag-drop signal, for instance to allow cleaning up of a preview item
305    /// created in the [`drag-motion`][struct@crate::Widget#drag-motion] signal handler.
306    ///
307    ///
308    ///
309    ///
310    /// #### `drag-motion`
311    ///  The ::drag-motion signal is emitted on the drop site when the user
312    /// moves the cursor over the widget during a drag. The signal handler
313    /// must determine whether the cursor position is in a drop zone or not.
314    /// If it is not in a drop zone, it returns [`false`] and no further processing
315    /// is necessary. Otherwise, the handler returns [`true`]. In this case, the
316    /// handler is responsible for providing the necessary information for
317    /// displaying feedback to the user, by calling `gdk_drag_status()`.
318    ///
319    /// If the decision whether the drop will be accepted or rejected can't be
320    /// made based solely on the cursor position and the type of the data, the
321    /// handler may inspect the dragged data by calling [`WidgetExt::drag_get_data()`][crate::prelude::WidgetExt::drag_get_data()] and
322    /// defer the `gdk_drag_status()` call to the [`drag-data-received`][struct@crate::Widget#drag-data-received]
323    /// handler. Note that you must pass [`DestDefaults::DROP`][crate::DestDefaults::DROP],
324    /// [`DestDefaults::MOTION`][crate::DestDefaults::MOTION] or [`DestDefaults::ALL`][crate::DestDefaults::ALL] to [`WidgetExtManual::drag_dest_set()`][crate::prelude::WidgetExtManual::drag_dest_set()]
325    /// when using the drag-motion signal that way.
326    ///
327    /// Also note that there is no drag-enter signal. The drag receiver has to
328    /// keep track of whether he has received any drag-motion signals since the
329    /// last [`drag-leave`][struct@crate::Widget#drag-leave] and if not, treat the drag-motion signal as
330    /// an "enter" signal. Upon an "enter", the handler will typically highlight
331    /// the drop site with [`WidgetExt::drag_highlight()`][crate::prelude::WidgetExt::drag_highlight()].
332    ///
333    ///
334    /// **⚠️ The following code is in C ⚠️**
335    ///
336    /// ```C
337    /// static void
338    /// drag_motion (GtkWidget      *widget,
339    ///              GdkDragContext *context,
340    ///              gint            x,
341    ///              gint            y,
342    ///              guint           time)
343    /// {
344    ///   GdkAtom target;
345    ///
346    ///   PrivateData *private_data = GET_PRIVATE_DATA (widget);
347    ///
348    ///   if (!private_data->drag_highlight)
349    ///    {
350    ///      private_data->drag_highlight = 1;
351    ///      gtk_drag_highlight (widget);
352    ///    }
353    ///
354    ///   target = gtk_drag_dest_find_target (widget, context, NULL);
355    ///   if (target == GDK_NONE)
356    ///     gdk_drag_status (context, 0, time);
357    ///   else
358    ///    {
359    ///      private_data->pending_status
360    ///         = gdk_drag_context_get_suggested_action (context);
361    ///      gtk_drag_get_data (widget, context, target, time);
362    ///    }
363    ///
364    ///   return TRUE;
365    /// }
366    ///
367    /// static void
368    /// drag_data_received (GtkWidget        *widget,
369    ///                     GdkDragContext   *context,
370    ///                     gint              x,
371    ///                     gint              y,
372    ///                     GtkSelectionData *selection_data,
373    ///                     guint             info,
374    ///                     guint             time)
375    /// {
376    ///   PrivateData *private_data = GET_PRIVATE_DATA (widget);
377    ///
378    ///   if (private_data->suggested_action)
379    ///    {
380    ///      private_data->suggested_action = 0;
381    ///
382    ///      // We are getting this data due to a request in drag_motion,
383    ///      // rather than due to a request in drag_drop, so we are just
384    ///      // supposed to call gdk_drag_status(), not actually paste in
385    ///      // the data.
386    ///
387    ///      str = gtk_selection_data_get_text (selection_data);
388    ///      if (!data_is_acceptable (str))
389    ///        gdk_drag_status (context, 0, time);
390    ///      else
391    ///        gdk_drag_status (context,
392    ///                         private_data->suggested_action,
393    ///                         time);
394    ///    }
395    ///   else
396    ///    {
397    ///      // accept the drop
398    ///    }
399    /// }
400    /// ```
401    ///
402    ///
403    ///
404    ///
405    /// #### `draw`
406    ///  This signal is emitted when a widget is supposed to render itself.
407    /// The `widget`'s top left corner must be painted at the origin of
408    /// the passed in context and be sized to the values returned by
409    /// [`WidgetExt::allocated_width()`][crate::prelude::WidgetExt::allocated_width()] and
410    /// [`WidgetExt::allocated_height()`][crate::prelude::WidgetExt::allocated_height()].
411    ///
412    /// Signal handlers connected to this signal can modify the cairo
413    /// context passed as `cr` in any way they like and don't need to
414    /// restore it. The signal emission takes care of calling `cairo_save()`
415    /// before and `cairo_restore()` after invoking the handler.
416    ///
417    /// The signal handler will get a `cr` with a clip region already set to the
418    /// widget's dirty region, i.e. to the area that needs repainting. Complicated
419    /// widgets that want to avoid redrawing themselves completely can get the full
420    /// extents of the clip region with `gdk_cairo_get_clip_rectangle()`, or they can
421    /// get a finer-grained representation of the dirty region with
422    /// `cairo_copy_clip_rectangle_list()`.
423    ///
424    ///
425    ///
426    ///
427    /// #### `enter-notify-event`
428    ///  The ::enter-notify-event will be emitted when the pointer enters
429    /// the `widget`'s window.
430    ///
431    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
432    /// to enable the [`gdk::EventMask::ENTER_NOTIFY_MASK`][crate::gdk::EventMask::ENTER_NOTIFY_MASK] mask.
433    ///
434    /// This signal will be sent to the grab widget if there is one.
435    ///
436    ///
437    ///
438    ///
439    /// #### `event`
440    ///  The GTK+ main loop will emit three signals for each GDK event delivered
441    /// to a widget: one generic ::event signal, another, more specific,
442    /// signal that matches the type of event delivered (e.g.
443    /// [`key-press-event`][struct@crate::Widget#key-press-event]) and finally a generic
444    /// [`event-after`][struct@crate::Widget#event-after] signal.
445    ///
446    ///
447    ///
448    ///
449    /// #### `event-after`
450    ///  After the emission of the [`event`][struct@crate::Widget#event] signal and (optionally)
451    /// the second more specific signal, ::event-after will be emitted
452    /// regardless of the previous two signals handlers return values.
453    ///
454    ///
455    ///
456    ///
457    /// #### `focus`
458    ///
459    ///
460    ///
461    /// #### `focus-in-event`
462    ///  The ::focus-in-event signal will be emitted when the keyboard focus
463    /// enters the `widget`'s window.
464    ///
465    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
466    /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
467    ///
468    ///
469    ///
470    ///
471    /// #### `focus-out-event`
472    ///  The ::focus-out-event signal will be emitted when the keyboard focus
473    /// leaves the `widget`'s window.
474    ///
475    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
476    /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
477    ///
478    ///
479    ///
480    ///
481    /// #### `grab-broken-event`
482    ///  Emitted when a pointer or keyboard grab on a window belonging
483    /// to `widget` gets broken.
484    ///
485    /// On X11, this happens when the grab window becomes unviewable
486    /// (i.e. it or one of its ancestors is unmapped), or if the same
487    /// application grabs the pointer or keyboard again.
488    ///
489    ///
490    ///
491    ///
492    /// #### `grab-focus`
493    ///  Action
494    ///
495    ///
496    /// #### `grab-notify`
497    ///  The ::grab-notify signal is emitted when a widget becomes
498    /// shadowed by a GTK+ grab (not a pointer or keyboard grab) on
499    /// another widget, or when it becomes unshadowed due to a grab
500    /// being removed.
501    ///
502    /// A widget is shadowed by a [`WidgetExt::grab_add()`][crate::prelude::WidgetExt::grab_add()] when the topmost
503    /// grab widget in the grab stack of its window group is not
504    /// its ancestor.
505    ///
506    ///
507    ///
508    ///
509    /// #### `hide`
510    ///  The ::hide signal is emitted when `widget` is hidden, for example with
511    /// [`WidgetExt::hide()`][crate::prelude::WidgetExt::hide()].
512    ///
513    ///
514    ///
515    ///
516    /// #### `hierarchy-changed`
517    ///  The ::hierarchy-changed signal is emitted when the
518    /// anchored state of a widget changes. A widget is
519    /// “anchored” when its toplevel
520    /// ancestor is a [`Window`][crate::Window]. This signal is emitted when
521    /// a widget changes from un-anchored to anchored or vice-versa.
522    ///
523    ///
524    ///
525    ///
526    /// #### `key-press-event`
527    ///  The ::key-press-event signal is emitted when a key is pressed. The signal
528    /// emission will reoccur at the key-repeat rate when the key is kept pressed.
529    ///
530    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
531    /// to enable the [`gdk::EventMask::KEY_PRESS_MASK`][crate::gdk::EventMask::KEY_PRESS_MASK] mask.
532    ///
533    /// This signal will be sent to the grab widget if there is one.
534    ///
535    ///
536    ///
537    ///
538    /// #### `key-release-event`
539    ///  The ::key-release-event signal is emitted when a key is released.
540    ///
541    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
542    /// to enable the [`gdk::EventMask::KEY_RELEASE_MASK`][crate::gdk::EventMask::KEY_RELEASE_MASK] mask.
543    ///
544    /// This signal will be sent to the grab widget if there is one.
545    ///
546    ///
547    ///
548    ///
549    /// #### `keynav-failed`
550    ///  Gets emitted if keyboard navigation fails.
551    /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
552    ///
553    ///
554    ///
555    ///
556    /// #### `leave-notify-event`
557    ///  The ::leave-notify-event will be emitted when the pointer leaves
558    /// the `widget`'s window.
559    ///
560    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
561    /// to enable the [`gdk::EventMask::LEAVE_NOTIFY_MASK`][crate::gdk::EventMask::LEAVE_NOTIFY_MASK] mask.
562    ///
563    /// This signal will be sent to the grab widget if there is one.
564    ///
565    ///
566    ///
567    ///
568    /// #### `map`
569    ///  The ::map signal is emitted when `widget` is going to be mapped, that is
570    /// when the widget is visible (which is controlled with
571    /// [`WidgetExt::set_visible()`][crate::prelude::WidgetExt::set_visible()]) and all its parents up to the toplevel widget
572    /// are also visible. Once the map has occurred, [`map-event`][struct@crate::Widget#map-event] will
573    /// be emitted.
574    ///
575    /// The ::map signal can be used to determine whether a widget will be drawn,
576    /// for instance it can resume an animation that was stopped during the
577    /// emission of [`unmap`][struct@crate::Widget#unmap].
578    ///
579    ///
580    ///
581    ///
582    /// #### `map-event`
583    ///  The ::map-event signal will be emitted when the `widget`'s window is
584    /// mapped. A window is mapped when it becomes visible on the screen.
585    ///
586    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
587    /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
588    /// automatically for all new windows.
589    ///
590    ///
591    ///
592    ///
593    /// #### `mnemonic-activate`
594    ///  The default handler for this signal activates `widget` if `group_cycling`
595    /// is [`false`], or just makes `widget` grab focus if `group_cycling` is [`true`].
596    ///
597    ///
598    ///
599    ///
600    /// #### `motion-notify-event`
601    ///  The ::motion-notify-event signal is emitted when the pointer moves
602    /// over the widget's [`gdk::Window`][crate::gdk::Window].
603    ///
604    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget
605    /// needs to enable the [`gdk::EventMask::POINTER_MOTION_MASK`][crate::gdk::EventMask::POINTER_MOTION_MASK] mask.
606    ///
607    /// This signal will be sent to the grab widget if there is one.
608    ///
609    ///
610    ///
611    ///
612    /// #### `move-focus`
613    ///  Action
614    ///
615    ///
616    /// #### `parent-set`
617    ///  The ::parent-set signal is emitted when a new parent
618    /// has been set on a widget.
619    ///
620    ///
621    ///
622    ///
623    /// #### `popup-menu`
624    ///  This signal gets emitted whenever a widget should pop up a context
625    /// menu. This usually happens through the standard key binding mechanism;
626    /// by pressing a certain key while a widget is focused, the user can cause
627    /// the widget to pop up a menu. For example, the [`Entry`][crate::Entry] widget creates
628    /// a menu with clipboard commands. See the
629    /// [Popup Menu Migration Checklist][checklist-popup-menu]
630    /// for an example of how to use this signal.
631    ///
632    /// Action
633    ///
634    ///
635    /// #### `property-notify-event`
636    ///  The ::property-notify-event signal will be emitted when a property on
637    /// the `widget`'s window has been changed or deleted.
638    ///
639    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
640    /// to enable the [`gdk::EventMask::PROPERTY_CHANGE_MASK`][crate::gdk::EventMask::PROPERTY_CHANGE_MASK] mask.
641    ///
642    ///
643    ///
644    ///
645    /// #### `proximity-in-event`
646    ///  To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
647    /// to enable the [`gdk::EventMask::PROXIMITY_IN_MASK`][crate::gdk::EventMask::PROXIMITY_IN_MASK] mask.
648    ///
649    /// This signal will be sent to the grab widget if there is one.
650    ///
651    ///
652    ///
653    ///
654    /// #### `proximity-out-event`
655    ///  To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
656    /// to enable the [`gdk::EventMask::PROXIMITY_OUT_MASK`][crate::gdk::EventMask::PROXIMITY_OUT_MASK] mask.
657    ///
658    /// This signal will be sent to the grab widget if there is one.
659    ///
660    ///
661    ///
662    ///
663    /// #### `query-tooltip`
664    ///  Emitted when [`has-tooltip`][struct@crate::Widget#has-tooltip] is [`true`] and the hover timeout
665    /// has expired with the cursor hovering "above" `widget`; or emitted when `widget` got
666    /// focus in keyboard mode.
667    ///
668    /// Using the given coordinates, the signal handler should determine
669    /// whether a tooltip should be shown for `widget`. If this is the case
670    /// [`true`] should be returned, [`false`] otherwise. Note that if
671    /// `keyboard_mode` is [`true`], the values of `x` and `y` are undefined and
672    /// should not be used.
673    ///
674    /// The signal handler is free to manipulate `tooltip` with the therefore
675    /// destined function calls.
676    ///
677    ///
678    ///
679    ///
680    /// #### `realize`
681    ///  The ::realize signal is emitted when `widget` is associated with a
682    /// [`gdk::Window`][crate::gdk::Window], which means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called or the
683    /// widget has been mapped (that is, it is going to be drawn).
684    ///
685    ///
686    ///
687    ///
688    /// #### `screen-changed`
689    ///  The ::screen-changed signal gets emitted when the
690    /// screen of a widget has changed.
691    ///
692    ///
693    ///
694    ///
695    /// #### `scroll-event`
696    ///  The ::scroll-event signal is emitted when a button in the 4 to 7
697    /// range is pressed. Wheel mice are usually configured to generate
698    /// button press events for buttons 4 and 5 when the wheel is turned.
699    ///
700    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
701    /// to enable the [`gdk::EventMask::SCROLL_MASK`][crate::gdk::EventMask::SCROLL_MASK] mask.
702    ///
703    /// This signal will be sent to the grab widget if there is one.
704    ///
705    ///
706    ///
707    ///
708    /// #### `selection-clear-event`
709    ///  The ::selection-clear-event signal will be emitted when the
710    /// the `widget`'s window has lost ownership of a selection.
711    ///
712    ///
713    ///
714    ///
715    /// #### `selection-get`
716    ///
717    ///
718    ///
719    /// #### `selection-notify-event`
720    ///
721    ///
722    ///
723    /// #### `selection-received`
724    ///
725    ///
726    ///
727    /// #### `selection-request-event`
728    ///  The ::selection-request-event signal will be emitted when
729    /// another client requests ownership of the selection owned by
730    /// the `widget`'s window.
731    ///
732    ///
733    ///
734    ///
735    /// #### `show`
736    ///  The ::show signal is emitted when `widget` is shown, for example with
737    /// [`WidgetExt::show()`][crate::prelude::WidgetExt::show()].
738    ///
739    ///
740    ///
741    ///
742    /// #### `show-help`
743    ///  Action
744    ///
745    ///
746    /// #### `size-allocate`
747    ///
748    ///
749    ///
750    /// #### `state-changed`
751    ///  The ::state-changed signal is emitted when the widget state changes.
752    /// See `gtk_widget_get_state()`.
753    ///
754    ///
755    ///
756    ///
757    /// #### `state-flags-changed`
758    ///  The ::state-flags-changed signal is emitted when the widget state
759    /// changes, see [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
760    ///
761    ///
762    ///
763    ///
764    /// #### `style-set`
765    ///  The ::style-set signal is emitted when a new style has been set
766    /// on a widget. Note that style-modifying functions like
767    /// `gtk_widget_modify_base()` also cause this signal to be emitted.
768    ///
769    /// Note that this signal is emitted for changes to the deprecated
770    /// `GtkStyle`. To track changes to the [`StyleContext`][crate::StyleContext] associated
771    /// with a widget, use the [`style-updated`][struct@crate::Widget#style-updated] signal.
772    ///
773    ///
774    ///
775    ///
776    /// #### `style-updated`
777    ///  The ::style-updated signal is a convenience signal that is emitted when the
778    /// [`changed`][struct@crate::StyleContext#changed] signal is emitted on the `widget`'s associated
779    /// [`StyleContext`][crate::StyleContext] as returned by [`WidgetExt::style_context()`][crate::prelude::WidgetExt::style_context()].
780    ///
781    /// Note that style-modifying functions like `gtk_widget_override_color()` also
782    /// cause this signal to be emitted.
783    ///
784    ///
785    ///
786    ///
787    /// #### `touch-event`
788    ///
789    ///
790    ///
791    /// #### `unmap`
792    ///  The ::unmap signal is emitted when `widget` is going to be unmapped, which
793    /// means that either it or any of its parents up to the toplevel widget have
794    /// been set as hidden.
795    ///
796    /// As ::unmap indicates that a widget will not be shown any longer, it can be
797    /// used to, for example, stop an animation on the widget.
798    ///
799    ///
800    ///
801    ///
802    /// #### `unmap-event`
803    ///  The ::unmap-event signal will be emitted when the `widget`'s window is
804    /// unmapped. A window is unmapped when it becomes invisible on the screen.
805    ///
806    /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
807    /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
808    /// automatically for all new windows.
809    ///
810    ///
811    ///
812    ///
813    /// #### `unrealize`
814    ///  The ::unrealize signal is emitted when the [`gdk::Window`][crate::gdk::Window] associated with
815    /// `widget` is destroyed, which means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been
816    /// called or the widget has been unmapped (that is, it is going to be
817    /// hidden).
818    ///
819    ///
820    ///
821    ///
822    /// #### `visibility-notify-event`
823    ///  The ::visibility-notify-event will be emitted when the `widget`'s
824    /// window is obscured or unobscured.
825    ///
826    /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
827    /// to enable the [`gdk::EventMask::VISIBILITY_NOTIFY_MASK`][crate::gdk::EventMask::VISIBILITY_NOTIFY_MASK] mask.
828    ///
829    ///
830    ///
831    ///
832    /// #### `window-state-event`
833    ///  The ::window-state-event will be emitted when the state of the
834    /// toplevel window associated to the `widget` changes.
835    ///
836    /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget
837    /// needs to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable
838    /// this mask automatically for all new windows.
839    ///
840    ///
841    /// </details>
842    ///
843    /// # Implements
844    ///
845    /// [`FlowBoxChildExt`][trait@crate::prelude::FlowBoxChildExt], [`BinExt`][trait@crate::prelude::BinExt], [`ContainerExt`][trait@crate::prelude::ContainerExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ContainerExtManual`][trait@crate::prelude::ContainerExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
846    #[doc(alias = "GtkFlowBoxChild")]
847    pub struct FlowBoxChild(Object<ffi::GtkFlowBoxChild, ffi::GtkFlowBoxChildClass>) @extends Bin, Container, Widget, @implements Buildable;
848
849    match fn {
850        type_ => || ffi::gtk_flow_box_child_get_type(),
851    }
852}
853
854impl FlowBoxChild {
855    pub const NONE: Option<&'static FlowBoxChild> = None;
856
857    /// Creates a new [`FlowBoxChild`][crate::FlowBoxChild], to be used as a child
858    /// of a [`FlowBox`][crate::FlowBox].
859    ///
860    /// # Returns
861    ///
862    /// a new [`FlowBoxChild`][crate::FlowBoxChild]
863    #[doc(alias = "gtk_flow_box_child_new")]
864    pub fn new() -> FlowBoxChild {
865        assert_initialized_main_thread!();
866        unsafe { Widget::from_glib_none(ffi::gtk_flow_box_child_new()).unsafe_cast() }
867    }
868
869    // rustdoc-stripper-ignore-next
870    /// Creates a new builder-pattern struct instance to construct [`FlowBoxChild`] objects.
871    ///
872    /// This method returns an instance of [`FlowBoxChildBuilder`](crate::builders::FlowBoxChildBuilder) which can be used to create [`FlowBoxChild`] objects.
873    pub fn builder() -> FlowBoxChildBuilder {
874        FlowBoxChildBuilder::new()
875    }
876}
877
878impl Default for FlowBoxChild {
879    fn default() -> Self {
880        Self::new()
881    }
882}
883
884// rustdoc-stripper-ignore-next
885/// A [builder-pattern] type to construct [`FlowBoxChild`] objects.
886///
887/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
888#[must_use = "The builder must be built to be used"]
889pub struct FlowBoxChildBuilder {
890    builder: glib::object::ObjectBuilder<'static, FlowBoxChild>,
891}
892
893impl FlowBoxChildBuilder {
894    fn new() -> Self {
895        Self {
896            builder: glib::object::Object::builder(),
897        }
898    }
899
900    pub fn border_width(self, border_width: u32) -> Self {
901        Self {
902            builder: self.builder.property("border-width", border_width),
903        }
904    }
905
906    pub fn child(self, child: &impl IsA<Widget>) -> Self {
907        Self {
908            builder: self.builder.property("child", child.clone().upcast()),
909        }
910    }
911
912    pub fn resize_mode(self, resize_mode: ResizeMode) -> Self {
913        Self {
914            builder: self.builder.property("resize-mode", resize_mode),
915        }
916    }
917
918    pub fn app_paintable(self, app_paintable: bool) -> Self {
919        Self {
920            builder: self.builder.property("app-paintable", app_paintable),
921        }
922    }
923
924    pub fn can_default(self, can_default: bool) -> Self {
925        Self {
926            builder: self.builder.property("can-default", can_default),
927        }
928    }
929
930    pub fn can_focus(self, can_focus: bool) -> Self {
931        Self {
932            builder: self.builder.property("can-focus", can_focus),
933        }
934    }
935
936    pub fn events(self, events: gdk::EventMask) -> Self {
937        Self {
938            builder: self.builder.property("events", events),
939        }
940    }
941
942    /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
943    pub fn expand(self, expand: bool) -> Self {
944        Self {
945            builder: self.builder.property("expand", expand),
946        }
947    }
948
949    /// Whether the widget should grab focus when it is clicked with the mouse.
950    ///
951    /// This property is only relevant for widgets that can take focus.
952    ///
953    /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
954    /// GtkComboBox) implemented this property individually.
955    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
956        Self {
957            builder: self.builder.property("focus-on-click", focus_on_click),
958        }
959    }
960
961    /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
962    pub fn halign(self, halign: Align) -> Self {
963        Self {
964            builder: self.builder.property("halign", halign),
965        }
966    }
967
968    pub fn has_default(self, has_default: bool) -> Self {
969        Self {
970            builder: self.builder.property("has-default", has_default),
971        }
972    }
973
974    pub fn has_focus(self, has_focus: bool) -> Self {
975        Self {
976            builder: self.builder.property("has-focus", has_focus),
977        }
978    }
979
980    /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
981    /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
982    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
983    /// whether it will provide a tooltip or not.
984    ///
985    /// Note that setting this property to [`true`] for the first time will change
986    /// the event masks of the GdkWindows of this widget to include leave-notify
987    /// and motion-notify events. This cannot and will not be undone when the
988    /// property is set to [`false`] again.
989    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
990        Self {
991            builder: self.builder.property("has-tooltip", has_tooltip),
992        }
993    }
994
995    pub fn height_request(self, height_request: i32) -> Self {
996        Self {
997            builder: self.builder.property("height-request", height_request),
998        }
999    }
1000
1001    /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
1002    pub fn hexpand(self, hexpand: bool) -> Self {
1003        Self {
1004            builder: self.builder.property("hexpand", hexpand),
1005        }
1006    }
1007
1008    /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
1009    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
1010        Self {
1011            builder: self.builder.property("hexpand-set", hexpand_set),
1012        }
1013    }
1014
1015    pub fn is_focus(self, is_focus: bool) -> Self {
1016        Self {
1017            builder: self.builder.property("is-focus", is_focus),
1018        }
1019    }
1020
1021    /// Sets all four sides' margin at once. If read, returns max
1022    /// margin on any side.
1023    pub fn margin(self, margin: i32) -> Self {
1024        Self {
1025            builder: self.builder.property("margin", margin),
1026        }
1027    }
1028
1029    /// Margin on bottom side of widget.
1030    ///
1031    /// This property adds margin outside of the widget's normal size
1032    /// request, the margin will be added in addition to the size from
1033    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1034    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
1035        Self {
1036            builder: self.builder.property("margin-bottom", margin_bottom),
1037        }
1038    }
1039
1040    /// Margin on end of widget, horizontally. This property supports
1041    /// left-to-right and right-to-left text directions.
1042    ///
1043    /// This property adds margin outside of the widget's normal size
1044    /// request, the margin will be added in addition to the size from
1045    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1046    pub fn margin_end(self, margin_end: i32) -> Self {
1047        Self {
1048            builder: self.builder.property("margin-end", margin_end),
1049        }
1050    }
1051
1052    /// Margin on start of widget, horizontally. This property supports
1053    /// left-to-right and right-to-left text directions.
1054    ///
1055    /// This property adds margin outside of the widget's normal size
1056    /// request, the margin will be added in addition to the size from
1057    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1058    pub fn margin_start(self, margin_start: i32) -> Self {
1059        Self {
1060            builder: self.builder.property("margin-start", margin_start),
1061        }
1062    }
1063
1064    /// Margin on top side of widget.
1065    ///
1066    /// This property adds margin outside of the widget's normal size
1067    /// request, the margin will be added in addition to the size from
1068    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1069    pub fn margin_top(self, margin_top: i32) -> Self {
1070        Self {
1071            builder: self.builder.property("margin-top", margin_top),
1072        }
1073    }
1074
1075    pub fn name(self, name: impl Into<glib::GString>) -> Self {
1076        Self {
1077            builder: self.builder.property("name", name.into()),
1078        }
1079    }
1080
1081    pub fn no_show_all(self, no_show_all: bool) -> Self {
1082        Self {
1083            builder: self.builder.property("no-show-all", no_show_all),
1084        }
1085    }
1086
1087    /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
1088    /// more details about window opacity.
1089    ///
1090    /// Before 3.8 this was only available in GtkWindow
1091    pub fn opacity(self, opacity: f64) -> Self {
1092        Self {
1093            builder: self.builder.property("opacity", opacity),
1094        }
1095    }
1096
1097    pub fn parent(self, parent: &impl IsA<Container>) -> Self {
1098        Self {
1099            builder: self.builder.property("parent", parent.clone().upcast()),
1100        }
1101    }
1102
1103    pub fn receives_default(self, receives_default: bool) -> Self {
1104        Self {
1105            builder: self.builder.property("receives-default", receives_default),
1106        }
1107    }
1108
1109    pub fn sensitive(self, sensitive: bool) -> Self {
1110        Self {
1111            builder: self.builder.property("sensitive", sensitive),
1112        }
1113    }
1114
1115    /// Sets the text of tooltip to be the given string, which is marked up
1116    /// with the [Pango text markup language][PangoMarkupFormat].
1117    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
1118    ///
1119    /// This is a convenience property which will take care of getting the
1120    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
1121    /// will automatically be set to [`true`] and there will be taken care of
1122    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
1123    ///
1124    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
1125    /// are set, the last one wins.
1126    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
1127        Self {
1128            builder: self
1129                .builder
1130                .property("tooltip-markup", tooltip_markup.into()),
1131        }
1132    }
1133
1134    /// Sets the text of tooltip to be the given string.
1135    ///
1136    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
1137    ///
1138    /// This is a convenience property which will take care of getting the
1139    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
1140    /// will automatically be set to [`true`] and there will be taken care of
1141    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
1142    ///
1143    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
1144    /// are set, the last one wins.
1145    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
1146        Self {
1147            builder: self.builder.property("tooltip-text", tooltip_text.into()),
1148        }
1149    }
1150
1151    /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
1152    pub fn valign(self, valign: Align) -> Self {
1153        Self {
1154            builder: self.builder.property("valign", valign),
1155        }
1156    }
1157
1158    /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
1159    pub fn vexpand(self, vexpand: bool) -> Self {
1160        Self {
1161            builder: self.builder.property("vexpand", vexpand),
1162        }
1163    }
1164
1165    /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
1166    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
1167        Self {
1168            builder: self.builder.property("vexpand-set", vexpand_set),
1169        }
1170    }
1171
1172    pub fn visible(self, visible: bool) -> Self {
1173        Self {
1174            builder: self.builder.property("visible", visible),
1175        }
1176    }
1177
1178    pub fn width_request(self, width_request: i32) -> Self {
1179        Self {
1180            builder: self.builder.property("width-request", width_request),
1181        }
1182    }
1183
1184    // rustdoc-stripper-ignore-next
1185    /// Build the [`FlowBoxChild`].
1186    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1187    pub fn build(self) -> FlowBoxChild {
1188        self.builder.build()
1189    }
1190}
1191
1192mod sealed {
1193    pub trait Sealed {}
1194    impl<T: super::IsA<super::FlowBoxChild>> Sealed for T {}
1195}
1196
1197/// Trait containing all [`struct@FlowBoxChild`] methods.
1198///
1199/// # Implementors
1200///
1201/// [`FlowBoxChild`][struct@crate::FlowBoxChild]
1202pub trait FlowBoxChildExt: IsA<FlowBoxChild> + sealed::Sealed + 'static {
1203    /// Marks `self` as changed, causing any state that depends on this
1204    /// to be updated. This affects sorting and filtering.
1205    ///
1206    /// Note that calls to this method must be in sync with the data
1207    /// used for the sorting and filtering functions. For instance, if
1208    /// the list is mirroring some external data set, and *two* children
1209    /// changed in the external data set when you call
1210    /// [`changed()`][Self::changed()] on the first child, the sort function
1211    /// must only read the new data for the first of the two changed
1212    /// children, otherwise the resorting of the children will be wrong.
1213    ///
1214    /// This generally means that if you don’t fully control the data
1215    /// model, you have to duplicate the data that affects the sorting
1216    /// and filtering functions into the widgets themselves. Another
1217    /// alternative is to call [`FlowBoxExt::invalidate_sort()`][crate::prelude::FlowBoxExt::invalidate_sort()] on any
1218    /// model change, but that is more expensive.
1219    #[doc(alias = "gtk_flow_box_child_changed")]
1220    fn changed(&self) {
1221        unsafe {
1222            ffi::gtk_flow_box_child_changed(self.as_ref().to_glib_none().0);
1223        }
1224    }
1225
1226    /// Gets the current index of the `self` in its [`FlowBox`][crate::FlowBox] container.
1227    ///
1228    /// # Returns
1229    ///
1230    /// the index of the `self`, or -1 if the `self` is not
1231    ///  in a flow box.
1232    #[doc(alias = "gtk_flow_box_child_get_index")]
1233    #[doc(alias = "get_index")]
1234    fn index(&self) -> i32 {
1235        unsafe { ffi::gtk_flow_box_child_get_index(self.as_ref().to_glib_none().0) }
1236    }
1237
1238    /// Returns whether the `self` is currently selected in its
1239    /// [`FlowBox`][crate::FlowBox] container.
1240    ///
1241    /// # Returns
1242    ///
1243    /// [`true`] if `self` is selected
1244    #[doc(alias = "gtk_flow_box_child_is_selected")]
1245    fn is_selected(&self) -> bool {
1246        unsafe {
1247            from_glib(ffi::gtk_flow_box_child_is_selected(
1248                self.as_ref().to_glib_none().0,
1249            ))
1250        }
1251    }
1252
1253    /// The ::activate signal is emitted when the user activates
1254    /// a child widget in a [`FlowBox`][crate::FlowBox], either by clicking or
1255    /// double-clicking, or by using the Space or Enter key.
1256    ///
1257    /// While this signal is used as a
1258    /// [keybinding signal][GtkBindingSignal],
1259    /// it can be used by applications for their own purposes.
1260    #[doc(alias = "activate")]
1261    fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1262        unsafe extern "C" fn activate_trampoline<P: IsA<FlowBoxChild>, F: Fn(&P) + 'static>(
1263            this: *mut ffi::GtkFlowBoxChild,
1264            f: glib::ffi::gpointer,
1265        ) {
1266            let f: &F = &*(f as *const F);
1267            f(FlowBoxChild::from_glib_borrow(this).unsafe_cast_ref())
1268        }
1269        unsafe {
1270            let f: Box_<F> = Box_::new(f);
1271            connect_raw(
1272                self.as_ptr() as *mut _,
1273                b"activate\0".as_ptr() as *const _,
1274                Some(transmute::<_, unsafe extern "C" fn()>(
1275                    activate_trampoline::<Self, F> as *const (),
1276                )),
1277                Box_::into_raw(f),
1278            )
1279        }
1280    }
1281
1282    fn emit_activate(&self) {
1283        self.emit_by_name::<()>("activate", &[]);
1284    }
1285}
1286
1287impl<O: IsA<FlowBoxChild>> FlowBoxChildExt for O {}
1288
1289impl fmt::Display for FlowBoxChild {
1290    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1291        f.write_str("FlowBoxChild")
1292    }
1293}