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. -- -- -- -- -- -- -- -- -- -- -- --
  23. ----------------------------------------------------------------------- 
  24.  
  25. --  <description> 
  26. -- 
  27. --  Pixmaps are off-screen drawables. They can be drawn upon with the standard 
  28. --  drawing primitives, then copied to another drawable (such as a Gdk_Window) 
  29. --  with Gdk.Drawable.Draw_Drawable. The depth of a pixmap is the number of 
  30. --  bits per pixels. Bitmaps are simply pixmaps with a depth of 1. (That is, 
  31. --  they are monochrome bitmaps - each pixel can be either on or off). 
  32. --  See Gdk.Bitmap for more details on bitmap handling. 
  33. -- 
  34. --  </description> 
  35. --  <c_version>1.3.6</c_version> 
  36. --  <group>Gdk, the low-level API</group> 
  37.  
  38. with Glib; use Glib; 
  39. with Gdk.Bitmap; 
  40. with Gdk.Color; 
  41. with Gdk.Window; 
  42. with Gtkada.Types; 
  43.  
  44. package Gdk.Pixmap is 
  45.  
  46.    subtype Gdk_Pixmap is Gdk.Gdk_Pixmap; 
  47.    --  A server-side image. 
  48.    --  You can create an empty pixmap, or load if from external files in 
  49.    --  bitmap and pixmap format. See Gdk.Pixbuf if you need to load 
  50.    --  images in other formats. 
  51.  
  52.    Null_Pixmap : constant Gdk_Pixmap; 
  53.  
  54.    procedure Gdk_New 
  55.      (Pixmap : out Gdk_Pixmap; 
  56.       Window : Gdk.Window.Gdk_Window; 
  57.       Width  : Gint; 
  58.       Height : Gint; 
  59.       Depth  : Gint := -1); 
  60.    --  Create a new pixmap with a given size. 
  61.    --  Window is used to determine default values for the new pixmap. 
  62.    --  Can be eventually null. 
  63.    --  Width is the width of the new pixmap in pixels. 
  64.    --  Height is the height of the new pixmap in pixels. 
  65.    --  Depth is the depth (number of bits per pixel) of the new pixmap. 
  66.    --  If -1, and window is not null, the depth of the new pixmap will be 
  67.    --  equal to that of window. 
  68.    --  Automatically reference the pixmap once. 
  69.  
  70.    function Get_Type return Glib.GType; 
  71.    --  Return the internal value associated with Gdk_Pixmap. 
  72.  
  73.    procedure Ref (Pixmap : Gdk_Pixmap); 
  74.    --  Add a reference to a pixmap. 
  75.  
  76.    procedure Unref (Pixmap : Gdk_Pixmap); 
  77.    --  This is the usual way to destroy a pixmap. The memory is freed when 
  78.    --  there is no more reference 
  79.  
  80.    procedure Create_From_Data 
  81.      (Pixmap : out Gdk_Pixmap; 
  82.       Window : Gdk.Window.Gdk_Window; 
  83.       Data   : String; 
  84.       Width  : Gint; 
  85.       Height : Gint; 
  86.       Depth  : Gint; 
  87.       Fg     : Color.Gdk_Color; 
  88.       Bg     : Color.Gdk_Color); 
  89.    --  Create a pixmap from data in XBM format. 
  90.    --  Window is used to determine default values for the new bitmap, can be 
  91.    --  null in which case the root window is used. 
  92.    --  Data is the XBM data. 
  93.    --  Width is the width of the new bitmap in pixels. 
  94.    --  Height is the height of the new bitmap in pixels. 
  95.    --  Depth is the depth (number of bits per pixel) of the new pixmap. 
  96.    --  Fg is the foreground color. 
  97.    --  Bg is the background color. 
  98.  
  99.    procedure Create_From_Xpm 
  100.      (Pixmap      : out Gdk_Pixmap; 
  101.       Window      : Gdk.Window.Gdk_Window; 
  102.       Mask        : in out Gdk.Bitmap.Gdk_Bitmap; 
  103.       Transparent : Gdk.Color.Gdk_Color; 
  104.       Filename    : String); 
  105.    --  Create a pixmap from a XPM file. 
  106.    --  Window is used to determine default values for the new pixmap. 
  107.    --  Mask is a pointer to a place to store a bitmap representing the 
  108.    --  transparency mask of the XPM file. Can be null, in which case 
  109.    --  transparency will be ignored. 
  110.    --  Transparent is the color to be used for the pixels that are transparent 
  111.    --  in the input file. Can be null, in which case a default color will be 
  112.    --  used. 
  113.    --  Filename is the filename of a file containing XPM data. 
  114.  
  115.    procedure Create_From_Xpm 
  116.      (Pixmap      : out Gdk_Pixmap; 
  117.       Window      : Gdk.Window.Gdk_Window; 
  118.       Colormap    : Gdk.Color.Gdk_Colormap; 
  119.       Mask        : in out Gdk.Bitmap.Gdk_Bitmap; 
  120.       Transparent : Gdk.Color.Gdk_Color; 
  121.       Filename    : String); 
  122.    --  Create a pixmap from a XPM file using a particular colormap. 
  123.    --  Window is used to determine default values for the new pixmap. Can be 
  124.    --  null if colormap is given. 
  125.    --  Colormap is the Gdk_Colormap that the new pixmap will use. If omitted, 
  126.    --  the colormap for window will be used. 
  127.    --  Mask is a pointer to a place to store a bitmap representing the 
  128.    --  transparency mask of the XPM file. Can be null, in which case 
  129.    --  transparency will be ignored. 
  130.    --  Transparent is the color to be used for the pixels that are transparent 
  131.    --  in the input file. Can be null, in which case a default color will be 
  132.    --  used. 
  133.    --  Filename is the filename of a file containing XPM data. 
  134.  
  135.    procedure Create_From_Xpm_D 
  136.      (Pixmap      : out Gdk_Pixmap; 
  137.       Window      : Gdk.Window.Gdk_Window; 
  138.       Mask        : in out Gdk.Bitmap.Gdk_Bitmap; 
  139.       Transparent : Gdk.Color.Gdk_Color; 
  140.       Data        : Gtkada.Types.Chars_Ptr_Array); 
  141.    --  Create a pixmap from data in XPM format. 
  142.    --  Window is used to determine default values for the new pixmap. 
  143.    --  Mask is a pointer to a place to store a bitmap representing the 
  144.    --  transparency mask of the XPM file. Can be null, in which case 
  145.    --  transparency will be ignored. 
  146.    --  Transparent will be used for the pixels that are transparent in the 
  147.    --  input file. Can be null in which case a default color will be used. 
  148.    --  Data is a pointer to a string containing the XPM data. 
  149.  
  150.    procedure Create_From_Xpm_D 
  151.      (Pixmap      : out Gdk_Pixmap; 
  152.       Window      : Gdk.Window.Gdk_Window; 
  153.       Colormap    : Gdk.Color.Gdk_Colormap; 
  154.       Mask        : in out Gdk.Bitmap.Gdk_Bitmap; 
  155.       Transparent : Gdk.Color.Gdk_Color; 
  156.       Data        : Gtkada.Types.Chars_Ptr_Array); 
  157.    --  Create a pixmap from data in XPM format using a particular colormap. 
  158.    --  Window is used to determine default values for the new pixmap. 
  159.    --  Colormap is the Gdk_Colormap that the new pixmap will be use. If 
  160.    --  omitted, the colormap for window will be used. 
  161.    --  Mask is a pointer to a place to store a bitmap representing the 
  162.    --  transparency mask of the XPM file. Can be null, in which case 
  163.    --  transparency will be ignored. 
  164.    --  Transparent will be used for the pixels that are transparent in the 
  165.    --  input file. Can be null in which case a default color will be used. 
  166.    --  Data is a pointer to a string containing the XPM data. 
  167.  
  168. private 
  169.    Null_Pixmap : constant Gdk_Pixmap := null; 
  170.    pragma Import (C, Get_Type, "gdk_pixmap_get_type"); 
  171.    pragma Import (C, Ref, "gdk_drawable_ref"); 
  172.    pragma Import (C, Unref, "gdk_drawable_unref"); 
  173. end Gdk.Pixmap;