1. ------------------------------------------------------------------------------ 
  2. --                  GtkAda - Ada95 binding for Gtk+/Gnome                   -- 
  3. --                                                                          -- 
  4. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  5. --                     Copyright (C) 1998-2014, AdaCore                     -- 
  6. --                                                                          -- 
  7. -- This library is free software;  you can redistribute it and/or modify it -- 
  8. -- under terms of the  GNU General Public License  as published by the Free -- 
  9. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  10. -- version. This library is distributed in the hope that it will be useful, -- 
  11. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  12. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  13. --                                                                          -- 
  14. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  15. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  16. -- version 3.1, as published by the Free Software Foundation.               -- 
  17. --                                                                          -- 
  18. -- You should have received a copy of the GNU General Public License and    -- 
  19. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  20. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  21. -- <http://www.gnu.org/licenses/>.                                          -- 
  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 Glib; 
  33.  
  34. package Gdk.Input is 
  35.  
  36.    procedure Init; 
  37.  
  38.    procedure Gdk_Exit; 
  39.  
  40.    procedure Set_Extension_Events 
  41.      (Window : in Gdk.Gdk_Window; 
  42.       Mask   : in Gdk.Event.Gdk_Event_Mask; 
  43.       Mode   : in Gdk.Types.Gdk_Extension_Mode); 
  44.    --  ??? Check that Mask is indeed of type GdkEventMask. 
  45.    --  The C code defines it as Gint... 
  46.  
  47.    generic 
  48.       type Data_Type (<>) is private; 
  49.    package Input_Add is 
  50.  
  51.       type Data_Access is access all Data_Type; 
  52.       pragma Convention (C, Data_Access); 
  53.  
  54.       type Gdk_Input_Function is access procedure 
  55.         (Data      : Data_Access; 
  56.          Source    : Glib.Gint; 
  57.          Condition : Gdk.Types.Gdk_Input_Condition); 
  58.  
  59.       function Add 
  60.         (Source    : Glib.Gint; 
  61.          Condition : Gdk.Types.Gdk_Input_Condition; 
  62.          Func      : Gdk_Input_Function; 
  63.          Data      : Data_Access) return Glib.Gint; 
  64.  
  65.    private 
  66.       pragma Import (C, Add, "gdk_input_add"); 
  67.    end Input_Add; 
  68.  
  69.    procedure Remove (Tag : Glib.Gint); 
  70.  
  71.    --  to bind: gdk_input_motion_events 
  72.    --    This returns the list of past motion events in the window, between two 
  73.    --    times. This might give a finer granularity than getting the 
  74.    --    Motion_Events themselves, and might be more efficient. 
  75.    --    Not supported by all XServers though. 
  76.  
  77. private 
  78.    pragma Import (C, Init, "gdk_input_init"); 
  79.    pragma Import (C, Gdk_Exit, "gdk_input_exit"); 
  80.    pragma Import (C, Set_Extension_Events, "gdk_input_set_extension_events"); 
  81.    pragma Import (C, Remove, "gdk_input_remove"); 
  82. end Gdk.Input;