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. --  The Gdk_Image type represents an area for drawing graphics. 
  31. --  It has now been superceded to a large extent by the much more flexible 
  32. --  Gdk.RGB functions. 
  33. -- 
  34. --  To create an empty Gdk_Image use Gdk_New. To create an image from part of 
  35. --  a Gdk_Window, use Get. 
  36. -- 
  37. --  To draw a Gdk_Image in a Gdk_Window or Gdk_Pixmap use 
  38. --  Gdk.Drawable.Draw_Image. 
  39.  
  40. --  <c_version>1.3.6</c_version> 
  41. --  <group>Gdk, the low-level API</group> 
  42.  
  43. with Glib; use Glib; 
  44.  
  45. package Gdk.Image is 
  46.  
  47.    subtype Gdk_Image is Gdk.Gdk_Image; 
  48.    Null_Image : constant Gdk_Image; 
  49.  
  50.    type Gdk_Image_Type is (Image_Normal, Image_Shared, Image_Fastest); 
  51.    pragma Convention (C, Gdk_Image_Type); 
  52.  
  53.    procedure Gdk_New 
  54.      (Image      : out Gdk_Image; 
  55.       Image_Type : Gdk_Image_Type; 
  56.       Visual     : Gdk.Gdk_Visual; 
  57.       Width      : Gint; 
  58.       Height     : Gint); 
  59.  
  60.    function Get_Type return Glib.GType; 
  61.    --  Return the internal value associated with a Gdk_Image. 
  62.  
  63.    procedure Get 
  64.      (Image    : out Gdk_Image; 
  65.       Drawable : Gdk.Gdk_Drawable; 
  66.       X        : Gint; 
  67.       Y        : Gint; 
  68.       Width    : Gint; 
  69.       Height   : Gint); 
  70.  
  71.    procedure Ref (Image : Gdk_Image); 
  72.    --  Increment the reference counting for the image. 
  73.  
  74.    procedure Unref (Image : Gdk_Image); 
  75.    --  Decrement the reference counting for the image. 
  76.    --  When this reaches 0, the image is destroyed. 
  77.  
  78.    procedure Destroy (Image : Gdk_Image); 
  79.    --  Deprecated. Use Unref instead. 
  80.  
  81.    procedure Put_Pixel 
  82.      (Image : Gdk_Image; 
  83.       X     : Gint; 
  84.       Y     : Gint; 
  85.       Pixel : Guint32); 
  86.  
  87.    function Get_Pixel (Image : Gdk_Image; X : Gint; Y : Gint) return Guint32; 
  88.  
  89. private 
  90.    Null_Image : constant Gdk_Image := null; 
  91.    pragma Import (C, Get_Type, "gdk_image_get_type"); 
  92.    pragma Import (C, Destroy, "gdk_image_unref"); 
  93.    pragma Import (C, Ref, "gdk_image_ref"); 
  94.    pragma Import (C, Unref, "gdk_image_unref"); 
  95.    pragma Import (C, Get_Pixel, "gdk_image_get_pixel"); 
  96.    pragma Import (C, Put_Pixel, "gdk_image_put_pixel"); 
  97. end Gdk.Image;