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. --  <description> 
  26. --  This package provides routines to handle initialization and set up of the 
  27. --  Gdk library. 
  28. --  </description> 
  29. --  <c_version>1.3.6</c_version> 
  30. --  <group>Gdk, the low-level API</group> 
  31.  
  32. with Glib; use Glib; 
  33. with Gdk.Event; 
  34. with Gdk.Types; 
  35.  
  36. package Gdk.Main is 
  37.  
  38.    procedure Init; 
  39.    --  Initialize the library for use. 
  40.    --  The command line arguments are modified to reflect any arguments 
  41.    --  which were not handled. (Such arguments should either 
  42.    --  be handled by the application or dismissed). 
  43.  
  44.    procedure Gdk_Exit (Error_Code : Gint); 
  45.    --  Restore the library to an un-itialized state and exits 
  46.    --  the program using the "exit" system call. 
  47.    --  Error_Code is the error value to pass to "exit". 
  48.    --  Allocated structures are freed and the program exits cleanly. 
  49.    --  This function is deprecated. 
  50.  
  51.    function Get_Display return String; 
  52.    --  Return the name of the display. 
  53.  
  54.    function Pointer_Grab 
  55.      (Window       : Gdk.Gdk_Window; 
  56.       Owner_Events : Boolean := True; 
  57.       Event_Mask   : Gdk.Event.Gdk_Event_Mask; 
  58.       Confine_To   : Gdk.Gdk_Window := null; 
  59.       Cursor       : Gdk.Gdk_Cursor := null; 
  60.       Time         : Guint32 := 0) return Gdk.Types.Gdk_Grab_Status; 
  61.    --  Grab the pointer to a specific window. 
  62.    --    - Window is the window which will receive the grab 
  63.    --    - Owner_Events specifies whether events will be reported as is, 
  64.    --      or relative to Window 
  65.    --    - Event_Mask masks only interesting events 
  66.    --    - Confine_To limits the cursor movement to the specified window 
  67.    --    - Cursor changes the cursor for the duration of the grab 
  68.    --    - Time specifies the time 
  69.    --  Requires a corresponding call to Pointer_Ungrab 
  70.    -- 
  71.    --  This is obsolescent in gtk-3, use Gdk.Device.Grab instead 
  72.  
  73.    procedure Pointer_Ungrab (Time : Guint32 := 0); 
  74.    --  Release any pointer grab. 
  75.  
  76.    function Pointer_Is_Grabbed return Boolean; 
  77.    --  Tell wether there is an active pointer grab in effect. 
  78.  
  79.    function Keyboard_Grab 
  80.      (Window       : Gdk.Gdk_Window; 
  81.       Owner_Events : Boolean := True; 
  82.       Time         : Guint32 := 0) return Gdk.Types.Gdk_Grab_Status; 
  83.    --  Grab the keyboard to a specific window. 
  84.    --    - Window is the window which will receive the grab 
  85.    --    - Owner_Events specifies whether events will be reported as is, 
  86.    --      or relative to Window 
  87.    --    - Time specifies the time 
  88.    --  Requires a corresponding call to Keyboard_Ungrab 
  89.  
  90.    procedure Keyboard_Ungrab (Time : Guint32 := 0); 
  91.    --  Release any keyboard grab. 
  92.  
  93.    function Screen_Width return Gint; 
  94.    --  Return the width of the screen. 
  95.  
  96.    function Screen_Height return Gint; 
  97.    --  Return the height of the screen. 
  98.  
  99.    function Screen_Width_MM return Gint; 
  100.    --  Return the width of the screen in millimeters. 
  101.  
  102.    function Screen_Height_MM return Gint; 
  103.    --  Return the height of the screen in millimeters. 
  104.  
  105.    procedure Flush; 
  106.    --  Flush the queue of graphic events and then wait 
  107.    --  until all requests have been received and processed. 
  108.  
  109.    procedure Beep; 
  110.    --  Emit a beep. 
  111.  
  112.    procedure Set_Double_Click_Time (Msec : Guint); 
  113.  
  114. private 
  115.    pragma Import (C, Gdk_Exit, "gdk_exit"); 
  116.    pragma Import (C, Screen_Width, "gdk_screen_width"); 
  117.    pragma Import (C, Screen_Height, "gdk_screen_height"); 
  118.    pragma Import (C, Screen_Width_MM, "gdk_screen_width_mm"); 
  119.    pragma Import (C, Screen_Height_MM, "gdk_screen_height_mm"); 
  120.    pragma Import (C, Set_Double_Click_Time, "gdk_set_double_click_time"); 
  121.    pragma Import (C, Flush, "gdk_flush"); 
  122.    pragma Import (C, Beep, "gdk_beep"); 
  123.  
  124. end Gdk.Main; 
  125.  
  126. --  missing: 
  127. --  gdk_wcstombs 
  128. --  gdk_mbstowcs