--------------------------------------------------------------------------------
--                                                                            --
-- Copyright (C) 2004, RISC OS Ada Library (RASCAL) developers.               --
--                                                                            --
-- This library is free software; you can redistribute it and/or              --
-- modify it under the terms of the GNU Lesser General Public                 --
-- License as published by the Free Software Foundation; either               --
-- version 2.1 of the License, or (at your option) any later version.         --
--                                                                            --
-- This library is distributed in the hope that it will be useful,            --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of             --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           --
-- Lesser General Public License for more details.                            --
--                                                                            --
-- You should have received a copy of the GNU Lesser General Public           --
-- License along with this library; if not, write to the Free Software        --
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA    --
--                                                                            --
--------------------------------------------------------------------------------

-- @brief Event definitions for device messages.
-- $Author$
-- $Date$
-- $Revision$

with Interfaces.C;       use Interfaces.C;

with RASCAL.OS;          use RASCAL.OS;

package RASCAL.Device is

   --
   --This message is broadcast by a task wishing to claim exclusive use of a system device.
   --
   type Message_DeviceClaim is
   record
   Header         : Message_Event_Header;
   Major          : Integer;
   Minor          : Integer;
   Information    : Char_Array (1..228);
   end record;
   pragma Convention (C, Message_DeviceClaim);

   type Message_DeviceClaim_Pointer is access Message_DeviceClaim;

   type AMEL_Message_DeviceClaim is abstract new
        Message_EventListener(Message_Event_DeviceClaim) with
   record
   Event : Message_DeviceClaim_Pointer;
   end record;

   --
   -- This message is sent in response to a Message_DeviceClaim, if the receiver does not want the claimant to gain exclusive use of a device (i.e. it's already using it).
   --The information string should be used to give information as to why the claim has failed, e.g. 'Printer is active'.
   --
   type Message_DeviceInUse is
   record
   Header         : Message_Event_Header;
   Major          : Integer;
   Minor          : Integer;
   Information    : Char_Array (1..228);
   end record;
   pragma Convention (C, Message_DeviceInUse);

   type Message_DeviceInUse_Pointer is access Message_DeviceInUse;

   type AMEL_Message_DeviceInUse is abstract new
        Message_EventListener(Message_Event_DeviceInUse) with
   record
   Event : Message_DeviceInUse_Pointer;
   end record;

end RASCAL.Device;
