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. -- As a special exception, if other files instantiate generics from  -- 
  23. -- this unit, or you link this unit with other files to produce an   -- 
  24. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  25. -- executable to be covered by the GNU General Public License. This  -- 
  26. -- exception does not however invalidate any other reasons why the   -- 
  27. -- executable file  might be covered by the  GNU Public License.     -- 
  28. ----------------------------------------------------------------------- 
  29.  
  30. --  This package provides low level handling of file descriptors in the 
  31. --  GtkAda event loop. Note that this package is currently not supported 
  32. --  under Windows. 
  33. --  <group>Gdk, the low-level API</group> 
  34.  
  35. with Gdk.Event; 
  36. with Gdk.Types; 
  37. with Gdk.Window; 
  38. with Glib; 
  39.  
  40. package Gdk.Input is 
  41.  
  42.    procedure Init; 
  43.  
  44.    procedure Gdk_Exit; 
  45.  
  46.    procedure Set_Extension_Events 
  47.      (Window : in Gdk.Window.Gdk_Window; 
  48.       Mask   : in Gdk.Event.Gdk_Event_Mask; 
  49.       Mode   : in Gdk.Types.Gdk_Extension_Mode); 
  50.    --  ??? Check that Mask is indeed of type GdkEventMask. 
  51.    --  The C code defines it as Gint... 
  52.  
  53.    generic 
  54.       type Data_Type (<>) is private; 
  55.    package Input_Add is 
  56.  
  57.       type Data_Access is access all Data_Type; 
  58.       pragma Convention (C, Data_Access); 
  59.  
  60.       type Gdk_Input_Function is access procedure 
  61.         (Data      : Data_Access; 
  62.          Source    : Glib.Gint; 
  63.          Condition : Gdk.Types.Gdk_Input_Condition); 
  64.  
  65.       function Add 
  66.         (Source    : Glib.Gint; 
  67.          Condition : Gdk.Types.Gdk_Input_Condition; 
  68.          Func      : Gdk_Input_Function; 
  69.          Data      : Data_Access) return Glib.Gint; 
  70.  
  71.    private 
  72.       pragma Import (C, Add, "gdk_input_add"); 
  73.    end Input_Add; 
  74.  
  75.    procedure Remove (Tag : Glib.Gint); 
  76.  
  77.    --  to bind: gdk_input_motion_events 
  78.    --    This returns the list of past motion events in the window, between two 
  79.    --    times. This might give a finer granularity than getting the 
  80.    --    Motion_Events themselves, and might be more efficient. 
  81.    --    Not supported by all XServers though. 
  82.  
  83. private 
  84.    pragma Import (C, Init, "gdk_input_init"); 
  85.    pragma Import (C, Gdk_Exit, "gdk_input_exit"); 
  86.    pragma Import (C, Set_Extension_Events, "gdk_input_set_extension_events"); 
  87.    pragma Import (C, Remove, "gdk_input_remove"); 
  88. end Gdk.Input;