1. -- 
  2. -- Copyright (c) 2013 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 Allegro.Displays;                  use Allegro.Displays; 
  10. with Interfaces;                        use Interfaces; 
  11.  
  12. -- Allegro 5.0.9 - Mouse routines 
  13. package Allegro.Mouse is 
  14.  
  15.     type Allegro_Mouse is limited private; 
  16.     type A_Allegro_Mouse is access all Allegro_Mouse; 
  17.  
  18.     type Axes_Array is array(Integer range <>) of Integer; 
  19.     pragma Convention( C, Axes_Array ); 
  20.  
  21.     type Allegro_Mouse_State is 
  22.         record 
  23.             x, y      : Integer := 0; 
  24.             z, w      : Integer := 0; 
  25.             more_axes : Axes_Array(0..3) := (others => 0); 
  26.             buttons   : Unsigned_32 := 0; 
  27.             pressure  : Float := 0.0; 
  28.             display   : A_Allegro_Display; 
  29.         end record; 
  30.     pragma Convention( C, Allegro_Mouse_State ); 
  31.     type A_Mouse_State is access all Allegro_Mouse_State; 
  32.  
  33.     function Al_Install_Mouse return Boolean; 
  34.  
  35.     procedure Al_Uninstall_Mouse; 
  36.     pragma Import( C, Al_Uninstall_Mouse, "al_uninstall_mouse" ); 
  37.  
  38.     function Al_Is_Mouse_Installed return Boolean; 
  39.  
  40.     function Al_Get_Mouse_Num_Axes return Integer; 
  41.     pragma Import( C, Al_Get_Mouse_Num_Axes, "al_get_mouse_num_axes" ); 
  42.  
  43.     function Al_Get_Mouse_Num_Buttons return Integer; 
  44.     pragma Import( C, Al_Get_Mouse_Num_Buttons, "al_get_mouse_num_buttons" ); 
  45.  
  46.     procedure Al_Get_Mouse_State( ret_state : out Allegro_Mouse_State ); 
  47.     pragma Import( C, Al_Get_Mouse_State, "al_get_mouse_state" ); 
  48.  
  49.     function Al_Get_Mouse_State_Axis( state : Allegro_Mouse_State; axis : Integer ) return Integer; 
  50.     pragma Import( C, Al_Get_Mouse_State_Axis, "al_get_mouse_state_axis" ); 
  51.  
  52.     function Al_Mouse_Button_Down( state : Allegro_Mouse_State; button : Integer ) return Boolean; 
  53.  
  54.     function Al_Set_Mouse_XY( display : A_Allegro_Display; x, y : Integer ) return Boolean; 
  55.  
  56.     function Al_Set_Mouse_Z( z : Integer ) return Boolean; 
  57.  
  58.     function Al_Set_Mouse_W( w : Integer ) return Boolean; 
  59.  
  60.     function Al_Set_Mouse_Axis( axis : Integer; value : Integer ) return Boolean; 
  61.  
  62.     function Al_Get_Mouse_Cursor_Position( ret_x, ret_y : access Integer ) return Boolean; 
  63.  
  64.     function Al_Grab_Mouse( display : A_Allegro_Display ) return Boolean; 
  65.  
  66.     function Al_Ungrab_Mouse return Boolean; 
  67.  
  68.     function Al_Get_Mouse_Event_Source return A_Allegro_Event_Source; 
  69.     pragma Import( C, Al_Get_Mouse_Event_Source, "al_get_mouse_event_source" ); 
  70.  
  71. private 
  72.  
  73.     type Allegro_Mouse is limited null record; 
  74.     pragma Convention( C, Allegro_Mouse ); 
  75.  
  76. end Allegro.Mouse;