private package Widgets.Layouts is
type Layout_Center is new Layout with private;
function Create_Layout_Center( width, height : Natural ) return A_Layout;
pragma Postcondition( Create_Layout_Center'Result /= null );
type Layout_CenterH is new Layout with private;
function Create_Layout_CenterH( width : Natural;
top, bottom : Integer ) return A_Layout;
pragma Postcondition( Create_Layout_CenterH'Result /= null );
type Layout_CenterHY is new Layout with private;
function Create_Layout_CenterHY( width : Natural;
y1, y2 : Integer ) return A_Layout;
pragma Postcondition( Create_Layout_CenterHY'Result /= null );
type Layout_LTRB is new Layout with private;
function Create_Layout_LTRB( left, top, right, bottom : Integer ) return A_Layout;
pragma Postcondition( Create_Layout_LTRB'Result /= null );
type Layout_LTWH is new Layout with private;
function Create_Layout_LTWH( left, top : Integer;
width, height : Natural ) return A_Layout;
pragma Postcondition( Create_Layout_LTWH'Result /= null );
type Layout_XYWH is new Layout with private;
function Create_Layout_XYWH( x, y : Integer;
width, height : Natural ) return A_Layout;
pragma Postcondition( Create_Layout_XYWH'Result /= null );
procedure Delete( this : in out A_Layout );
pragma Postcondition( this = null );
private
type Layout_Center is new Layout with
record
width,
height : Natural := 0;
end record;
type A_Layout_Center is access all Layout_Center'Class;
procedure Apply( this : access Layout_Center; widget : not null A_Widget );
procedure Construct( this : access Layout_Center;
width,
height : Natural );
type Layout_CenterH is new Layout with
record
width : Natural := 0;
top,
bottom : Integer := 0;
end record;
type A_Layout_CenterH is access all Layout_CenterH'Class;
procedure Apply( this : access Layout_CenterH; widget : not null A_Widget );
procedure Construct( this : access Layout_CenterH;
width : Natural;
top,
bottom : Integer );
type Layout_CenterHY is new Layout with
record
width : Natural := 0;
y1, y2 : Integer := 0;
end record;
type A_Layout_CenterHY is access all Layout_CenterHY'Class;
procedure Apply( this : access Layout_CenterHY; widget : not null A_Widget );
procedure Construct( this : access Layout_CenterHY;
width : Natural;
y1, y2 : Integer );
type Layout_LTRB is new Layout with
record
left,
top,
right,
bottom : Integer := 0;
end record;
type A_Layout_LTRB is access all Layout_LTRB'Class;
procedure Apply( this : access Layout_LTRB; widget : not null A_Widget );
procedure Construct( this : access Layout_LTRB;
left,
top,
right,
bottom : Integer );
type Layout_LTWH is new Layout with
record
left,
top : Integer := 0;
width,
height : Natural := 0;
end record;
type A_Layout_LTWH is access all Layout_LTWH'Class;
procedure Apply( this : access Layout_LTWH; widget : not null A_Widget );
procedure Construct( this : access Layout_LTWH;
left,
top : Integer;
width,
height : Natural );
type Layout_XYWH is new Layout with
record
x, y : Integer := 0;
width,
height : Natural := 0;
end record;
type A_Layout_XYWH is access all Layout_XYWH'Class;
procedure Apply( this : access Layout_XYWH; widget : not null A_Widget );
procedure Construct( this : access Layout_XYWH;
x, y : Integer;
width,
height : Natural );
end Widgets.Layouts;