Package Name: commands

Return to: Package List


-- =============================================================================
-- File    : commands.ads                                                      =
-- Project : AMAF                                                              =
-- Version : 1.2.1                                                             =
-- Author  : M. A. van der Lugt                                                =
--                                                                             =
-- Copyright 1996 Marinus A. van der Lugt                                      =
--                                                                             =
-- History :                                                                   =
-- ----------------------------------------------------------------------------=


-- =============================================================================

-- Standard Ada packages


with unchecked_deallocation ;

-- MacOS packages
with Quickdraw ;
with Events ;


with Types ;
-- =============================================================================
package Commands is


-- =============================================================================
type Command_Type is
  (None,            -- Command
   Quit,            -- Command
   Close,           -- Window_Command
   New_Window,      -- Command
   Key_Down,        -- Key_Command
   Mouse_Moved,     -- Event_Command
   Suspend,         -- Command
   Resume,          -- Command
   Update_Window,   -- Window_Command
   Zoom_In,         -- Window_Command
   Zoom_Out,        -- Window_Command
   Grow_Window,     -- Grow_Window_Command


   Resize_Window) ; -- Resize_Window_Command
type Command is tagged
   record
      Kind     : Command_Type ;

   end record ;
type Window_Command is new Command with
   record
      Window_ID : Quickdraw.WindowPtr ;

   end record ;
type Key_Command is new Command with
   record
      Key                        : character ;
      Right_Control_Key_Is_Down  : boolean ;
      Right_Option_Key_Is_Down   : boolean ;
      Right_Shift_Key_Is_Down    : boolean ;
      Control_Key_Is_Down        : boolean ;
      Option_Key_Is_Down         : boolean ;
      Caps_Lock_Key_Is_Down      : boolean ;
      Shift_Key_Is_Down          : boolean ;
      Command_Key_Is_Down        : boolean ;
      Mouse_Down_Is_Down         : boolean ;
      Window_Is_Active           : boolean ;

   end record ;
type Event_Command is new Command with
   record
      theEvent : Events.EventRecord ;

   end record ;
type Grow_Window_Command is new Window_Command with
   record
      Start_Point : Types.Point ;

   end record ;
type Resize_Window_Command is new Window_Command with
   record
      Old_portRect : Types.Rect ;

   end record ;

type Command_Class_Ptr is access Command'class ;
procedure Free is new unchecked_deallocation


  (Command'class, Command_Class_Ptr) ;
end Commands ;