2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gdk-Bitmaps-and-Pixmaps.html
51 * - GdkColor* -> Color
52 * - GdkColormap* -> Colormap
53 * - GdkDrawable* -> Drawable
54 * - GdkPixmap* -> Pixmap
60 private import gdk
.gdktypes
;
62 private import lib
.gdk
;
64 private import glib
.Str
;
65 private import gdk
.Drawable
;
66 private import gdk
.Pixmap
;
67 private import gdk
.Color
;
68 private import gdk
.Colormap
;
72 * Pixmaps are offscreen drawables. They can be drawn upon with the
73 * standard drawing primitives, then copied to another drawable (such as
74 * a GdkWindow) with gdk_pixmap_draw(). The depth of a pixmap
75 * is the number of bits per pixels. Bitmaps are simply pixmaps
76 * with a depth of 1. (That is, they are monochrome bitmaps - each
77 * pixel can be either on or off).
79 private import gdk
.Drawable
;
80 public class Pixmap
: Drawable
83 /** the main Gtk struct */
84 protected GdkPixmap
* gdkPixmap
;
87 public GdkPixmap
* getPixmapStruct()
93 /** the main Gtk struct as a void* */
94 protected void* getStruct()
96 return cast(void*)gdkPixmap
;
100 * Sets our main struct and passes it to the parent class
102 public this (GdkPixmap
* gdkPixmap
)
104 super(cast(GdkDrawable
*)gdkPixmap
);
105 this.gdkPixmap
= gdkPixmap
;
113 * Create a new pixmap with a given size and depth.
115 * A GdkDrawable, used to determine default values
116 * for the new pixmap. Can be NULL if depth is specified,
118 * The width of the new pixmap in pixels.
120 * The height of the new pixmap in pixels.
122 * The depth (number of bits per pixel) of the new pixmap.
123 * If -1, and drawable is not NULL, the depth of the new
124 * pixmap will be equal to that of drawable.
128 public this (Drawable drawable
, int width
, int height
, int depth
)
130 // GdkPixmap* gdk_pixmap_new (GdkDrawable *drawable, gint width, gint height, gint depth);
131 this(cast(GdkPixmap
*)gdk_pixmap_new((drawable
is null) ?
null : drawable
.getDrawableStruct(), width
, height
, depth
) );
136 * Create a two-color pixmap from data in XBM data.
138 * a GdkDrawable, used to determine default values
139 * for the new pixmap. Can be NULL, if the depth is given.
141 * a pointer to the data.
143 * the width of the new pixmap in pixels.
145 * the height of the new pixmap in pixels.
147 * the depth (number of bits per pixel) of the new pixmap.
149 * the foreground color.
151 * the background color.
155 public static Pixmap
createFromData(Drawable drawable
, char[] data
, int width
, int height
, int depth
, Color fg
, Color bg
)
157 // GdkPixmap* gdk_pixmap_create_from_data (GdkDrawable *drawable, const gchar *data, gint width, gint height, gint depth, const GdkColor *fg, const GdkColor *bg);
158 return new Pixmap( gdk_pixmap_create_from_data((drawable
is null) ?
null : drawable
.getDrawableStruct(), Str
.toStringz(data
), width
, height
, depth
, (fg
is null) ?
null : fg
.getColorStruct(), (bg
is null) ?
null : bg
.getColorStruct()) );
162 * Create a pixmap from a XPM file.
164 * a GdkDrawable, used to determine default values
165 * for the new pixmap.
167 * a pointer to a place to store a bitmap representing
168 * the transparency mask of the XPM file. Can be NULL,
169 * in which case transparency will be ignored.
171 * the color to be used for the pixels
172 * that are transparent in the input file. Can be NULL,
173 * in which case a default color will be used.
175 * the filename of a file containing XPM data.
179 public static Pixmap
createFromXpm(Drawable drawable
, GdkBitmap
** mask
, Color transparentColor
, char[] filename
)
181 // GdkPixmap* gdk_pixmap_create_from_xpm (GdkDrawable *drawable, GdkBitmap **mask, const GdkColor *transparent_color, const gchar *filename);
182 return new Pixmap( gdk_pixmap_create_from_xpm((drawable
is null) ?
null : drawable
.getDrawableStruct(), mask
, (transparentColor
is null) ?
null : transparentColor
.getColorStruct(), Str
.toStringz(filename
)) );
186 * Create a pixmap from a XPM file using a particular colormap.
188 * a GdkDrawable, used to determine default values
189 * for the new pixmap. Can be NULL if colormap is given.
191 * the GdkColormap that the new pixmap will be use.
192 * If omitted, the colormap for window will be used.
194 * a pointer to a place to store a bitmap representing
195 * the transparency mask of the XPM file. Can be NULL,
196 * in which case transparency will be ignored.
198 * the color to be used for the pixels
199 * that are transparent in the input file. Can be NULL,
200 * in which case a default color will be used.
202 * the filename of a file containing XPM data.
206 public static Pixmap
colormapCreateFromXpm(Drawable drawable
, Colormap colormap
, GdkBitmap
** mask
, Color transparentColor
, char[] filename
)
208 // GdkPixmap* gdk_pixmap_colormap_create_from_xpm (GdkDrawable *drawable, GdkColormap *colormap, GdkBitmap **mask, const GdkColor *transparent_color, const gchar *filename);
209 return new Pixmap( gdk_pixmap_colormap_create_from_xpm((drawable
is null) ?
null : drawable
.getDrawableStruct(), (colormap
is null) ?
null : colormap
.getColormapStruct(), mask
, (transparentColor
is null) ?
null : transparentColor
.getColorStruct(), Str
.toStringz(filename
)) );
213 * Create a pixmap from data in XPM format.
215 * a GdkDrawable, used to determine default values
216 * for the new pixmap.
218 * Pointer to a place to store a bitmap representing
219 * the transparency mask of the XPM file. Can be NULL,
220 * in which case transparency will be ignored.
222 * This color will be used for the pixels
223 * that are transparent in the input file. Can be NULL
224 * in which case a default color will be used.
226 * Pointer to a string containing the XPM data.
230 public static Pixmap
createFromXpmD(Drawable drawable
, GdkBitmap
** mask
, Color transparentColor
, char** data
)
232 // GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkDrawable *drawable, GdkBitmap **mask, const GdkColor *transparent_color, gchar **data);
233 return new Pixmap( gdk_pixmap_create_from_xpm_d((drawable
is null) ?
null : drawable
.getDrawableStruct(), mask
, (transparentColor
is null) ?
null : transparentColor
.getColorStruct(), data
) );
237 * Create a pixmap from data in XPM format using a particular
240 * a GdkDrawable, used to determine default values
241 * for the new pixmap. Can be NULL if colormap is given.
243 * the GdkColormap that the new pixmap will be use.
244 * If omitted, the colormap for window will be used.
246 * a pointer to a place to store a bitmap representing
247 * the transparency mask of the XPM file. Can be NULL,
248 * in which case transparency will be ignored.
250 * the color to be used for the pixels
251 * that are transparent in the input file. Can be NULL,
252 * in which case a default color will be used.
254 * Pointer to a string containing the XPM data.
258 public static Pixmap
colormapCreateFromXpmD(Drawable drawable
, Colormap colormap
, GdkBitmap
** mask
, Color transparentColor
, char** data
)
260 // GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d (GdkDrawable *drawable, GdkColormap *colormap, GdkBitmap **mask, const GdkColor *transparent_color, gchar **data);
261 return new Pixmap( gdk_pixmap_colormap_create_from_xpm_d((drawable
is null) ?
null : drawable
.getDrawableStruct(), (colormap
is null) ?
null : colormap
.getColormapStruct(), mask
, (transparentColor
is null) ?
null : transparentColor
.getColorStruct(), data
) );