private with Ada.Containers.Indefinite_Doubly_Linked_Lists;
package Widgets.Containers is
type Container is abstract new Widget with private;
type A_Container is access all Container'Class;
procedure Add( this : access Container;
child : in out A_Widget;
consume : Boolean := True );
pragma Precondition( child /= null );
pragma Postcondition( consume xor child /= null );
procedure Bring_To_Front( this : access Container;
child : not null A_Widget );
procedure Apply_Container_Layout( this : access Container;
child : not null A_Widget );
procedure Delete_Children( this : access Container );
procedure Draw_Content( this : access Container; dc : Drawing_Context ) is abstract;
procedure Remove( this : access Container; child : not null A_Widget );
private
WIDGET_NOT_FOUND : exception;
package Widget_Lists is new Ada.Containers.Indefinite_Doubly_Linked_Lists( A_Widget, "=" );
type Container is abstract new Widget with
record
childbmp : A_Bitmap := null;
children : Widget_Lists.List;
childLayout : A_Layout := null;
drawForeground : Boolean := False;
end record;
procedure Delete( this : in out Container );
procedure Delete_Child( this : access Container; child : in out A_Widget );
pragma Precondition( child /= null );
pragma Postcondition( child = null );
procedure Draw( this : access Container;
bmp : not null A_Bitmap;
x, y : Integer );
procedure Draw_Children( this : access Container;
bmp : not null A_Bitmap );
procedure Find_Widget( this : access Container;
x, y : Integer;
wx, wy : out Integer;
found : out A_Widget );
procedure Handle_Ancestor_Hidden( this : access Container );
procedure Handle_Ancestor_Unhidden( this : access Container );
procedure Handle_Resize( this : access Container );
procedure Pack( this : access Container );
procedure Set_Zoom( this : access Container; zoom : Float );
end Widgets.Containers;