1. -- 
  2. -- Copyright (c) 2012 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. with Events; 
  10.  
  11. pragma Elaborate_All( Events ); 
  12.  
  13. package Events.Application is 
  14.  
  15.     APP_BLUR_ID      : constant Event_Id := To_Event_Id( "App_Blur" ); 
  16.     APP_FOCUS_ID     : constant Event_Id := To_Event_Id( "App_Focus" ); 
  17.     CLOSE_REQUEST_ID : constant Event_Id := To_Event_Id( "Close_Request" ); 
  18.     CLOSE_WINDOW_ID  : constant Event_Id := To_Event_Id( "Close_Window" ); 
  19.  
  20.     -- A notification that the application window has lost focus. 
  21.     type App_Blur_Event is new Event with private; 
  22.  
  23.     -- A notification that the application window has regained focus. 
  24.     type App_Focus_Event is new Event with private; 
  25.  
  26.     -- A command to attempt to close the application. This does not have to be 
  27.     -- obeyed, for instance if the player hasn't saved his game yet. 
  28.     type Close_Request_Event is new Event with private; 
  29.  
  30.     -- A command to close the application, no questions asked. This event is 
  31.     -- queued when it's time for the application to quit. 
  32.     type Close_Window_Event is new Event with private; 
  33.  
  34.     ---------------------------------------------------------------------------- 
  35.  
  36.     -- Queues an App_Blur_Event. 
  37.     procedure Queue_App_Blur; 
  38.  
  39.     -- Queues an App_Focus_Event. 
  40.     procedure Queue_App_Focus; 
  41.  
  42.     -- Queues a Close_Request_Event. 
  43.     procedure Queue_Close_Request; 
  44.  
  45.     -- Queues a Close_Window_Event. 
  46.     procedure Queue_Close_Window; 
  47.  
  48. private 
  49.  
  50.     type App_Blur_Event is new Event with null record; 
  51.  
  52.     procedure Construct( this : access App_Blur_Event ); 
  53.  
  54.     ---------------------------------------------------------------------------- 
  55.  
  56.     type App_Focus_Event is new Event with null record; 
  57.  
  58.     procedure Construct( this : access App_Focus_Event ); 
  59.  
  60.     ---------------------------------------------------------------------------- 
  61.  
  62.     type Close_Request_Event is new Event with null record; 
  63.  
  64.     procedure Construct( this : access Close_Request_Event ); 
  65.  
  66.     ---------------------------------------------------------------------------- 
  67.  
  68.     type Close_Window_Event is new Event with null record; 
  69.  
  70.     procedure Construct( this : access Close_Window_Event ); 
  71.  
  72. end Events.Application;