1. package Applications.Gui is 
  2.  
  3.     -- An abstract application class with a single window for graphics and 
  4.     -- mouse/keyboard facilities. 
  5.     type Gui_Application is abstract new Application with private; 
  6.     type A_Gui_Application is access all Gui_Application'Class; 
  7.  
  8.     -- Returns the title text at the top of the application's window. 
  9.     function Get_Window_Title( this : not null access Gui_Application'Class ) return String; 
  10.  
  11. private 
  12.  
  13.     type Gui_Application is abstract new Application with 
  14.         record 
  15.             -- the following fields are protected by .lock 
  16.             winTitle    : Unbounded_String;    -- app window title 
  17.             interactive : Boolean := False;    -- application accepts user input 
  18.             use_mouse   : Boolean := False;    -- application uses the mouse 
  19.             xres, yres  : Integer := 0;        -- window resolution 
  20.             scale       : Integer := 1;        -- window scaling factor 
  21.         end record; 
  22.  
  23.     -- Closes the application and releases all resources. Do not call this if 
  24.     -- the application didn't successfully initialize. This should be called 
  25.     -- last by an overriding implementation. 
  26.     procedure Close( this : access Gui_Application ); 
  27.  
  28.     -- Constructs the application object. Constructs the application using 
  29.     -- 'name' as the default window title. To specify the window title, call 
  30.     -- Construct(3) instead. This should be called first by a subclass 
  31.     -- constructor. 
  32.     procedure Construct( this    : access Gui_Application; 
  33.                          company : String; 
  34.                          name    : String ); 
  35.  
  36.     -- Constructs the application object. 'winTitle' is the title at the top of 
  37.     -- the application window, if it's running in windowed mode. This should be 
  38.     -- called first by a subclass constructor. 
  39.     procedure Construct( this     : access Gui_Application; 
  40.                          company  : String; 
  41.                          name     : String; 
  42.                          winTitle : String ); 
  43.  
  44.     -- Initializes the application, setting up graphics and hardware. The 
  45.     -- application will open in 640x400 windowed mode by default. This setting 
  46.     -- can be overridden by the application's configuration. To specify the 
  47.     -- default window parameters, call Init(4) instead. Returns True on success. 
  48.     -- If initialization fails, Close will be called automatically to clean up. 
  49.     -- No exceptions will be raised. This should be called first by an 
  50.     -- overriding implementation. 
  51.     function Init( this : access Gui_Application ) return Boolean; 
  52.  
  53.     -- Initializes the application, setting up graphics and hardware. Returns 
  54.     -- True on success. If initialization fails, Close will be called 
  55.     -- automatically to clean up. No exceptions will be raised. This should be 
  56.     -- called first by an overriding implementation. 
  57.     function Init( this         : access Gui_Application; 
  58.                    app_xres, 
  59.                    app_yres     : Natural; 
  60.                    app_scale    : Positive; 
  61.                    app_windowed : Boolean ) return Boolean; 
  62.  
  63. end Applications.Gui;