1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --                Copyright (C) 2000-2001 ACT-Europe                 -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- -- -- -- -- -- -- -- -- -- -- --
  23. ----------------------------------------------------------------------- 
  24.  
  25. --  This package provides low level handling of file descriptors in the 
  26. --  GtkAda event loop. Note that this package is currently not supported 
  27. --  under Windows. 
  28. --  <group>Gdk, the low-level API</group> 
  29.  
  30. with Gdk.Event; 
  31. with Gdk.Types; 
  32. with Gdk.Window; 
  33. with Glib; 
  34.  
  35. package Gdk.Input is 
  36.  
  37.    procedure Init; 
  38.  
  39.    procedure Gdk_Exit; 
  40.  
  41.    procedure Set_Extension_Events 
  42.      (Window : in Gdk.Window.Gdk_Window; 
  43.       Mask   : in Gdk.Event.Gdk_Event_Mask; 
  44.       Mode   : in Gdk.Types.Gdk_Extension_Mode); 
  45.    --  ??? Check that Mask is indeed of type GdkEventMask. 
  46.    --  The C code defines it as Gint... 
  47.  
  48.    generic 
  49.       type Data_Type (<>) is private; 
  50.    package Input_Add is 
  51.  
  52.       type Data_Access is access all Data_Type; 
  53.       pragma Convention (C, Data_Access); 
  54.  
  55.       type Gdk_Input_Function is access procedure 
  56.         (Data      : Data_Access; 
  57.          Source    : Glib.Gint; 
  58.          Condition : Gdk.Types.Gdk_Input_Condition); 
  59.  
  60.       function Add 
  61.         (Source    : Glib.Gint; 
  62.          Condition : Gdk.Types.Gdk_Input_Condition; 
  63.          Func      : Gdk_Input_Function; 
  64.          Data      : Data_Access) return Glib.Gint; 
  65.  
  66.    private 
  67.       pragma Import (C, Add, "gdk_input_add"); 
  68.    end Input_Add; 
  69.  
  70.    procedure Remove (Tag : Glib.Gint); 
  71.  
  72.    --  to bind: gdk_input_motion_events 
  73.    --    This returns the list of past motion events in the window, between two 
  74.    --    times. This might give a finer granularity than getting the 
  75.    --    Motion_Events themselves, and might be more efficient. 
  76.    --    Not supported by all XServers though. 
  77.  
  78. private 
  79.    pragma Import (C, Init, "gdk_input_init"); 
  80.    pragma Import (C, Gdk_Exit, "gdk_input_exit"); 
  81.    pragma Import (C, Set_Extension_Events, "gdk_input_set_extension_events"); 
  82.    pragma Import (C, Remove, "gdk_input_remove"); 
  83. end Gdk.Input;