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. --  <description> 
  31. -- 
  32. --  Pixmaps are off-screen drawables. They can be drawn upon with the standard 
  33. --  drawing primitives, then copied to another drawable (such as a Gdk_Window) 
  34. --  with Gdk.Drawable.Draw_Drawable. The depth of a pixmap is the number of 
  35. --  bits per pixels. Bitmaps are simply pixmaps with a depth of 1. (That is, 
  36. --  they are monochrome bitmaps - each pixel can be either on or off). 
  37. --  See Gdk.Pixmap for more details on pixmap handling. 
  38. -- 
  39. --  </description> 
  40. --  <c_version>1.3.6</c_version> 
  41. --  <group>Gdk, the low-level API</group> 
  42.  
  43. with Glib; use Glib; 
  44.  
  45. with Gdk.Window; 
  46.  
  47. package Gdk.Bitmap is 
  48.  
  49.    subtype Gdk_Bitmap is Gdk.Gdk_Bitmap; 
  50.    --  A black and white image. 
  51.    --  This type is mainly used as a mask when drawing other colored images. 
  52.    --  Each pixel can have two values, 0 or 1. 
  53.  
  54.    Null_Bitmap : constant Gdk_Bitmap; 
  55.  
  56.    procedure Gdk_New 
  57.      (Bitmap : out Gdk_Bitmap; 
  58.       Window : Gdk.Window.Gdk_Window; 
  59.       Width  : Gint; 
  60.       Height : Gint); 
  61.    --  Create a new bitmap with a given size. 
  62.    --  Window is used to determine default values for the new bitmap. 
  63.    --  Can be eventually null in which case the root window is used. 
  64.    --  Width is the width of the new bitmap in pixels. 
  65.    --  Height is the height of the new bitmap in pixels. 
  66.  
  67.    procedure Ref (Bitmap : Gdk_Bitmap); 
  68.    --  Add a reference to a bitmap. 
  69.  
  70.    procedure Unref (Bitmap : Gdk_Bitmap); 
  71.    --  This is the usual way to destroy a bitmap. The memory is freed when 
  72.    --  there is no more reference 
  73.  
  74.    procedure Create_From_Data 
  75.      (Bitmap : out Gdk_Bitmap; 
  76.       Window : Gdk.Window.Gdk_Window; 
  77.       Data   : String; 
  78.       Width  : Gint; 
  79.       Height : Gint); 
  80.    --  Create a bitmap from data in XBM format. 
  81.    --  Window is used to determine default values for the new bitmap, can be 
  82.    --  null in which case the root window is used. 
  83.    --  Data is the XBM data. 
  84.    --  Width is the width of the new bitmap in pixels. 
  85.    --  Height is the height of the new bitmap in pixels. 
  86.  
  87. private 
  88.    Null_Bitmap : constant Gdk_Bitmap := null; 
  89.    pragma Import (C, Ref, "gdk_drawable_ref"); 
  90.    pragma Import (C, Unref, "gdk_drawable_unref"); 
  91. end Gdk.Bitmap;