1------------------------------------------------------------------------------
2--                                                                          --
3--      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       --
4--                     Copyright (C) 2000-2015, AdaCore                     --
5--                                                                          --
6-- This library is free software;  you can redistribute it and/or modify it --
7-- under terms of the  GNU General Public License  as published by the Free --
8-- Software  Foundation;  either version 3,  or (at your  option) any later --
9-- version. This library is distributed in the hope that it will be useful, --
10-- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- --
11-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            --
12--                                                                          --
13-- As a special exception under Section 7 of GPL version 3, you are granted --
14-- additional permissions described in the GCC Runtime Library Exception,   --
15-- version 3.1, as published by the Free Software Foundation.               --
16--                                                                          --
17-- You should have received a copy of the GNU General Public License and    --
18-- a copy of the GCC Runtime Library Exception along with this program;     --
19-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
20-- <http://www.gnu.org/licenses/>.                                          --
21--                                                                          --
22------------------------------------------------------------------------------
23
24--  <description>
25--  A GTK+ user interface is constructed by nesting widgets inside widgets.
26--  Container widgets are the inner nodes in the resulting tree of widgets:
27--  they contain other widgets. So, for example, you might have a
28--  Gtk.Window.Gtk_Window containing a Gtk.Frame.Gtk_Frame containing a
29--  Gtk.Label.Gtk_Label. If you wanted an image instead of a textual label
30--  inside the frame, you might replace the Gtk.Label.Gtk_Label widget with a
31--  Gtk.Image.Gtk_Image widget.
32--
33--  There are two major kinds of container widgets in GTK+. Both are
34--  subclasses of the abstract GtkContainer base class.
35--
36--  The first type of container widget has a single child widget and derives
37--  from Gtk.Bin.Gtk_Bin. These containers are decorators, which add some kind
38--  of functionality to the child. For example, a Gtk.Button.Gtk_Button makes
39--  its child into a clickable button; a Gtk.Frame.Gtk_Frame draws a frame
40--  around its child and a Gtk.Window.Gtk_Window places its child widget inside
41--  a top-level window.
42--
43--  The second type of container can have more than one child; its purpose is
44--  to manage layout. This means that these containers assign sizes and
45--  positions to their children. For example, a Gtk.Box.Gtk_Hbox arranges its
46--  children in a horizontal row, and a Gtk.Grid.Gtk_Grid arranges the widgets
47--  it contains in a two-dimensional grid.
48--
49--  # Height for width geometry management
50--
51--  GTK+ uses a height-for-width (and width-for-height) geometry management
52--  system. Height-for-width means that a widget can change how much vertical
53--  space it needs, depending on the amount of horizontal space that it is
54--  given (and similar for width-for-height).
55--
56--  There are some things to keep in mind when implementing container widgets
57--  that make use of GTK+'s height for width geometry management system. First,
58--  it's important to note that a container must prioritize one of its
59--  dimensions, that is to say that a widget or container can only have a
60--  Gtk.Enums.Gtk_Size_Request_Mode that is Gtk.Enums.Height_For_Width or
61--  Gtk.Enums.Width_For_Height. However, every widget and container must be
62--  able to respond to the APIs for both dimensions, i.e. even if a widget has
63--  a request mode that is height-for-width, it is possible that its parent
64--  will request its sizes using the width-for-height APIs.
65--
66--  To ensure that everything works properly, here are some guidelines to
67--  follow when implementing height-for-width (or width-for-height) containers.
68--
69--  Each request mode involves 2 virtual methods. Height-for-width apis run
70--  through Gtk.Widget.Get_Preferred_Width and then through
71--  Gtk.Widget.Get_Preferred_Height_For_Width. When handling requests in the
72--  opposite Gtk.Enums.Gtk_Size_Request_Mode it is important that every widget
73--  request at least enough space to display all of its content at all times.
74--
75--  When Gtk.Widget.Get_Preferred_Height is called on a container that is
76--  height-for-width, the container must return the height for its minimum
77--  width. This is easily achieved by simply calling the reverse apis
78--  implemented for itself as follows:
79--
80--  |[<!-- language="C" --> static void foo_container_get_preferred_height
81--  (GtkWidget *widget, gint *min_height, gint *nat_height) { if
82--  (i_am_in_height_for_width_mode) { gint min_width;
83--
84--  GTK_WIDGET_GET_CLASS (widget)->get_preferred_width (widget, &min_width,
85--  NULL); GTK_WIDGET_GET_CLASS (widget)->get_preferred_height_for_width
86--  (widget, min_width, min_height, nat_height); } else { ... many containers
87--  support both request modes, execute the real width-for-height request here
88--  by returning the collective heights of all widgets that are stacked
89--  vertically (or whatever is appropriate for this container) ... } } ]|
90--
91--  Similarly, when Gtk.Widget.Get_Preferred_Width_For_Height is called for a
92--  container or widget that is height-for-width, it then only needs to return
93--  the base minimum width like so:
94--
95--  |[<!-- language="C" --> static void
96--  foo_container_get_preferred_width_for_height (GtkWidget *widget, gint
97--  for_height, gint *min_width, gint *nat_width) { if
98--  (i_am_in_height_for_width_mode) { GTK_WIDGET_GET_CLASS
99--  (widget)->get_preferred_width (widget, min_width, nat_width); } else { ...
100--  execute the real width-for-height request here based on the required width
101--  of the children collectively if the container were to be allocated the said
102--  height ... } } ]|
103--
104--  Height for width requests are generally implemented in terms of a virtual
105--  allocation of widgets in the input orientation. Assuming an
106--  height-for-width request mode, a container would implement the
107--  get_preferred_height_for_width virtual function by first calling
108--  Gtk.Widget.Get_Preferred_Width for each of its children.
109--
110--  For each potential group of children that are lined up horizontally, the
111--  values returned by Gtk.Widget.Get_Preferred_Width should be collected in an
112--  array of Gtk_Requested_Size structures. Any child spacing should be removed
113--  from the input For_Width and then the collective size should be allocated
114--  using the gtk_distribute_natural_allocation convenience function.
115--
116--  The container will then move on to request the preferred height for each
117--  child by using Gtk.Widget.Get_Preferred_Height_For_Width and using the
118--  sizes stored in the Gtk_Requested_Size array.
119--
120--  To allocate a height-for-width container, it's again important to consider
121--  that a container must prioritize one dimension over the other. So if a
122--  container is a height-for-width container it must first allocate all
123--  widgets horizontally using a Gtk_Requested_Size array and
124--  gtk_distribute_natural_allocation and then add any extra space (if and
125--  where appropriate) for the widget to expand.
126--
127--  After adding all the expand space, the container assumes it was allocated
128--  sufficient height to fit all of its content. At this time, the container
129--  must use the total horizontal sizes of each widget to request the
130--  height-for-width of each of its children and store the requests in a
131--  Gtk_Requested_Size array for any widgets that stack vertically (for tabular
132--  containers this can be generalized into the heights and widths of rows and
133--  columns). The vertical space must then again be distributed using
134--  gtk_distribute_natural_allocation while this time considering the allocated
135--  height of the widget minus any vertical spacing that the container adds.
136--  Then vertical expand space should be added where appropriate and available
137--  and the container should go on to actually allocating the child widgets.
138--
139--  See [GtkWidget's geometry management section][geometry-management] to
140--  learn more about implementing height-for-width geometry management for
141--  widgets.
142--
143--  # Child properties
144--
145--  GtkContainer introduces child properties. These are object properties that
146--  are not specific to either the container or the contained widget, but
147--  rather to their relation. Typical examples of child properties are the
148--  position or pack-type of a widget which is contained in a Gtk.Box.Gtk_Box.
149--
150--  Use gtk_container_class_install_child_property to install child properties
151--  for a container class and gtk_container_class_find_child_property or
152--  gtk_container_class_list_child_properties to get information about existing
153--  child properties.
154--
155--  To set the value of a child property, use
156--  Gtk.Container.Child_Set_Property, gtk_container_child_set or
157--  gtk_container_child_set_valist. To obtain the value of a child property,
158--  use Gtk.Container.Child_Get_Property, gtk_container_child_get or
159--  gtk_container_child_get_valist. To emit notification about child property
160--  changes, use Gtk.Widget.Child_Notify.
161--
162--  # GtkContainer as GtkBuildable
163--
164--  The GtkContainer implementation of the GtkBuildable interface supports a
165--  <packing> element for children, which can contain multiple <property>
166--  elements that specify child properties for the child.
167--
168--  An example of child properties in UI definitions: |[ <object
169--  class="GtkVBox"> <child> <object class="GtkLabel"/> <packing> <property
170--  name="pack-type">start</property> </packing> </child> </object> ]|
171--
172--  Since 2.16, child properties can also be marked as translatable using the
173--  same "translatable", "comments" and "context" attributes that are used for
174--  regular properties.
175--
176--  </description>
177pragma Ada_2005;
178
179pragma Warnings (Off, "*is already use-visible*");
180with Cairo;           use Cairo;
181with Glib;            use Glib;
182with Glib.Object;     use Glib.Object;
183with Glib.Properties; use Glib.Properties;
184with Glib.Types;      use Glib.Types;
185with Glib.Values;     use Glib.Values;
186with Gtk.Adjustment;  use Gtk.Adjustment;
187with Gtk.Buildable;   use Gtk.Buildable;
188with Gtk.Enums;       use Gtk.Enums;
189with Gtk.Widget;      use Gtk.Widget;
190
191package Gtk.Container is
192
193   type Gtk_Container_Record is new Gtk_Widget_Record with null record;
194   type Gtk_Container is access all Gtk_Container_Record'Class;
195
196   ---------------
197   -- Callbacks --
198   ---------------
199
200   type Gtk_Callback is access procedure
201     (Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class);
202   --  The type of the callback functions used for e.g. iterating over the
203   --  children of a container, see gtk_container_foreach.
204   --  "widget": the widget to operate on
205
206   ------------------
207   -- Constructors --
208   ------------------
209
210   function Get_Type return Glib.GType;
211   pragma Import (C, Get_Type, "gtk_container_get_type");
212
213   -------------
214   -- Methods --
215   -------------
216
217   procedure Add
218      (Container : not null access Gtk_Container_Record;
219       Widget    : not null access Gtk.Widget.Gtk_Widget_Record'Class);
220   --  Adds Widget to Container. Typically used for simple containers such as
221   --  Gtk.Window.Gtk_Window, Gtk.Frame.Gtk_Frame, or Gtk.Button.Gtk_Button;
222   --  for more complicated layout containers such as Gtk.Box.Gtk_Box or
223   --  Gtk.Grid.Gtk_Grid, this function will pick default packing parameters
224   --  that may not be correct. So consider functions such as
225   --  Gtk.Box.Pack_Start and Gtk.Grid.Attach as an alternative to
226   --  Gtk.Container.Add in those cases. A widget may be added to only one
227   --  container at a time; you can't place the same widget inside two
228   --  different containers.
229   --  Note that some containers, such as
230   --  Gtk.Scrolled_Window.Gtk_Scrolled_Window or Gtk.List_Box.Gtk_List_Box,
231   --  may add intermediate children between the added widget and the
232   --  container.
233   --  "widget": a widget to be placed inside Container
234
235   procedure Check_Resize (Container : not null access Gtk_Container_Record);
236
237   procedure Child_Get_Property
238      (Container     : not null access Gtk_Container_Record;
239       Child         : not null access Gtk.Widget.Gtk_Widget_Record'Class;
240       Property_Name : UTF8_String;
241       Value         : in out Glib.Values.GValue);
242   --  Gets the value of a child property for Child and Container.
243   --  "child": a widget which is a child of Container
244   --  "property_name": the name of the property to get
245   --  "value": a location to return the value
246
247   procedure Child_Set_Property
248      (Container     : not null access Gtk_Container_Record;
249       Child         : not null access Gtk.Widget.Gtk_Widget_Record'Class;
250       Property_Name : UTF8_String;
251       Value         : Glib.Values.GValue);
252   --  Sets a child property for Child and Container.
253   --  "child": a widget which is a child of Container
254   --  "property_name": the name of the property to set
255   --  "value": the value to set the property to
256
257   procedure Child_Notify
258      (Container      : not null access Gtk_Container_Record;
259       Child          : not null access Gtk.Widget.Gtk_Widget_Record'Class;
260       Child_Property : UTF8_String);
261   --  Emits a Gtk.Widget.Gtk_Widget::child-notify signal for the [child
262   --  property][child-properties] Child_Property on widget.
263   --  This is an analogue of g_object_notify for child properties.
264   --  Also see Gtk.Widget.Child_Notify.
265   --  Since: gtk+ 3.2
266   --  "child": the child widget
267   --  "child_property": the name of a child property installed on the class
268   --  of Container
269
270   function Child_Type
271      (Container : not null access Gtk_Container_Record) return GType;
272   --  Returns the type of the children supported by the container.
273   --  Note that this may return G_TYPE_NONE to indicate that no more children
274   --  can be added, e.g. for a Gtk.Paned.Gtk_Paned which already has two
275   --  children.
276
277   procedure Forall
278      (Container : not null access Gtk_Container_Record;
279       Callback  : Gtk_Callback);
280   --  Invokes Callback on each child of Container, including children that
281   --  are considered "internal" (implementation details of the container).
282   --  "Internal" children generally weren't added by the user of the
283   --  container, but were added by the container implementation itself. Most
284   --  applications should use Gtk.Container.Foreach, rather than
285   --  Gtk.Container.Forall.
286   --  "callback": a callback
287
288   generic
289      type User_Data_Type (<>) is private;
290      with procedure Destroy (Data : in out User_Data_Type) is null;
291   package Forall_User_Data is
292
293      type Gtk_Callback is access procedure
294        (Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class;
295         Data   : User_Data_Type);
296      --  The type of the callback functions used for e.g. iterating over the
297      --  children of a container, see gtk_container_foreach.
298      --  "widget": the widget to operate on
299      --  "data": user-supplied data
300
301      procedure Forall
302         (Container     : not null access Gtk.Container.Gtk_Container_Record'Class;
303          Callback      : Gtk_Callback;
304          Callback_Data : User_Data_Type);
305      --  Invokes Callback on each child of Container, including children that
306      --  are considered "internal" (implementation details of the container).
307      --  "Internal" children generally weren't added by the user of the
308      --  container, but were added by the container implementation itself.
309      --  Most applications should use Gtk.Container.Foreach, rather than
310      --  Gtk.Container.Forall.
311      --  "callback": a callback
312      --  "callback_data": callback user data
313
314   end Forall_User_Data;
315
316   procedure Foreach
317      (Container : not null access Gtk_Container_Record;
318       Callback  : Gtk_Callback);
319   --  Invokes Callback on each non-internal child of Container. See
320   --  Gtk.Container.Forall for details on what constitutes an "internal"
321   --  child. Most applications should use Gtk.Container.Foreach, rather than
322   --  Gtk.Container.Forall.
323   --  "callback": a callback
324
325   generic
326      type User_Data_Type (<>) is private;
327      with procedure Destroy (Data : in out User_Data_Type) is null;
328   package Foreach_User_Data is
329
330      type Gtk_Callback is access procedure
331        (Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class;
332         Data   : User_Data_Type);
333      --  The type of the callback functions used for e.g. iterating over the
334      --  children of a container, see Gtk.Container.Foreach.
335      --  "widget": the widget to operate on
336      --  "data": user-supplied data
337
338      procedure Foreach
339         (Container     : not null access Gtk.Container.Gtk_Container_Record'Class;
340          Callback      : Gtk_Callback;
341          Callback_Data : User_Data_Type);
342      --  Invokes Callback on each non-internal child of Container. See
343      --  Gtk.Container.Forall for details on what constitutes an "internal"
344      --  child. Most applications should use Gtk.Container.Foreach, rather
345      --  than Gtk.Container.Forall.
346      --  "callback": a callback
347      --  "callback_data": callback user data
348
349   end Foreach_User_Data;
350
351   function Get_Border_Width
352      (Container : not null access Gtk_Container_Record) return Guint;
353   --  Retrieves the border width of the container. See
354   --  Gtk.Container.Set_Border_Width.
355
356   procedure Set_Border_Width
357      (Container    : not null access Gtk_Container_Record;
358       Border_Width : Guint);
359   --  Sets the border width of the container.
360   --  The border width of a container is the amount of space to leave around
361   --  the outside of the container. The only exception to this is
362   --  Gtk.Window.Gtk_Window; because toplevel windows can't leave space
363   --  outside, they leave the space inside. The border is added on all sides
364   --  of the container. To add space to only one side, use a specific
365   --  Gtk.Widget.Gtk_Widget:margin property on the child widget, for example
366   --  Gtk.Widget.Gtk_Widget:margin-top.
367   --  "border_width": amount of blank space to leave outside the container.
368   --  Valid values are in the range 0-65535 pixels.
369
370   function Get_Children
371      (Container : not null access Gtk_Container_Record)
372       return Gtk.Widget.Widget_List.Glist;
373   --  Returns the container's non-internal children. See Gtk.Container.Forall
374   --  for details on what constitutes an "internal" child.
375
376   function Get_Focus_Child
377      (Container : not null access Gtk_Container_Record)
378       return Gtk.Widget.Gtk_Widget;
379   --  Returns the current focus child widget inside Container. This is not
380   --  the currently focused widget. That can be obtained by calling
381   --  Gtk.Window.Get_Focus.
382   --  Since: gtk+ 2.14
383
384   procedure Set_Focus_Child
385      (Container : not null access Gtk_Container_Record;
386       Child     : access Gtk.Widget.Gtk_Widget_Record'Class);
387   --  Sets, or unsets if Child is null, the focused child of Container.
388   --  This function emits the GtkContainer::set_focus_child signal of
389   --  Container. Implementations of Gtk.Container.Gtk_Container can override
390   --  the default behaviour by overriding the class closure of this signal.
391   --  This is function is mostly meant to be used by widgets. Applications
392   --  can use Gtk.Widget.Grab_Focus to manualy set the focus to a specific
393   --  widget.
394   --  "child": a Gtk.Widget.Gtk_Widget, or null
395
396   function Get_Focus_Hadjustment
397      (Container : not null access Gtk_Container_Record)
398       return Gtk.Adjustment.Gtk_Adjustment;
399   --  Retrieves the horizontal focus adjustment for the container. See
400   --  gtk_container_set_focus_hadjustment ().
401
402   procedure Set_Focus_Hadjustment
403      (Container  : not null access Gtk_Container_Record;
404       Adjustment : not null access Gtk.Adjustment.Gtk_Adjustment_Record'Class);
405   --  Hooks up an adjustment to focus handling in a container, so when a
406   --  child of the container is focused, the adjustment is scrolled to show
407   --  that widget. This function sets the horizontal alignment. See
408   --  Gtk.Scrolled_Window.Get_Hadjustment for a typical way of obtaining the
409   --  adjustment and Gtk.Container.Set_Focus_Vadjustment for setting the
410   --  vertical adjustment.
411   --  The adjustments have to be in pixel units and in the same coordinate
412   --  system as the allocation for immediate children of the container.
413   --  "adjustment": an adjustment which should be adjusted when the focus is
414   --  moved among the descendents of Container
415
416   function Get_Focus_Vadjustment
417      (Container : not null access Gtk_Container_Record)
418       return Gtk.Adjustment.Gtk_Adjustment;
419   --  Retrieves the vertical focus adjustment for the container. See
420   --  Gtk.Container.Set_Focus_Vadjustment.
421
422   procedure Set_Focus_Vadjustment
423      (Container  : not null access Gtk_Container_Record;
424       Adjustment : not null access Gtk.Adjustment.Gtk_Adjustment_Record'Class);
425   --  Hooks up an adjustment to focus handling in a container, so when a
426   --  child of the container is focused, the adjustment is scrolled to show
427   --  that widget. This function sets the vertical alignment. See
428   --  Gtk.Scrolled_Window.Get_Vadjustment for a typical way of obtaining the
429   --  adjustment and Gtk.Container.Set_Focus_Hadjustment for setting the
430   --  horizontal adjustment.
431   --  The adjustments have to be in pixel units and in the same coordinate
432   --  system as the allocation for immediate children of the container.
433   --  "adjustment": an adjustment which should be adjusted when the focus is
434   --  moved among the descendents of Container
435
436   function Get_Path_For_Child
437      (Container : not null access Gtk_Container_Record;
438       Child     : not null access Gtk.Widget.Gtk_Widget_Record'Class)
439       return Gtk.Widget.Gtk_Widget_Path;
440   --  Returns a newly created widget path representing all the widget
441   --  hierarchy from the toplevel down to and including Child.
442   --  "child": a child of Container
443
444   function Get_Resize_Mode
445      (Container : not null access Gtk_Container_Record)
446       return Gtk.Enums.Gtk_Resize_Mode;
447   pragma Obsolescent (Get_Resize_Mode);
448   --  Returns the resize mode for the container. See
449   --  gtk_container_set_resize_mode ().
450   --  Deprecated since 3.12, 1
451
452   procedure Set_Resize_Mode
453      (Container   : not null access Gtk_Container_Record;
454       Resize_Mode : Gtk.Enums.Gtk_Resize_Mode);
455   pragma Obsolescent (Set_Resize_Mode);
456   --  Sets the resize mode for the container.
457   --  The resize mode of a container determines whether a resize request will
458   --  be passed to the container's parent, queued for later execution or
459   --  executed immediately.
460   --  Deprecated since 3.12, 1
461   --  "resize_mode": the new resize mode
462
463   procedure Propagate_Draw
464      (Container : not null access Gtk_Container_Record;
465       Child     : not null access Gtk.Widget.Gtk_Widget_Record'Class;
466       Cr        : Cairo.Cairo_Context);
467   --  When a container receives a call to the draw function, it must send
468   --  synthetic Gtk.Widget.Gtk_Widget::draw calls to all children that don't
469   --  have their own Gdk_Windows. This function provides a convenient way of
470   --  doing this. A container, when it receives a call to its
471   --  Gtk.Widget.Gtk_Widget::draw function, calls Gtk.Container.Propagate_Draw
472   --  once for each child, passing in the Cr the container received.
473   --  Gtk.Container.Propagate_Draw takes care of translating the origin of
474   --  Cr, and deciding whether the draw needs to be sent to the child. It is a
475   --  convenient and optimized way of getting the same effect as calling
476   --  Gtk.Widget.Draw on the child directly.
477   --  In most cases, a container can simply either inherit the
478   --  Gtk.Widget.Gtk_Widget::draw implementation from
479   --  Gtk.Container.Gtk_Container, or do some drawing and then chain to the
480   --  ::draw implementation from Gtk.Container.Gtk_Container.
481   --  "child": a child of Container
482   --  "cr": Cairo context as passed to the container. If you want to use Cr
483   --  in container's draw function, consider using cairo_save and
484   --  cairo_restore before calling this function.
485
486   procedure Remove
487      (Container : not null access Gtk_Container_Record;
488       Widget    : not null access Gtk.Widget.Gtk_Widget_Record'Class);
489   --  Removes Widget from Container. Widget must be inside Container. Note
490   --  that Container will own a reference to Widget, and that this may be the
491   --  last reference held; so removing a widget from its container can destroy
492   --  that widget. If you want to use Widget again, you need to add a
493   --  reference to it while it's not inside a container, using g_object_ref.
494   --  If you don't want to use Widget again it's usually more efficient to
495   --  simply destroy it directly using Gtk.Widget.Destroy since this will
496   --  remove it from the container and help break any circular reference count
497   --  cycles.
498   --  "widget": a current child of Container
499
500   procedure Resize_Children
501      (Container : not null access Gtk_Container_Record);
502   pragma Obsolescent (Resize_Children);
503   --  Deprecated since 3.10, 1
504
505   procedure Set_Focus_Chain
506      (Container         : not null access Gtk_Container_Record;
507       Focusable_Widgets : Gtk.Widget.Widget_List.Glist);
508   --  Sets a focus chain, overriding the one computed automatically by GTK+.
509   --  In principle each widget in the chain should be a descendant of the
510   --  container, but this is not enforced by this method, since it's allowed
511   --  to set the focus chain before you pack the widgets, or have a widget in
512   --  the chain that isn't always packed. The necessary checks are done when
513   --  the focus chain is actually traversed.
514   --  "focusable_widgets": the new focus chain
515
516   procedure Set_Reallocate_Redraws
517      (Container     : not null access Gtk_Container_Record;
518       Needs_Redraws : Boolean);
519   pragma Obsolescent (Set_Reallocate_Redraws);
520   --  Sets the Reallocate_Redraws flag of the container to the given value.
521   --  Containers requesting reallocation redraws get automatically redrawn if
522   --  any of their children changed allocation.
523   --  Deprecated since 3.14, 1
524   --  "needs_redraws": the new value for the container's Reallocate_Redraws
525   --  flag
526
527   procedure Unset_Focus_Chain
528      (Container : not null access Gtk_Container_Record);
529   --  Removes a focus chain explicitly set with
530   --  Gtk.Container.Set_Focus_Chain.
531
532   ----------------
533   -- Properties --
534   ----------------
535   --  The following properties are defined for this widget. See
536   --  Glib.Properties for more information on properties)
537
538   Border_Width_Property : constant Glib.Properties.Property_Uint;
539
540   Child_Property : constant Glib.Properties.Property_Object;
541   --  Type: Gtk.Widget.Gtk_Widget
542   --  Flags: write
543
544   Resize_Mode_Property : constant Gtk.Enums.Property_Gtk_Resize_Mode;
545
546   -------------
547   -- Signals --
548   -------------
549
550   type Cb_Gtk_Container_Gtk_Widget_Void is not null access procedure
551     (Self   : access Gtk_Container_Record'Class;
552      Object : not null access Gtk.Widget.Gtk_Widget_Record'Class);
553
554   type Cb_GObject_Gtk_Widget_Void is not null access procedure
555     (Self   : access Glib.Object.GObject_Record'Class;
556      Object : not null access Gtk.Widget.Gtk_Widget_Record'Class);
557
558   Signal_Add : constant Glib.Signal_Name := "add";
559   procedure On_Add
560      (Self  : not null access Gtk_Container_Record;
561       Call  : Cb_Gtk_Container_Gtk_Widget_Void;
562       After : Boolean := False);
563   procedure On_Add
564      (Self  : not null access Gtk_Container_Record;
565       Call  : Cb_GObject_Gtk_Widget_Void;
566       Slot  : not null access Glib.Object.GObject_Record'Class;
567       After : Boolean := False);
568
569   type Cb_Gtk_Container_Void is not null access procedure (Self : access Gtk_Container_Record'Class);
570
571   type Cb_GObject_Void is not null access procedure
572     (Self : access Glib.Object.GObject_Record'Class);
573
574   Signal_Check_Resize : constant Glib.Signal_Name := "check-resize";
575   procedure On_Check_Resize
576      (Self  : not null access Gtk_Container_Record;
577       Call  : Cb_Gtk_Container_Void;
578       After : Boolean := False);
579   procedure On_Check_Resize
580      (Self  : not null access Gtk_Container_Record;
581       Call  : Cb_GObject_Void;
582       Slot  : not null access Glib.Object.GObject_Record'Class;
583       After : Boolean := False);
584
585   Signal_Remove : constant Glib.Signal_Name := "remove";
586   procedure On_Remove
587      (Self  : not null access Gtk_Container_Record;
588       Call  : Cb_Gtk_Container_Gtk_Widget_Void;
589       After : Boolean := False);
590   procedure On_Remove
591      (Self  : not null access Gtk_Container_Record;
592       Call  : Cb_GObject_Gtk_Widget_Void;
593       Slot  : not null access Glib.Object.GObject_Record'Class;
594       After : Boolean := False);
595
596   Signal_Set_Focus_Child : constant Glib.Signal_Name := "set-focus-child";
597   procedure On_Set_Focus_Child
598      (Self  : not null access Gtk_Container_Record;
599       Call  : Cb_Gtk_Container_Gtk_Widget_Void;
600       After : Boolean := False);
601   procedure On_Set_Focus_Child
602      (Self  : not null access Gtk_Container_Record;
603       Call  : Cb_GObject_Gtk_Widget_Void;
604       Slot  : not null access Glib.Object.GObject_Record'Class;
605       After : Boolean := False);
606
607   ----------------
608   -- Interfaces --
609   ----------------
610   --  This class implements several interfaces. See Glib.Types
611   --
612   --  - "Buildable"
613
614   package Implements_Gtk_Buildable is new Glib.Types.Implements
615     (Gtk.Buildable.Gtk_Buildable, Gtk_Container_Record, Gtk_Container);
616   function "+"
617     (Widget : access Gtk_Container_Record'Class)
618   return Gtk.Buildable.Gtk_Buildable
619   renames Implements_Gtk_Buildable.To_Interface;
620   function "-"
621     (Interf : Gtk.Buildable.Gtk_Buildable)
622   return Gtk_Container
623   renames Implements_Gtk_Buildable.To_Object;
624
625private
626   Resize_Mode_Property : constant Gtk.Enums.Property_Gtk_Resize_Mode :=
627     Gtk.Enums.Build ("resize-mode");
628   Child_Property : constant Glib.Properties.Property_Object :=
629     Glib.Properties.Build ("child");
630   Border_Width_Property : constant Glib.Properties.Property_Uint :=
631     Glib.Properties.Build ("border-width");
632end Gtk.Container;
633