1 //******************************************************************************
2 //  Copyright (c) 2005-2013 by Jan Van hijfte
3 //
4 //  See the included file COPYING.TXT for details about the copyright.
5 //
6 //  This program is distributed in the hope that it will be useful,
7 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
8 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 //******************************************************************************
10 
11 
12 #include "qpixmap_c.h"
13 
QPixmap_Create()14 QPixmapH QPixmap_Create()
15 {
16 	return (QPixmapH) new QPixmap();
17 }
18 
QPixmap_Destroy(QPixmapH handle)19 void QPixmap_Destroy(QPixmapH handle)
20 {
21 	delete (QPixmap *)handle;
22 }
23 
QPixmap_Create2(int w,int h)24 QPixmapH QPixmap_Create2(int w, int h)
25 {
26 	return (QPixmapH) new QPixmap(w, h);
27 }
28 
QPixmap_Create3(const QSizeH AnonParam1)29 QPixmapH QPixmap_Create3(const QSizeH AnonParam1)
30 {
31 	return (QPixmapH) new QPixmap(*(const QSize*)AnonParam1);
32 }
33 
QPixmap_Create4(PWideString fileName,const char * format,unsigned int flags)34 QPixmapH QPixmap_Create4(PWideString fileName, const char* format, unsigned int flags)
35 {
36 	QString t_fileName;
37 	copyPWideStringToQString(fileName, t_fileName);
38 	return (QPixmapH) new QPixmap(t_fileName, format, (Qt::ImageConversionFlags)flags);
39 }
40 
QPixmap_Create5(const char * const xpm)41 QPixmapH QPixmap_Create5(const char* const xpm)
42 {
43 	return (QPixmapH) new QPixmap(xpm);
44 }
45 
QPixmap_Create6(const QPixmapH AnonParam1)46 QPixmapH QPixmap_Create6(const QPixmapH AnonParam1)
47 {
48 	return (QPixmapH) new QPixmap(*(const QPixmap*)AnonParam1);
49 }
50 
QPixmap_swap(QPixmapH handle,QPixmapH other)51 void QPixmap_swap(QPixmapH handle, QPixmapH other)
52 {
53 	((QPixmap *)handle)->swap(*(QPixmap*)other);
54 }
55 
QPixmap_isNull(QPixmapH handle)56 bool QPixmap_isNull(QPixmapH handle)
57 {
58 	return (bool) ((QPixmap *)handle)->isNull();
59 }
60 
QPixmap_devType(QPixmapH handle)61 int QPixmap_devType(QPixmapH handle)
62 {
63 	return (int) ((QPixmap *)handle)->devType();
64 }
65 
QPixmap_width(QPixmapH handle)66 int QPixmap_width(QPixmapH handle)
67 {
68 	return (int) ((QPixmap *)handle)->width();
69 }
70 
QPixmap_height(QPixmapH handle)71 int QPixmap_height(QPixmapH handle)
72 {
73 	return (int) ((QPixmap *)handle)->height();
74 }
75 
QPixmap_size(QPixmapH handle,PSize retval)76 void QPixmap_size(QPixmapH handle, PSize retval)
77 {
78 	*(QSize *)retval = ((QPixmap *)handle)->size();
79 }
80 
QPixmap_rect(QPixmapH handle,PRect retval)81 void QPixmap_rect(QPixmapH handle, PRect retval)
82 {
83 	QRect t_retval;
84 	t_retval = ((QPixmap *)handle)->rect();
85 	copyQRectToPRect(t_retval, retval);
86 }
87 
QPixmap_depth(QPixmapH handle)88 int QPixmap_depth(QPixmapH handle)
89 {
90 	return (int) ((QPixmap *)handle)->depth();
91 }
92 
QPixmap_defaultDepth()93 int QPixmap_defaultDepth()
94 {
95 	return (int) QPixmap::defaultDepth();
96 }
97 
QPixmap_fill(QPixmapH handle,const QColorH fillColor)98 void QPixmap_fill(QPixmapH handle, const QColorH fillColor)
99 {
100 	((QPixmap *)handle)->fill(*(const QColor*)fillColor);
101 }
102 
QPixmap_fill2(QPixmapH handle,const QPaintDeviceH device,const QPointH ofs)103 void QPixmap_fill2(QPixmapH handle, const QPaintDeviceH device, const QPointH ofs)
104 {
105 	((QPixmap *)handle)->fill((const QPaintDevice*)device, *(const QPoint*)ofs);
106 }
107 
QPixmap_fill3(QPixmapH handle,const QPaintDeviceH device,int xofs,int yofs)108 void QPixmap_fill3(QPixmapH handle, const QPaintDeviceH device, int xofs, int yofs)
109 {
110 	((QPixmap *)handle)->fill((const QPaintDevice*)device, xofs, yofs);
111 }
112 
QPixmap_mask(QPixmapH handle,QBitmapH retval)113 void QPixmap_mask(QPixmapH handle, QBitmapH retval)
114 {
115 	*(QBitmap *)retval = ((QPixmap *)handle)->mask();
116 }
117 
QPixmap_setMask(QPixmapH handle,const QBitmapH AnonParam1)118 void QPixmap_setMask(QPixmapH handle, const QBitmapH AnonParam1)
119 {
120 	((QPixmap *)handle)->setMask(*(const QBitmap*)AnonParam1);
121 }
122 
QPixmap_devicePixelRatio(QPixmapH handle)123 qreal QPixmap_devicePixelRatio(QPixmapH handle)
124 {
125 	return (qreal) ((QPixmap *)handle)->devicePixelRatio();
126 }
127 
QPixmap_setDevicePixelRatio(QPixmapH handle,qreal scaleFactor)128 void QPixmap_setDevicePixelRatio(QPixmapH handle, qreal scaleFactor)
129 {
130 	((QPixmap *)handle)->setDevicePixelRatio(scaleFactor);
131 }
132 
QPixmap_hasAlpha(QPixmapH handle)133 bool QPixmap_hasAlpha(QPixmapH handle)
134 {
135 	return (bool) ((QPixmap *)handle)->hasAlpha();
136 }
137 
QPixmap_hasAlphaChannel(QPixmapH handle)138 bool QPixmap_hasAlphaChannel(QPixmapH handle)
139 {
140 	return (bool) ((QPixmap *)handle)->hasAlphaChannel();
141 }
142 
QPixmap_createHeuristicMask(QPixmapH handle,QBitmapH retval,bool clipTight)143 void QPixmap_createHeuristicMask(QPixmapH handle, QBitmapH retval, bool clipTight)
144 {
145 	*(QBitmap *)retval = ((QPixmap *)handle)->createHeuristicMask(clipTight);
146 }
147 
QPixmap_createMaskFromColor(QPixmapH handle,QBitmapH retval,const QColorH maskColor,Qt::MaskMode mode)148 void QPixmap_createMaskFromColor(QPixmapH handle, QBitmapH retval, const QColorH maskColor, Qt::MaskMode mode)
149 {
150 	*(QBitmap *)retval = ((QPixmap *)handle)->createMaskFromColor(*(const QColor*)maskColor, mode);
151 }
152 
QPixmap_grabWindow(QPixmapH retval,unsigned int AnonParam1,int x,int y,int w,int h)153 void QPixmap_grabWindow(QPixmapH retval, unsigned int AnonParam1, int x, int y, int w, int h)
154 {
155 	*(QPixmap *)retval = QPixmap::grabWindow((WId)AnonParam1, x, y, w, h);
156 }
157 
QPixmap_grabWidget(QPixmapH retval,QObjectH widget,PRect rect)158 void QPixmap_grabWidget(QPixmapH retval, QObjectH widget, PRect rect)
159 {
160 	QRect t_rect;
161 	copyPRectToQRect(rect, t_rect);
162 	*(QPixmap *)retval = QPixmap::grabWidget((QObject*)widget, t_rect);
163 }
164 
QPixmap_grabWidget2(QPixmapH retval,QObjectH widget,int x,int y,int w,int h)165 void QPixmap_grabWidget2(QPixmapH retval, QObjectH widget, int x, int y, int w, int h)
166 {
167 	*(QPixmap *)retval = QPixmap::grabWidget((QObject*)widget, x, y, w, h);
168 }
169 
QPixmap_scaled(QPixmapH handle,QPixmapH retval,int w,int h,Qt::AspectRatioMode aspectMode,Qt::TransformationMode mode)170 void QPixmap_scaled(QPixmapH handle, QPixmapH retval, int w, int h, Qt::AspectRatioMode aspectMode, Qt::TransformationMode mode)
171 {
172 	*(QPixmap *)retval = ((QPixmap *)handle)->scaled(w, h, aspectMode, mode);
173 }
174 
QPixmap_scaled2(QPixmapH handle,QPixmapH retval,const QSizeH s,Qt::AspectRatioMode aspectMode,Qt::TransformationMode mode)175 void QPixmap_scaled2(QPixmapH handle, QPixmapH retval, const QSizeH s, Qt::AspectRatioMode aspectMode, Qt::TransformationMode mode)
176 {
177 	*(QPixmap *)retval = ((QPixmap *)handle)->scaled(*(const QSize*)s, aspectMode, mode);
178 }
179 
QPixmap_scaledToWidth(QPixmapH handle,QPixmapH retval,int w,Qt::TransformationMode mode)180 void QPixmap_scaledToWidth(QPixmapH handle, QPixmapH retval, int w, Qt::TransformationMode mode)
181 {
182 	*(QPixmap *)retval = ((QPixmap *)handle)->scaledToWidth(w, mode);
183 }
184 
QPixmap_scaledToHeight(QPixmapH handle,QPixmapH retval,int h,Qt::TransformationMode mode)185 void QPixmap_scaledToHeight(QPixmapH handle, QPixmapH retval, int h, Qt::TransformationMode mode)
186 {
187 	*(QPixmap *)retval = ((QPixmap *)handle)->scaledToHeight(h, mode);
188 }
189 
QPixmap_transformed(QPixmapH handle,QPixmapH retval,const QMatrixH AnonParam1,Qt::TransformationMode mode)190 void QPixmap_transformed(QPixmapH handle, QPixmapH retval, const QMatrixH AnonParam1, Qt::TransformationMode mode)
191 {
192 	*(QPixmap *)retval = ((QPixmap *)handle)->transformed(*(const QMatrix*)AnonParam1, mode);
193 }
194 
QPixmap_trueMatrix(QMatrixH retval,const QMatrixH m,int w,int h)195 void QPixmap_trueMatrix(QMatrixH retval, const QMatrixH m, int w, int h)
196 {
197 	*(QMatrix *)retval = QPixmap::trueMatrix(*(const QMatrix*)m, w, h);
198 }
199 
QPixmap_transformed2(QPixmapH handle,QPixmapH retval,const QTransformH AnonParam1,Qt::TransformationMode mode)200 void QPixmap_transformed2(QPixmapH handle, QPixmapH retval, const QTransformH AnonParam1, Qt::TransformationMode mode)
201 {
202 	*(QPixmap *)retval = ((QPixmap *)handle)->transformed(*(const QTransform*)AnonParam1, mode);
203 }
204 
QPixmap_trueMatrix2(QTransformH retval,const QTransformH m,int w,int h)205 void QPixmap_trueMatrix2(QTransformH retval, const QTransformH m, int w, int h)
206 {
207 	*(QTransform *)retval = QPixmap::trueMatrix(*(const QTransform*)m, w, h);
208 }
209 
QPixmap_toImage(QPixmapH handle,QImageH retval)210 void QPixmap_toImage(QPixmapH handle, QImageH retval)
211 {
212 	*(QImage *)retval = ((QPixmap *)handle)->toImage();
213 }
214 
QPixmap_fromImage(QPixmapH retval,const QImageH image,unsigned int flags)215 void QPixmap_fromImage(QPixmapH retval, const QImageH image, unsigned int flags)
216 {
217 	*(QPixmap *)retval = QPixmap::fromImage(*(const QImage*)image, (Qt::ImageConversionFlags)flags);
218 }
219 
QPixmap_fromImageReader(QPixmapH retval,QImageReaderH imageReader,unsigned int flags)220 void QPixmap_fromImageReader(QPixmapH retval, QImageReaderH imageReader, unsigned int flags)
221 {
222 	*(QPixmap *)retval = QPixmap::fromImageReader((QImageReader*)imageReader, (Qt::ImageConversionFlags)flags);
223 }
224 
QPixmap_load(QPixmapH handle,PWideString fileName,const char * format,unsigned int flags)225 bool QPixmap_load(QPixmapH handle, PWideString fileName, const char* format, unsigned int flags)
226 {
227 	QString t_fileName;
228 	copyPWideStringToQString(fileName, t_fileName);
229 	return (bool) ((QPixmap *)handle)->load(t_fileName, format, (Qt::ImageConversionFlags)flags);
230 }
231 
QPixmap_loadFromData(QPixmapH handle,const uchar * buf,uint len,const char * format,unsigned int flags)232 bool QPixmap_loadFromData(QPixmapH handle, const uchar* buf, uint len, const char* format, unsigned int flags)
233 {
234 	return (bool) ((QPixmap *)handle)->loadFromData(buf, len, format, (Qt::ImageConversionFlags)flags);
235 }
236 
QPixmap_loadFromData2(QPixmapH handle,const QByteArrayH data,const char * format,unsigned int flags)237 bool QPixmap_loadFromData2(QPixmapH handle, const QByteArrayH data, const char* format, unsigned int flags)
238 {
239 	return (bool) ((QPixmap *)handle)->loadFromData(*(const QByteArray*)data, format, (Qt::ImageConversionFlags)flags);
240 }
241 
QPixmap_save(QPixmapH handle,PWideString fileName,const char * format,int quality)242 bool QPixmap_save(QPixmapH handle, PWideString fileName, const char* format, int quality)
243 {
244 	QString t_fileName;
245 	copyPWideStringToQString(fileName, t_fileName);
246 	return (bool) ((QPixmap *)handle)->save(t_fileName, format, quality);
247 }
248 
QPixmap_save2(QPixmapH handle,QIODeviceH device,const char * format,int quality)249 bool QPixmap_save2(QPixmapH handle, QIODeviceH device, const char* format, int quality)
250 {
251 	return (bool) ((QPixmap *)handle)->save((QIODevice*)device, format, quality);
252 }
253 
QPixmap_convertFromImage(QPixmapH handle,const QImageH img,unsigned int flags)254 bool QPixmap_convertFromImage(QPixmapH handle, const QImageH img, unsigned int flags)
255 {
256 	return (bool) ((QPixmap *)handle)->convertFromImage(*(const QImage*)img, (Qt::ImageConversionFlags)flags);
257 }
258 
QPixmap_copy(QPixmapH handle,QPixmapH retval,int x,int y,int width,int height)259 void QPixmap_copy(QPixmapH handle, QPixmapH retval, int x, int y, int width, int height)
260 {
261 	*(QPixmap *)retval = ((QPixmap *)handle)->copy(x, y, width, height);
262 }
263 
QPixmap_copy2(QPixmapH handle,QPixmapH retval,PRect rect)264 void QPixmap_copy2(QPixmapH handle, QPixmapH retval, PRect rect)
265 {
266 	QRect t_rect;
267 	copyPRectToQRect(rect, t_rect);
268 	*(QPixmap *)retval = ((QPixmap *)handle)->copy(t_rect);
269 }
270 
QPixmap_scroll(QPixmapH handle,int dx,int dy,int x,int y,int width,int height,QRegionH exposed)271 void QPixmap_scroll(QPixmapH handle, int dx, int dy, int x, int y, int width, int height, QRegionH exposed)
272 {
273 	((QPixmap *)handle)->scroll(dx, dy, x, y, width, height, (QRegion*)exposed);
274 }
275 
QPixmap_scroll2(QPixmapH handle,int dx,int dy,PRect rect,QRegionH exposed)276 void QPixmap_scroll2(QPixmapH handle, int dx, int dy, PRect rect, QRegionH exposed)
277 {
278 	QRect t_rect;
279 	copyPRectToQRect(rect, t_rect);
280 	((QPixmap *)handle)->scroll(dx, dy, t_rect, (QRegion*)exposed);
281 }
282 
QPixmap_cacheKey(QPixmapH handle)283 qint64 QPixmap_cacheKey(QPixmapH handle)
284 {
285 	return (qint64) ((QPixmap *)handle)->cacheKey();
286 }
287 
QPixmap_isDetached(QPixmapH handle)288 bool QPixmap_isDetached(QPixmapH handle)
289 {
290 	return (bool) ((QPixmap *)handle)->isDetached();
291 }
292 
QPixmap_detach(QPixmapH handle)293 void QPixmap_detach(QPixmapH handle)
294 {
295 	((QPixmap *)handle)->detach();
296 }
297 
QPixmap_isQBitmap(QPixmapH handle)298 bool QPixmap_isQBitmap(QPixmapH handle)
299 {
300 	return (bool) ((QPixmap *)handle)->isQBitmap();
301 }
302 
QPixmap_paintEngine(QPixmapH handle)303 QPaintEngineH QPixmap_paintEngine(QPixmapH handle)
304 {
305 	return (QPaintEngineH) ((QPixmap *)handle)->paintEngine();
306 }
307 
308