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. --  <c_version>1.3.6</c_version> 
  26. --  <group>Gdk, the low-level API</group> 
  27.  
  28. with Glib; use Glib; 
  29. with Glib.Glist; 
  30. pragma Elaborate_All (Glib.Glist); 
  31.  
  32. with System; 
  33. with Unchecked_Conversion; 
  34.  
  35. package Gdk.Visual is 
  36.  
  37.    subtype Gdk_Visual is Gdk.Gdk_Visual; 
  38.    Null_Visual : constant Gdk_Visual; 
  39.    --  This type is not private because we need the full declaration 
  40.    --  to instanciate Glib.Glist.Generic_List with it. 
  41.  
  42.    type Gdk_Visual_Type is 
  43.      (Visual_Static_Gray, 
  44.       Visual_Grayscale, 
  45.       Visual_Static_Color, 
  46.       Visual_Pseudo_Color, 
  47.       Visual_True_Color, 
  48.       Visual_Direct_Color); 
  49.    pragma Convention (C, Gdk_Visual_Type); 
  50.  
  51.    type Gdk_Visual_Type_Array is array (Natural range <>) of Gdk_Visual_Type; 
  52.  
  53.    function Get_Type return Glib.GType; 
  54.    --  Return the internal value associated with Gdk_Visual. 
  55.  
  56.    function Get_Best_Depth return Gint; 
  57.  
  58.    function Get_Best_Type return Gdk_Visual_Type; 
  59.  
  60.    function Get_System return Gdk_Visual; 
  61.  
  62.    function Get_Best return Gdk_Visual; 
  63.  
  64.    procedure Get_Best (Visual : out Gdk_Visual); 
  65.  
  66.    function Get_Best (Depth  : Gint) return Gdk_Visual; 
  67.  
  68.    function Get_Best (Visual_Type : Gdk_Visual_Type) return Gdk_Visual; 
  69.  
  70.    function Get_Best 
  71.      (Depth       : Gint; 
  72.       Visual_Type : Gdk_Visual_Type) return Gdk_Visual; 
  73.  
  74.    function Query_Depths return Gint_Array; 
  75.  
  76.    function Query_Visual_Types return Gdk_Visual_Type_Array; 
  77.  
  78.    function Convert is new Unchecked_Conversion (Gdk_Visual, System.Address); 
  79.    function Convert is new Unchecked_Conversion (System.Address, Gdk_Visual); 
  80.  
  81.    package Gdk_Visual_List is new Glib.Glist.Generic_List (Gdk_Visual); 
  82.  
  83.    function List_Visuals return Gdk_Visual_List.Glist; 
  84.  
  85. private 
  86.    Null_Visual : constant Gdk_Visual := null; 
  87.    pragma Import (C, Get_Type, "gdk_visual_get_type"); 
  88.    pragma Import (C, Get_Best_Depth, "gdk_visual_get_best_depth"); 
  89.    pragma Import (C, Get_Best_Type, "gdk_visual_get_best_type"); 
  90.    pragma Import (C, Get_System, "gdk_visual_get_system"); 
  91.  
  92. end Gdk.Visual;