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