File: qcolor_c.cpp

package info (click to toggle)
libqtpas 2.6%2B2.0.8%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,860 kB
  • sloc: cpp: 56,595; pascal: 13,727; sh: 44; makefile: 18
file content (491 lines) | stat: -rw-r--r-- 10,041 bytes parent folder | download | duplicates (11)
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
//******************************************************************************
//  Copyright (c) 2005-2013 by Jan Van hijfte
//
//  See the included file COPYING.TXT for details about the copyright.
//
//  This program 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.
//******************************************************************************


#include "qcolor_c.h"

QColorH QColor_Create()
{
	return (QColorH) new QColor();
}

void QColor_Destroy(QColorH handle)
{
	delete (QColor *)handle;
}

QColorH QColor_Create2(Qt::GlobalColor color)
{
	return (QColorH) new QColor(color);
}

QColorH QColor_Create3(int r, int g, int b, int a)
{
	return (QColorH) new QColor(r, g, b, a);
}

QColorH QColor_Create4(QRgb rgb)
{
	return (QColorH) new QColor(rgb);
}

QColorH QColor_Create5(PWideString name)
{
	QString t_name;
	copyPWideStringToQString(name, t_name);
	return (QColorH) new QColor(t_name);
}

QColorH QColor_Create6(const char* name)
{
	return (QColorH) new QColor(name);
}

QColorH QColor_Create7(const QColorH color)
{
	return (QColorH) new QColor(*(const QColor*)color);
}

QColorH QColor_Create8(QColor::Spec spec)
{
	return (QColorH) new QColor(spec);
}

bool QColor_isValid(QColorH handle)
{
	return (bool) ((QColor *)handle)->isValid();
}

void QColor_name(QColorH handle, PWideString retval)
{
	QString t_retval;
	t_retval = ((QColor *)handle)->name();
	copyQStringToPWideString(t_retval, retval);
}

void QColor_setNamedColor(QColorH handle, PWideString name)
{
	QString t_name;
	copyPWideStringToQString(name, t_name);
	((QColor *)handle)->setNamedColor(t_name);
}

void QColor_colorNames(QStringListH retval)
{
	*(QStringList *)retval = QColor::colorNames();
}

QColor::Spec QColor_spec(QColorH handle)
{
	return (QColor::Spec) ((QColor *)handle)->spec();
}

int QColor_alpha(QColorH handle)
{
	return (int) ((QColor *)handle)->alpha();
}

void QColor_setAlpha(QColorH handle, int alpha)
{
	((QColor *)handle)->setAlpha(alpha);
}

qreal QColor_alphaF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->alphaF();
}

void QColor_setAlphaF(QColorH handle, qreal alpha)
{
	((QColor *)handle)->setAlphaF(alpha);
}

int QColor_red(QColorH handle)
{
	return (int) ((QColor *)handle)->red();
}

int QColor_green(QColorH handle)
{
	return (int) ((QColor *)handle)->green();
}

int QColor_blue(QColorH handle)
{
	return (int) ((QColor *)handle)->blue();
}

void QColor_setRed(QColorH handle, int red)
{
	((QColor *)handle)->setRed(red);
}

void QColor_setGreen(QColorH handle, int green)
{
	((QColor *)handle)->setGreen(green);
}

void QColor_setBlue(QColorH handle, int blue)
{
	((QColor *)handle)->setBlue(blue);
}

qreal QColor_redF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->redF();
}

qreal QColor_greenF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->greenF();
}

qreal QColor_blueF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->blueF();
}

void QColor_setRedF(QColorH handle, qreal red)
{
	((QColor *)handle)->setRedF(red);
}

void QColor_setGreenF(QColorH handle, qreal green)
{
	((QColor *)handle)->setGreenF(green);
}

void QColor_setBlueF(QColorH handle, qreal blue)
{
	((QColor *)handle)->setBlueF(blue);
}

void QColor_getRgb(QColorH handle, int* r, int* g, int* b, int* a)
{
	((QColor *)handle)->getRgb(r, g, b, a);
}

void QColor_setRgb(QColorH handle, int r, int g, int b, int a)
{
	((QColor *)handle)->setRgb(r, g, b, a);
}

void QColor_getRgbF(QColorH handle, qreal* r, qreal* g, qreal* b, qreal* a)
{
	((QColor *)handle)->getRgbF(r, g, b, a);
}

void QColor_setRgbF(QColorH handle, qreal r, qreal g, qreal b, qreal a)
{
	((QColor *)handle)->setRgbF(r, g, b, a);
}

QRgb QColor_rgba(QColorH handle)
{
	return (QRgb) ((QColor *)handle)->rgba();
}

void QColor_setRgba(QColorH handle, QRgb rgba)
{
	((QColor *)handle)->setRgba(rgba);
}

QRgb QColor_rgb(QColorH handle)
{
	return (QRgb) ((QColor *)handle)->rgb();
}

void QColor_setRgb2(QColorH handle, QRgb rgb)
{
	((QColor *)handle)->setRgb(rgb);
}

int QColor_hue(QColorH handle)
{
	return (int) ((QColor *)handle)->hue();
}

int QColor_saturation(QColorH handle)
{
	return (int) ((QColor *)handle)->saturation();
}

int QColor_hsvHue(QColorH handle)
{
	return (int) ((QColor *)handle)->hsvHue();
}

int QColor_hsvSaturation(QColorH handle)
{
	return (int) ((QColor *)handle)->hsvSaturation();
}

int QColor_value(QColorH handle)
{
	return (int) ((QColor *)handle)->value();
}

qreal QColor_hueF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->hueF();
}

qreal QColor_saturationF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->saturationF();
}

qreal QColor_hsvHueF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->hsvHueF();
}

qreal QColor_hsvSaturationF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->hsvSaturationF();
}

qreal QColor_valueF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->valueF();
}

void QColor_getHsv(QColorH handle, int* h, int* s, int* v, int* a)
{
	((QColor *)handle)->getHsv(h, s, v, a);
}

void QColor_setHsv(QColorH handle, int h, int s, int v, int a)
{
	((QColor *)handle)->setHsv(h, s, v, a);
}

void QColor_getHsvF(QColorH handle, qreal* h, qreal* s, qreal* v, qreal* a)
{
	((QColor *)handle)->getHsvF(h, s, v, a);
}

void QColor_setHsvF(QColorH handle, qreal h, qreal s, qreal v, qreal a)
{
	((QColor *)handle)->setHsvF(h, s, v, a);
}

int QColor_cyan(QColorH handle)
{
	return (int) ((QColor *)handle)->cyan();
}

int QColor_magenta(QColorH handle)
{
	return (int) ((QColor *)handle)->magenta();
}

int QColor_yellow(QColorH handle)
{
	return (int) ((QColor *)handle)->yellow();
}

int QColor_black(QColorH handle)
{
	return (int) ((QColor *)handle)->black();
}

qreal QColor_cyanF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->cyanF();
}

qreal QColor_magentaF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->magentaF();
}

qreal QColor_yellowF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->yellowF();
}

qreal QColor_blackF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->blackF();
}

void QColor_getCmyk(QColorH handle, int* c, int* m, int* y, int* k, int* a)
{
	((QColor *)handle)->getCmyk(c, m, y, k, a);
}

void QColor_setCmyk(QColorH handle, int c, int m, int y, int k, int a)
{
	((QColor *)handle)->setCmyk(c, m, y, k, a);
}

void QColor_getCmykF(QColorH handle, qreal* c, qreal* m, qreal* y, qreal* k, qreal* a)
{
	((QColor *)handle)->getCmykF(c, m, y, k, a);
}

void QColor_setCmykF(QColorH handle, qreal c, qreal m, qreal y, qreal k, qreal a)
{
	((QColor *)handle)->setCmykF(c, m, y, k, a);
}

int QColor_hslHue(QColorH handle)
{
	return (int) ((QColor *)handle)->hslHue();
}

int QColor_hslSaturation(QColorH handle)
{
	return (int) ((QColor *)handle)->hslSaturation();
}

int QColor_lightness(QColorH handle)
{
	return (int) ((QColor *)handle)->lightness();
}

qreal QColor_hslHueF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->hslHueF();
}

qreal QColor_hslSaturationF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->hslSaturationF();
}

qreal QColor_lightnessF(QColorH handle)
{
	return (qreal) ((QColor *)handle)->lightnessF();
}

void QColor_getHsl(QColorH handle, int* h, int* s, int* l, int* a)
{
	((QColor *)handle)->getHsl(h, s, l, a);
}

void QColor_setHsl(QColorH handle, int h, int s, int l, int a)
{
	((QColor *)handle)->setHsl(h, s, l, a);
}

void QColor_getHslF(QColorH handle, qreal* h, qreal* s, qreal* l, qreal* a)
{
	((QColor *)handle)->getHslF(h, s, l, a);
}

void QColor_setHslF(QColorH handle, qreal h, qreal s, qreal l, qreal a)
{
	((QColor *)handle)->setHslF(h, s, l, a);
}

void QColor_toRgb(QColorH handle, PQColor retval)
{
	*(QColor *)retval = ((QColor *)handle)->toRgb();
}

void QColor_toHsv(QColorH handle, PQColor retval)
{
	*(QColor *)retval = ((QColor *)handle)->toHsv();
}

void QColor_toCmyk(QColorH handle, PQColor retval)
{
	*(QColor *)retval = ((QColor *)handle)->toCmyk();
}

void QColor_toHsl(QColorH handle, PQColor retval)
{
	*(QColor *)retval = ((QColor *)handle)->toHsl();
}

void QColor_convertTo(QColorH handle, PQColor retval, QColor::Spec colorSpec)
{
	*(QColor *)retval = ((QColor *)handle)->convertTo(colorSpec);
}

void QColor_fromRgb(PQColor retval, QRgb rgb)
{
	*(QColor *)retval = QColor::fromRgb(rgb);
}

void QColor_fromRgba(PQColor retval, QRgb rgba)
{
	*(QColor *)retval = QColor::fromRgba(rgba);
}

void QColor_fromRgb2(PQColor retval, int r, int g, int b, int a)
{
	*(QColor *)retval = QColor::fromRgb(r, g, b, a);
}

void QColor_fromRgbF(PQColor retval, qreal r, qreal g, qreal b, qreal a)
{
	*(QColor *)retval = QColor::fromRgbF(r, g, b, a);
}

void QColor_fromHsv(PQColor retval, int h, int s, int v, int a)
{
	*(QColor *)retval = QColor::fromHsv(h, s, v, a);
}

void QColor_fromHsvF(PQColor retval, qreal h, qreal s, qreal v, qreal a)
{
	*(QColor *)retval = QColor::fromHsvF(h, s, v, a);
}

void QColor_fromCmyk(PQColor retval, int c, int m, int y, int k, int a)
{
	*(QColor *)retval = QColor::fromCmyk(c, m, y, k, a);
}

void QColor_fromCmykF(PQColor retval, qreal c, qreal m, qreal y, qreal k, qreal a)
{
	*(QColor *)retval = QColor::fromCmykF(c, m, y, k, a);
}

void QColor_fromHsl(PQColor retval, int h, int s, int l, int a)
{
	*(QColor *)retval = QColor::fromHsl(h, s, l, a);
}

void QColor_fromHslF(PQColor retval, qreal h, qreal s, qreal l, qreal a)
{
	*(QColor *)retval = QColor::fromHslF(h, s, l, a);
}

void QColor_light(QColorH handle, PQColor retval, int f)
{
	*(QColor *)retval = ((QColor *)handle)->light(f);
}

void QColor_lighter(QColorH handle, PQColor retval, int f)
{
	*(QColor *)retval = ((QColor *)handle)->lighter(f);
}

void QColor_dark(QColorH handle, PQColor retval, int f)
{
	*(QColor *)retval = ((QColor *)handle)->dark(f);
}

void QColor_darker(QColorH handle, PQColor retval, int f)
{
	*(QColor *)retval = ((QColor *)handle)->darker(f);
}

bool QColor_isValidColor(PWideString name)
{
	QString t_name;
	copyPWideStringToQString(name, t_name);
	return (bool) QColor::isValidColor(t_name);
}