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