Package Name: window
-- =============================================================================
-- File : window.ads =
-- Project : AMAF =
-- Version : 1.2.1 =
-- Author : M. A. van der Lugt =
-- =
-- Copyright 1996 Marinus A. van der Lugt =
-- =
-- History : =
-- ----------------------------------------------------------------------------=
-- =============================================================================
-- This class is a base class for all types of windows. User windows should not
-- be derived from this class, but rather from one of its childeren.
-- Ada standard packages
with ada.finalization ;
-- MacOS bindings
with Types ;
with QuickDraw ;
with Windows ;
-- Project packages
with Constants_And_Types ;
with Commands ;
-- =============================================================================
package Window is
-- =============================================================================
package COM renames Commands ;
package CT renames Constants_And_Types ;
type Window is new ada.finalization.limited_controlled with private ;
type Window_Class_Ptr is access Window'class ;
-- Controlling operations
procedure Initialize
(This : in out Window) ;
procedure Finalize
(This : in out Window) ;
procedure Handle_Command
(This : in out Window ;
Command : in COM.Command'class ;
Command_Was_Handled : out boolean) ;
-- Command handler operations
procedure Do_Close (This : in out Window) ;
-- Auxillary operations
procedure Set_Title
(This : in out Window ;
Text : in string) ;
procedure Get_Title
(This : in out Window ;
Text : out string ;
Nof_Characters : out integer) ;
procedure Show
(This : in out Window) ;
procedure Hide
(This : in out Window) ;
procedure Draw
(This : in out Window) ;
procedure Get_Window_Ptr
(This : in out Window ;
Ptr : out Quickdraw.WindowPtr) ;
procedure Erase_Contents
(This : in out Window) ;
procedure Switch_Grafport
(This : in out Window) ;
procedure Restore_Grafport ;
private
type Window is new ada.finalization.limited_controlled with
record
Init_Kind : short_integer := 0 ; -- For init only.
Init_Window_Rectangle : Types.Rect := (0, 0, 0, 0) ; -- For init only.
the_Window_Ptr : Quickdraw.WindowPtr ;
the_Title : CT.String_Ptr ;
Is_Visible : boolean := false ;
end record ;
end Window ;