File: gdk-pixmap.ads

package info (click to toggle)
libgtkada2 2.8.1-6lenny3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 13,496 kB
  • ctags: 3,886
  • sloc: ada: 103,189; ansic: 45,411; perl: 5,500; sh: 2,812; makefile: 1,169; xml: 19
file content (172 lines) | stat: -rw-r--r-- 7,898 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
-----------------------------------------------------------------------
--               GtkAda - Ada95 binding for Gtk+/Gnome               --
--                                                                   --
--   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   --
--                Copyright (C) 2000-2002 ACT-Europe                 --
--                                                                   --
-- This library is free software; you can redistribute it and/or     --
-- modify it under the terms of the GNU General Public               --
-- License as published by the Free Software Foundation; either      --
-- version 2 of the License, or (at your option) any later version.  --
--                                                                   --
-- This library is distributed in the hope that it will be useful,   --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of    --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --
-- General Public License for more details.                          --
--                                                                   --
-- You should have received a copy of the GNU General Public         --
-- License along with this library; if not, write to the             --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --
-- Boston, MA 02111-1307, USA.                                       --
--                                                                   --
-----------------------------------------------------------------------

--  <description>
--
--  Pixmaps are off-screen drawables. They can be drawn upon with the standard
--  drawing primitives, then copied to another drawable (such as a Gdk_Window)
--  with Gdk.Drawable.Draw_Drawable. The depth of a pixmap is the number of
--  bits per pixels. Bitmaps are simply pixmaps with a depth of 1. (That is,
--  they are monochrome bitmaps - each pixel can be either on or off).
--  See Gdk.Bitmap for more details on bitmap handling.
--
--  </description>
--  <c_version>1.3.6</c_version>
--  <group>Gdk, the low-level API</group>

with Glib; use Glib;
with Gdk.Bitmap;
with Gdk.Color;
with Gdk.Window;
with Gtkada.Types;

package Gdk.Pixmap is

   subtype Gdk_Pixmap is Gdk.Gdk_Pixmap;
   --  A server-side image.
   --  You can create an empty pixmap, or load if from external files in
   --  bitmap and pixmap format. See Gdk.Pixbuf if you need to load
   --  images in other formats.

   Null_Pixmap : constant Gdk_Pixmap;

   procedure Gdk_New
     (Pixmap : out Gdk_Pixmap;
      Window : Gdk.Window.Gdk_Window;
      Width  : Gint;
      Height : Gint;
      Depth  : Gint := -1);
   --  Create a new pixmap with a given size.
   --  Window is used to determine default values for the new pixmap.
   --  Can be eventually null.
   --  Width is the width of the new pixmap in pixels.
   --  Height is the height of the new pixmap in pixels.
   --  Depth is the depth (number of bits per pixel) of the new pixmap.
   --  If -1, and window is not null, the depth of the new pixmap will be
   --  equal to that of window.
   --  Automatically reference the pixmap once.

   function Get_Type return Glib.GType;
   --  Return the internal value associated with Gdk_Pixmap.

   procedure Ref (Pixmap : Gdk_Pixmap);
   --  Add a reference to a pixmap.

   procedure Unref (Pixmap : Gdk_Pixmap);
   --  This is the usual way to destroy a pixmap. The memory is freed when
   --  there is no more reference

   procedure Create_From_Data
     (Pixmap : out Gdk_Pixmap;
      Window : Gdk.Window.Gdk_Window;
      Data   : String;
      Width  : Gint;
      Height : Gint;
      Depth  : Gint;
      Fg     : Color.Gdk_Color;
      Bg     : Color.Gdk_Color);
   --  Create a pixmap from data in XBM format.
   --  Window is used to determine default values for the new bitmap, can be
   --  null in which case the root window is used.
   --  Data is the XBM data.
   --  Width is the width of the new bitmap in pixels.
   --  Height is the height of the new bitmap in pixels.
   --  Depth is the depth (number of bits per pixel) of the new pixmap.
   --  Fg is the foreground color.
   --  Bg is the background color.

   procedure Create_From_Xpm
     (Pixmap      : out Gdk_Pixmap;
      Window      : Gdk.Window.Gdk_Window;
      Mask        : in out Gdk.Bitmap.Gdk_Bitmap;
      Transparent : Gdk.Color.Gdk_Color;
      Filename    : String);
   --  Create a pixmap from a XPM file.
   --  Window is used to determine default values for the new pixmap.
   --  Mask is a pointer to a place to store a bitmap representing the
   --  transparency mask of the XPM file. Can be null, in which case
   --  transparency will be ignored.
   --  Transparent is the color to be used for the pixels that are transparent
   --  in the input file. Can be null, in which case a default color will be
   --  used.
   --  Filename is the filename of a file containing XPM data.

   procedure Create_From_Xpm
     (Pixmap      : out Gdk_Pixmap;
      Window      : Gdk.Window.Gdk_Window;
      Colormap    : Gdk.Color.Gdk_Colormap;
      Mask        : in out Gdk.Bitmap.Gdk_Bitmap;
      Transparent : Gdk.Color.Gdk_Color;
      Filename    : String);
   --  Create a pixmap from a XPM file using a particular colormap.
   --  Window is used to determine default values for the new pixmap. Can be
   --  null if colormap is given.
   --  Colormap is the Gdk_Colormap that the new pixmap will use. If omitted,
   --  the colormap for window will be used.
   --  Mask is a pointer to a place to store a bitmap representing the
   --  transparency mask of the XPM file. Can be null, in which case
   --  transparency will be ignored.
   --  Transparent is the color to be used for the pixels that are transparent
   --  in the input file. Can be null, in which case a default color will be
   --  used.
   --  Filename is the filename of a file containing XPM data.

   procedure Create_From_Xpm_D
     (Pixmap      : out Gdk_Pixmap;
      Window      : Gdk.Window.Gdk_Window;
      Mask        : in out Gdk.Bitmap.Gdk_Bitmap;
      Transparent : Gdk.Color.Gdk_Color;
      Data        : Gtkada.Types.Chars_Ptr_Array);
   --  Create a pixmap from data in XPM format.
   --  Window is used to determine default values for the new pixmap.
   --  Mask is a pointer to a place to store a bitmap representing the
   --  transparency mask of the XPM file. Can be null, in which case
   --  transparency will be ignored.
   --  Transparent will be used for the pixels that are transparent in the
   --  input file. Can be null in which case a default color will be used.
   --  Data is a pointer to a string containing the XPM data.

   procedure Create_From_Xpm_D
     (Pixmap      : out Gdk_Pixmap;
      Window      : Gdk.Window.Gdk_Window;
      Colormap    : Gdk.Color.Gdk_Colormap;
      Mask        : in out Gdk.Bitmap.Gdk_Bitmap;
      Transparent : Gdk.Color.Gdk_Color;
      Data        : Gtkada.Types.Chars_Ptr_Array);
   --  Create a pixmap from data in XPM format using a particular colormap.
   --  Window is used to determine default values for the new pixmap.
   --  Colormap is the Gdk_Colormap that the new pixmap will be use. If
   --  omitted, the colormap for window will be used.
   --  Mask is a pointer to a place to store a bitmap representing the
   --  transparency mask of the XPM file. Can be null, in which case
   --  transparency will be ignored.
   --  Transparent will be used for the pixels that are transparent in the
   --  input file. Can be null in which case a default color will be used.
   --  Data is a pointer to a string containing the XPM data.

private
   Null_Pixmap : constant Gdk_Pixmap := null;
   pragma Import (C, Get_Type, "gdk_pixmap_get_type");
   pragma Import (C, Ref, "gdk_drawable_ref");
   pragma Import (C, Unref, "gdk_drawable_unref");
end Gdk.Pixmap;