File: qrect_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 (703 lines) | stat: -rw-r--r-- 15,151 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
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
//******************************************************************************
//  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 "qrect_c.h"

QRectH QRect_Create()
{
	return (QRectH) new QRect();
}

void QRect_Destroy(QRectH handle)
{
	delete (QRect *)handle;
}

QRectH QRect_Create2(const QPointH topleft, const QPointH bottomright)
{
	return (QRectH) new QRect(*(const QPoint*)topleft, *(const QPoint*)bottomright);
}

QRectH QRect_Create3(const QPointH topleft, const QSizeH size)
{
	return (QRectH) new QRect(*(const QPoint*)topleft, *(const QSize*)size);
}

QRectH QRect_Create4(int left, int top, int width, int height)
{
	return (QRectH) new QRect(left, top, width, height);
}

bool QRect_isNull(QRectH handle)
{
	return (bool) ((QRect *)handle)->isNull();
}

bool QRect_isEmpty(QRectH handle)
{
	return (bool) ((QRect *)handle)->isEmpty();
}

bool QRect_isValid(QRectH handle)
{
	return (bool) ((QRect *)handle)->isValid();
}

int QRect_left(QRectH handle)
{
	return (int) ((QRect *)handle)->left();
}

int QRect_top(QRectH handle)
{
	return (int) ((QRect *)handle)->top();
}

int QRect_right(QRectH handle)
{
	return (int) ((QRect *)handle)->right();
}

int QRect_bottom(QRectH handle)
{
	return (int) ((QRect *)handle)->bottom();
}

void QRect_normalized(QRectH handle, PRect retval)
{
	QRect t_retval;
	t_retval = ((QRect *)handle)->normalized();
	copyQRectToPRect(t_retval, retval);
}

int QRect_x(QRectH handle)
{
	return (int) ((QRect *)handle)->x();
}

int QRect_y(QRectH handle)
{
	return (int) ((QRect *)handle)->y();
}

void QRect_setLeft(QRectH handle, int pos)
{
	((QRect *)handle)->setLeft(pos);
}

void QRect_setTop(QRectH handle, int pos)
{
	((QRect *)handle)->setTop(pos);
}

void QRect_setRight(QRectH handle, int pos)
{
	((QRect *)handle)->setRight(pos);
}

void QRect_setBottom(QRectH handle, int pos)
{
	((QRect *)handle)->setBottom(pos);
}

void QRect_setX(QRectH handle, int x)
{
	((QRect *)handle)->setX(x);
}

void QRect_setY(QRectH handle, int y)
{
	((QRect *)handle)->setY(y);
}

void QRect_setTopLeft(QRectH handle, const QPointH p)
{
	((QRect *)handle)->setTopLeft(*(const QPoint*)p);
}

void QRect_setBottomRight(QRectH handle, const QPointH p)
{
	((QRect *)handle)->setBottomRight(*(const QPoint*)p);
}

void QRect_setTopRight(QRectH handle, const QPointH p)
{
	((QRect *)handle)->setTopRight(*(const QPoint*)p);
}

void QRect_setBottomLeft(QRectH handle, const QPointH p)
{
	((QRect *)handle)->setBottomLeft(*(const QPoint*)p);
}

void QRect_topLeft(QRectH handle, PQtPoint retval)
{
	*(QPoint *)retval = ((QRect *)handle)->topLeft();
}

void QRect_bottomRight(QRectH handle, PQtPoint retval)
{
	*(QPoint *)retval = ((QRect *)handle)->bottomRight();
}

void QRect_topRight(QRectH handle, PQtPoint retval)
{
	*(QPoint *)retval = ((QRect *)handle)->topRight();
}

void QRect_bottomLeft(QRectH handle, PQtPoint retval)
{
	*(QPoint *)retval = ((QRect *)handle)->bottomLeft();
}

void QRect_center(QRectH handle, PQtPoint retval)
{
	*(QPoint *)retval = ((QRect *)handle)->center();
}

void QRect_moveLeft(QRectH handle, int pos)
{
	((QRect *)handle)->moveLeft(pos);
}

void QRect_moveTop(QRectH handle, int pos)
{
	((QRect *)handle)->moveTop(pos);
}

void QRect_moveRight(QRectH handle, int pos)
{
	((QRect *)handle)->moveRight(pos);
}

void QRect_moveBottom(QRectH handle, int pos)
{
	((QRect *)handle)->moveBottom(pos);
}

void QRect_moveTopLeft(QRectH handle, const QPointH p)
{
	((QRect *)handle)->moveTopLeft(*(const QPoint*)p);
}

void QRect_moveBottomRight(QRectH handle, const QPointH p)
{
	((QRect *)handle)->moveBottomRight(*(const QPoint*)p);
}

void QRect_moveTopRight(QRectH handle, const QPointH p)
{
	((QRect *)handle)->moveTopRight(*(const QPoint*)p);
}

void QRect_moveBottomLeft(QRectH handle, const QPointH p)
{
	((QRect *)handle)->moveBottomLeft(*(const QPoint*)p);
}

void QRect_moveCenter(QRectH handle, const QPointH p)
{
	((QRect *)handle)->moveCenter(*(const QPoint*)p);
}

void QRect_translate(QRectH handle, int dx, int dy)
{
	((QRect *)handle)->translate(dx, dy);
}

void QRect_translate2(QRectH handle, const QPointH p)
{
	((QRect *)handle)->translate(*(const QPoint*)p);
}

void QRect_translated(QRectH handle, PRect retval, int dx, int dy)
{
	QRect t_retval;
	t_retval = ((QRect *)handle)->translated(dx, dy);
	copyQRectToPRect(t_retval, retval);
}

void QRect_translated2(QRectH handle, PRect retval, const QPointH p)
{
	QRect t_retval;
	t_retval = ((QRect *)handle)->translated(*(const QPoint*)p);
	copyQRectToPRect(t_retval, retval);
}

void QRect_moveTo(QRectH handle, int x, int t)
{
	((QRect *)handle)->moveTo(x, t);
}

void QRect_moveTo2(QRectH handle, const QPointH p)
{
	((QRect *)handle)->moveTo(*(const QPoint*)p);
}

void QRect_setRect(QRectH handle, int x, int y, int w, int h)
{
	((QRect *)handle)->setRect(x, y, w, h);
}

void QRect_getRect(QRectH handle, int* x, int* y, int* w, int* h)
{
	((QRect *)handle)->getRect(x, y, w, h);
}

void QRect_setCoords(QRectH handle, int x1, int y1, int x2, int y2)
{
	((QRect *)handle)->setCoords(x1, y1, x2, y2);
}

void QRect_getCoords(QRectH handle, int* x1, int* y1, int* x2, int* y2)
{
	((QRect *)handle)->getCoords(x1, y1, x2, y2);
}

void QRect_adjust(QRectH handle, int x1, int y1, int x2, int y2)
{
	((QRect *)handle)->adjust(x1, y1, x2, y2);
}

void QRect_adjusted(QRectH handle, PRect retval, int x1, int y1, int x2, int y2)
{
	QRect t_retval;
	t_retval = ((QRect *)handle)->adjusted(x1, y1, x2, y2);
	copyQRectToPRect(t_retval, retval);
}

void QRect_size(QRectH handle, PSize retval)
{
	*(QSize *)retval = ((QRect *)handle)->size();
}

int QRect_width(QRectH handle)
{
	return (int) ((QRect *)handle)->width();
}

int QRect_height(QRectH handle)
{
	return (int) ((QRect *)handle)->height();
}

void QRect_setWidth(QRectH handle, int w)
{
	((QRect *)handle)->setWidth(w);
}

void QRect_setHeight(QRectH handle, int h)
{
	((QRect *)handle)->setHeight(h);
}

void QRect_setSize(QRectH handle, const QSizeH s)
{
	((QRect *)handle)->setSize(*(const QSize*)s);
}

bool QRect_contains(QRectH handle, PRect r, bool proper)
{
	QRect t_r;
	copyPRectToQRect(r, t_r);
	return (bool) ((QRect *)handle)->contains(t_r, proper);
}

bool QRect_contains2(QRectH handle, const QPointH p, bool proper)
{
	return (bool) ((QRect *)handle)->contains(*(const QPoint*)p, proper);
}

bool QRect_contains3(QRectH handle, int x, int y)
{
	return (bool) ((QRect *)handle)->contains(x, y);
}

bool QRect_contains4(QRectH handle, int x, int y, bool proper)
{
	return (bool) ((QRect *)handle)->contains(x, y, proper);
}

void QRect_united(QRectH handle, PRect retval, PRect other)
{
	QRect t_retval;
	QRect t_other;
	copyPRectToQRect(other, t_other);
	t_retval = ((QRect *)handle)->united(t_other);
	copyQRectToPRect(t_retval, retval);
}

void QRect_intersected(QRectH handle, PRect retval, PRect other)
{
	QRect t_retval;
	QRect t_other;
	copyPRectToQRect(other, t_other);
	t_retval = ((QRect *)handle)->intersected(t_other);
	copyQRectToPRect(t_retval, retval);
}

bool QRect_intersects(QRectH handle, PRect r)
{
	QRect t_r;
	copyPRectToQRect(r, t_r);
	return (bool) ((QRect *)handle)->intersects(t_r);
}

void QRect_marginsAdded(QRectH handle, PRect retval, const QMarginsH margins)
{
	QRect t_retval;
	t_retval = ((QRect *)handle)->marginsAdded(*(const QMargins*)margins);
	copyQRectToPRect(t_retval, retval);
}

void QRect_marginsRemoved(QRectH handle, PRect retval, const QMarginsH margins)
{
	QRect t_retval;
	t_retval = ((QRect *)handle)->marginsRemoved(*(const QMargins*)margins);
	copyQRectToPRect(t_retval, retval);
}

QRectFH QRectF_Create()
{
	return (QRectFH) new QRectF();
}

void QRectF_Destroy(QRectFH handle)
{
	delete (QRectF *)handle;
}

QRectFH QRectF_Create2(const QPointFH topleft, const QSizeFH size)
{
	return (QRectFH) new QRectF(*(const QPointF*)topleft, *(const QSizeF*)size);
}

QRectFH QRectF_Create3(const QPointFH topleft, const QPointFH bottomRight)
{
	return (QRectFH) new QRectF(*(const QPointF*)topleft, *(const QPointF*)bottomRight);
}

QRectFH QRectF_Create4(qreal left, qreal top, qreal width, qreal height)
{
	return (QRectFH) new QRectF(left, top, width, height);
}

QRectFH QRectF_Create5(PRect rect)
{
	QRect t_rect;
	copyPRectToQRect(rect, t_rect);
	return (QRectFH) new QRectF(t_rect);
}

bool QRectF_isNull(QRectFH handle)
{
	return (bool) ((QRectF *)handle)->isNull();
}

bool QRectF_isEmpty(QRectFH handle)
{
	return (bool) ((QRectF *)handle)->isEmpty();
}

bool QRectF_isValid(QRectFH handle)
{
	return (bool) ((QRectF *)handle)->isValid();
}

void QRectF_normalized(QRectFH handle, QRectFH retval)
{
	*(QRectF *)retval = ((QRectF *)handle)->normalized();
}

qreal QRectF_left(QRectFH handle)
{
	return (qreal) ((QRectF *)handle)->left();
}

qreal QRectF_top(QRectFH handle)
{
	return (qreal) ((QRectF *)handle)->top();
}

qreal QRectF_right(QRectFH handle)
{
	return (qreal) ((QRectF *)handle)->right();
}

qreal QRectF_bottom(QRectFH handle)
{
	return (qreal) ((QRectF *)handle)->bottom();
}

qreal QRectF_x(QRectFH handle)
{
	return (qreal) ((QRectF *)handle)->x();
}

qreal QRectF_y(QRectFH handle)
{
	return (qreal) ((QRectF *)handle)->y();
}

void QRectF_setLeft(QRectFH handle, qreal pos)
{
	((QRectF *)handle)->setLeft(pos);
}

void QRectF_setTop(QRectFH handle, qreal pos)
{
	((QRectF *)handle)->setTop(pos);
}

void QRectF_setRight(QRectFH handle, qreal pos)
{
	((QRectF *)handle)->setRight(pos);
}

void QRectF_setBottom(QRectFH handle, qreal pos)
{
	((QRectF *)handle)->setBottom(pos);
}

void QRectF_setX(QRectFH handle, qreal pos)
{
	((QRectF *)handle)->setX(pos);
}

void QRectF_setY(QRectFH handle, qreal pos)
{
	((QRectF *)handle)->setY(pos);
}

void QRectF_topLeft(QRectFH handle, PQtPointF retval)
{
	*(QPointF *)retval = ((QRectF *)handle)->topLeft();
}

void QRectF_bottomRight(QRectFH handle, PQtPointF retval)
{
	*(QPointF *)retval = ((QRectF *)handle)->bottomRight();
}

void QRectF_topRight(QRectFH handle, PQtPointF retval)
{
	*(QPointF *)retval = ((QRectF *)handle)->topRight();
}

void QRectF_bottomLeft(QRectFH handle, PQtPointF retval)
{
	*(QPointF *)retval = ((QRectF *)handle)->bottomLeft();
}

void QRectF_center(QRectFH handle, PQtPointF retval)
{
	*(QPointF *)retval = ((QRectF *)handle)->center();
}

void QRectF_setTopLeft(QRectFH handle, const QPointFH p)
{
	((QRectF *)handle)->setTopLeft(*(const QPointF*)p);
}

void QRectF_setBottomRight(QRectFH handle, const QPointFH p)
{
	((QRectF *)handle)->setBottomRight(*(const QPointF*)p);
}

void QRectF_setTopRight(QRectFH handle, const QPointFH p)
{
	((QRectF *)handle)->setTopRight(*(const QPointF*)p);
}

void QRectF_setBottomLeft(QRectFH handle, const QPointFH p)
{
	((QRectF *)handle)->setBottomLeft(*(const QPointF*)p);
}

void QRectF_moveLeft(QRectFH handle, qreal pos)
{
	((QRectF *)handle)->moveLeft(pos);
}

void QRectF_moveTop(QRectFH handle, qreal pos)
{
	((QRectF *)handle)->moveTop(pos);
}

void QRectF_moveRight(QRectFH handle, qreal pos)
{
	((QRectF *)handle)->moveRight(pos);
}

void QRectF_moveBottom(QRectFH handle, qreal pos)
{
	((QRectF *)handle)->moveBottom(pos);
}

void QRectF_moveTopLeft(QRectFH handle, const QPointFH p)
{
	((QRectF *)handle)->moveTopLeft(*(const QPointF*)p);
}

void QRectF_moveBottomRight(QRectFH handle, const QPointFH p)
{
	((QRectF *)handle)->moveBottomRight(*(const QPointF*)p);
}

void QRectF_moveTopRight(QRectFH handle, const QPointFH p)
{
	((QRectF *)handle)->moveTopRight(*(const QPointF*)p);
}

void QRectF_moveBottomLeft(QRectFH handle, const QPointFH p)
{
	((QRectF *)handle)->moveBottomLeft(*(const QPointF*)p);
}

void QRectF_moveCenter(QRectFH handle, const QPointFH p)
{
	((QRectF *)handle)->moveCenter(*(const QPointF*)p);
}

void QRectF_translate(QRectFH handle, qreal dx, qreal dy)
{
	((QRectF *)handle)->translate(dx, dy);
}

void QRectF_translate2(QRectFH handle, const QPointFH p)
{
	((QRectF *)handle)->translate(*(const QPointF*)p);
}

void QRectF_translated(QRectFH handle, QRectFH retval, qreal dx, qreal dy)
{
	*(QRectF *)retval = ((QRectF *)handle)->translated(dx, dy);
}

void QRectF_translated2(QRectFH handle, QRectFH retval, const QPointFH p)
{
	*(QRectF *)retval = ((QRectF *)handle)->translated(*(const QPointF*)p);
}

void QRectF_moveTo(QRectFH handle, qreal x, qreal t)
{
	((QRectF *)handle)->moveTo(x, t);
}

void QRectF_moveTo2(QRectFH handle, const QPointFH p)
{
	((QRectF *)handle)->moveTo(*(const QPointF*)p);
}

void QRectF_setRect(QRectFH handle, qreal x, qreal y, qreal w, qreal h)
{
	((QRectF *)handle)->setRect(x, y, w, h);
}

void QRectF_getRect(QRectFH handle, qreal* x, qreal* y, qreal* w, qreal* h)
{
	((QRectF *)handle)->getRect(x, y, w, h);
}

void QRectF_setCoords(QRectFH handle, qreal x1, qreal y1, qreal x2, qreal y2)
{
	((QRectF *)handle)->setCoords(x1, y1, x2, y2);
}

void QRectF_getCoords(QRectFH handle, qreal* x1, qreal* y1, qreal* x2, qreal* y2)
{
	((QRectF *)handle)->getCoords(x1, y1, x2, y2);
}

void QRectF_adjust(QRectFH handle, qreal x1, qreal y1, qreal x2, qreal y2)
{
	((QRectF *)handle)->adjust(x1, y1, x2, y2);
}

void QRectF_adjusted(QRectFH handle, QRectFH retval, qreal x1, qreal y1, qreal x2, qreal y2)
{
	*(QRectF *)retval = ((QRectF *)handle)->adjusted(x1, y1, x2, y2);
}

void QRectF_size(QRectFH handle, QSizeFH retval)
{
	*(QSizeF *)retval = ((QRectF *)handle)->size();
}

qreal QRectF_width(QRectFH handle)
{
	return (qreal) ((QRectF *)handle)->width();
}

qreal QRectF_height(QRectFH handle)
{
	return (qreal) ((QRectF *)handle)->height();
}

void QRectF_setWidth(QRectFH handle, qreal w)
{
	((QRectF *)handle)->setWidth(w);
}

void QRectF_setHeight(QRectFH handle, qreal h)
{
	((QRectF *)handle)->setHeight(h);
}

void QRectF_setSize(QRectFH handle, const QSizeFH s)
{
	((QRectF *)handle)->setSize(*(const QSizeF*)s);
}

bool QRectF_contains(QRectFH handle, const QRectFH r)
{
	return (bool) ((QRectF *)handle)->contains(*(const QRectF*)r);
}

bool QRectF_contains2(QRectFH handle, const QPointFH p)
{
	return (bool) ((QRectF *)handle)->contains(*(const QPointF*)p);
}

bool QRectF_contains3(QRectFH handle, qreal x, qreal y)
{
	return (bool) ((QRectF *)handle)->contains(x, y);
}

void QRectF_united(QRectFH handle, QRectFH retval, const QRectFH other)
{
	*(QRectF *)retval = ((QRectF *)handle)->united(*(const QRectF*)other);
}

void QRectF_intersected(QRectFH handle, QRectFH retval, const QRectFH other)
{
	*(QRectF *)retval = ((QRectF *)handle)->intersected(*(const QRectF*)other);
}

bool QRectF_intersects(QRectFH handle, const QRectFH r)
{
	return (bool) ((QRectF *)handle)->intersects(*(const QRectF*)r);
}

void QRectF_toRect(QRectFH handle, PRect retval)
{
	QRect t_retval;
	t_retval = ((QRectF *)handle)->toRect();
	copyQRectToPRect(t_retval, retval);
}

void QRectF_toAlignedRect(QRectFH handle, PRect retval)
{
	QRect t_retval;
	t_retval = ((QRectF *)handle)->toAlignedRect();
	copyQRectToPRect(t_retval, retval);
}