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