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
|
/*
* Copyright (c) 2005 Adrian Page <[email protected]>
*
* This program 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 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. See the
* GNU General Public License for more details.g
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kis_canvas.h"
#include "kis_canvas_painter.h"
#include "kis_qpaintdevice_canvas_painter.h"
KisTQPaintDeviceCanvasPainter::KisTQPaintDeviceCanvasPainter()
{
}
KisTQPaintDeviceCanvasPainter::KisTQPaintDeviceCanvasPainter(const TQPaintDevice *paintDevice)
: m_painter(paintDevice)
{
}
KisTQPaintDeviceCanvasPainter::~KisTQPaintDeviceCanvasPainter()
{
}
bool KisTQPaintDeviceCanvasPainter::begin(KisCanvasWidget *canvasWidget, bool unclipped)
{
TQWidget *widget = dynamic_cast<TQWidget *>(canvasWidget);
if (widget != 0) {
return m_painter.begin(widget, unclipped);
} else {
return false;
}
}
bool KisTQPaintDeviceCanvasPainter::begin(const TQPaintDevice* paintDevice, bool unclipped)
{
return m_painter.begin(paintDevice, unclipped);
}
bool KisTQPaintDeviceCanvasPainter::end()
{
return m_painter.end();
}
void KisTQPaintDeviceCanvasPainter::save()
{
m_painter.save();
}
void KisTQPaintDeviceCanvasPainter::restore()
{
m_painter.restore();
}
TQFontMetrics KisTQPaintDeviceCanvasPainter::fontMetrics() const
{
return m_painter.fontMetrics();
}
TQFontInfo KisTQPaintDeviceCanvasPainter::fontInfo() const
{
return m_painter.fontInfo();
}
const TQFont& KisTQPaintDeviceCanvasPainter::font() const
{
return m_painter.font();
}
void KisTQPaintDeviceCanvasPainter::setFont(const TQFont& font)
{
m_painter.setFont(font);
}
const TQPen& KisTQPaintDeviceCanvasPainter::pen() const
{
return m_painter.pen();
}
void KisTQPaintDeviceCanvasPainter::setPen(const TQPen& pen)
{
m_painter.setPen(pen);
}
void KisTQPaintDeviceCanvasPainter::setPen(Qt::PenStyle penStyle)
{
m_painter.setPen(penStyle);
}
void KisTQPaintDeviceCanvasPainter::setPen(const TQColor& color)
{
m_painter.setPen(color);;
}
const TQBrush& KisTQPaintDeviceCanvasPainter::brush() const
{
return m_painter.brush();
}
void KisTQPaintDeviceCanvasPainter::setBrush(const TQBrush& brush)
{
m_painter.setBrush(brush);
}
void KisTQPaintDeviceCanvasPainter::setBrush(TQt::BrushStyle brushStyle)
{
m_painter.setBrush(brushStyle);
}
void KisTQPaintDeviceCanvasPainter::setBrush(const TQColor& color)
{
m_painter.setBrush(color);
}
TQPoint KisTQPaintDeviceCanvasPainter::pos() const
{
return m_painter.pos();
}
const TQColor& KisTQPaintDeviceCanvasPainter::backgroundColor() const
{
return m_painter.backgroundColor();
}
void KisTQPaintDeviceCanvasPainter::setBackgroundColor(const TQColor& color)
{
m_painter.setBackgroundColor(color);
}
TQt::Qt::BGMode KisTQPaintDeviceCanvasPainter::backgroundMode() const
{
return m_painter.backgroundMode();
}
void KisTQPaintDeviceCanvasPainter::setBackgroundMode(Qt::BGMode bgMode)
{
m_painter.setBackgroundMode(bgMode);
}
TQt::RasterOp KisTQPaintDeviceCanvasPainter::rasterOp() const
{
return m_painter.rasterOp();
}
void KisTQPaintDeviceCanvasPainter::setRasterOp(TQt::RasterOp rasterOp)
{
m_painter.setRasterOp(rasterOp);
}
const TQPoint& KisTQPaintDeviceCanvasPainter::brushOrigin() const
{
return m_painter.brushOrigin();
}
void KisTQPaintDeviceCanvasPainter::setBrushOrigin(int x, int y)
{
m_painter.setBrushOrigin(x, y);
}
void KisTQPaintDeviceCanvasPainter::setBrushOrigin(const TQPoint& origin)
{
m_painter.setBrushOrigin(origin);
}
bool KisTQPaintDeviceCanvasPainter::hasViewXForm() const
{
return m_painter.hasViewXForm();
}
bool KisTQPaintDeviceCanvasPainter::hasWorldXForm() const
{
return m_painter.hasWorldXForm();
}
void KisTQPaintDeviceCanvasPainter::setViewXForm(bool enable)
{
m_painter.setViewXForm(enable);
}
TQRect KisTQPaintDeviceCanvasPainter::window() const
{
return m_painter.window();
}
void KisTQPaintDeviceCanvasPainter::setWindow(const TQRect& r)
{
m_painter.setWindow(r);
}
void KisTQPaintDeviceCanvasPainter::setWindow(int x, int y, int w, int h)
{
m_painter.setWindow(x, y, w, h);
}
TQRect KisTQPaintDeviceCanvasPainter::viewport() const
{
return m_painter.viewport();
}
void KisTQPaintDeviceCanvasPainter::setViewport(const TQRect& r)
{
m_painter.setViewport(r);
}
void KisTQPaintDeviceCanvasPainter::setViewport(int x, int y, int w, int h)
{
m_painter.setViewport(x, y, w, h);
}
void KisTQPaintDeviceCanvasPainter::setWorldXForm(bool enable)
{
m_painter.setWorldXForm(enable);
}
const TQWMatrix& KisTQPaintDeviceCanvasPainter::tqworldMatrix() const
{
return m_painter.tqworldMatrix();
}
void KisTQPaintDeviceCanvasPainter::setWorldMatrix(const TQWMatrix& matrix, bool combine)
{
m_painter.setWorldMatrix(matrix, combine);
}
void KisTQPaintDeviceCanvasPainter::saveWorldMatrix()
{
m_painter.saveWorldMatrix();
}
void KisTQPaintDeviceCanvasPainter::restoreWorldMatrix()
{
m_painter.restoreWorldMatrix();
}
void KisTQPaintDeviceCanvasPainter::scale(double sx, double sy)
{
m_painter.scale(sx, sy);
}
void KisTQPaintDeviceCanvasPainter::shear(double sh, double sv)
{
m_painter.shear(sh, sv);
}
void KisTQPaintDeviceCanvasPainter::rotate(double a)
{
m_painter.rotate(a);
}
void KisTQPaintDeviceCanvasPainter::translate(double dx, double dy)
{
m_painter.translate(dx, dy);
}
void KisTQPaintDeviceCanvasPainter::resetXForm()
{
m_painter.resetXForm();
}
double KisTQPaintDeviceCanvasPainter::translationX() const
{
return m_painter.translationX();
}
double KisTQPaintDeviceCanvasPainter::translationY() const
{
return m_painter.translationY();
}
TQPoint KisTQPaintDeviceCanvasPainter::xForm(const TQPoint& point) const
{
return m_painter.xForm(point);
}
TQRect KisTQPaintDeviceCanvasPainter::xForm(const TQRect& r) const
{
return m_painter.xForm(r);
}
TQPointArray KisTQPaintDeviceCanvasPainter::xForm(const TQPointArray& pointArray) const
{
return m_painter.xForm(pointArray);
}
TQPointArray KisTQPaintDeviceCanvasPainter::xForm(const TQPointArray& pointArray, int index, int npoints) const
{
return m_painter.xForm(pointArray, index, npoints);
}
TQPoint KisTQPaintDeviceCanvasPainter::xFormDev(const TQPoint& point) const
{
return m_painter.xFormDev(point);
}
TQRect KisTQPaintDeviceCanvasPainter::xFormDev(const TQRect& r) const
{
return m_painter.xFormDev(r);
}
TQPointArray KisTQPaintDeviceCanvasPainter::xFormDev(const TQPointArray& pointArray) const
{
return m_painter.xFormDev(pointArray);
}
TQPointArray KisTQPaintDeviceCanvasPainter::xFormDev(const TQPointArray& pointArray, int index, int npoints) const
{
return m_painter.xFormDev(pointArray, index, npoints);
}
void KisTQPaintDeviceCanvasPainter::setClipping(bool enable)
{
m_painter.setClipping(enable);
}
bool KisTQPaintDeviceCanvasPainter::hasClipping() const
{
return m_painter.hasClipping();
}
TQRegion KisTQPaintDeviceCanvasPainter::clipRegion(TQPainter::CoordinateMode mode) const
{
return m_painter.clipRegion(mode);
}
void KisTQPaintDeviceCanvasPainter::setClipRect(const TQRect& r, TQPainter::CoordinateMode mode)
{
m_painter.setClipRect(r, mode);
}
void KisTQPaintDeviceCanvasPainter::setClipRect(int x, int y, int w, int h, TQPainter::CoordinateMode mode)
{
m_painter.setClipRect(x, y, w, h, mode);
}
void KisTQPaintDeviceCanvasPainter::setClipRegion(const TQRegion& rgn, TQPainter::CoordinateMode mode)
{
m_painter.setClipRegion(rgn, mode);
}
void KisTQPaintDeviceCanvasPainter::drawPoint(int x, int y)
{
m_painter.drawPoint(x, y);
}
void KisTQPaintDeviceCanvasPainter::drawPoint(const TQPoint& point)
{
m_painter.drawPoint(point);
}
void KisTQPaintDeviceCanvasPainter::drawPoints(const TQPointArray& pointArray, int index, int npoints)
{
m_painter.drawPoints(pointArray, index, npoints);
}
void KisTQPaintDeviceCanvasPainter::moveTo(int x, int y)
{
m_painter.moveTo(x, y);
}
void KisTQPaintDeviceCanvasPainter::moveTo(const TQPoint& point)
{
m_painter.moveTo(point);
}
void KisTQPaintDeviceCanvasPainter::lineTo(int x, int y)
{
m_painter.lineTo(x, y);
}
void KisTQPaintDeviceCanvasPainter::lineTo(const TQPoint& point)
{
m_painter.lineTo(point);
}
void KisTQPaintDeviceCanvasPainter::drawLine(int x1, int y1, int x2, int y2)
{
m_painter.drawLine(x1, y1, x2, y2);
}
void KisTQPaintDeviceCanvasPainter::drawLine(const TQPoint& start, const TQPoint& end)
{
m_painter.drawLine(start, end);
}
void KisTQPaintDeviceCanvasPainter::drawRect(int x, int y, int w, int h)
{
m_painter.drawRect(x, y, w, h);
}
void KisTQPaintDeviceCanvasPainter::drawRect(const TQRect& r)
{
m_painter.drawRect(r);
}
void KisTQPaintDeviceCanvasPainter::drawWinFocusRect(int x, int y, int w, int h)
{
m_painter.drawWinFocusRect(x, y, w, h);
}
void KisTQPaintDeviceCanvasPainter::drawWinFocusRect(int x, int y, int w, int h, const TQColor& bgColor)
{
m_painter.drawWinFocusRect(x, y, w, h, bgColor);
}
void KisTQPaintDeviceCanvasPainter::drawWinFocusRect(const TQRect& r)
{
m_painter.drawWinFocusRect(r);
}
void KisTQPaintDeviceCanvasPainter::drawWinFocusRect(const TQRect& r, const TQColor& bgColor)
{
m_painter.drawWinFocusRect(r, bgColor);
}
void KisTQPaintDeviceCanvasPainter::drawRoundRect(int x, int y, int w, int h, int xRnd, int yRnd)
{
m_painter.drawRoundRect(x, y, w, h, xRnd, yRnd);
}
void KisTQPaintDeviceCanvasPainter::drawRoundRect(const TQRect& r, int xRnd, int yRnd)
{
m_painter.drawRoundRect(r, xRnd, yRnd);
}
void KisTQPaintDeviceCanvasPainter::drawEllipse(int x, int y, int w, int h)
{
m_painter.drawEllipse(x, y, w, h);
}
void KisTQPaintDeviceCanvasPainter::drawEllipse(const TQRect& r)
{
m_painter.drawEllipse(r);
}
void KisTQPaintDeviceCanvasPainter::drawArc(int x, int y, int w, int h, int a, int alen)
{
m_painter.drawArc(x, y, w, h, a, alen);
}
void KisTQPaintDeviceCanvasPainter::drawArc(const TQRect& r, int a, int alen)
{
m_painter.drawArc(r, a, alen);
}
void KisTQPaintDeviceCanvasPainter::drawPie(int x, int y, int w, int h, int a, int alen)
{
m_painter.drawPie(x, y, w, h, a, alen);
}
void KisTQPaintDeviceCanvasPainter::drawPie(const TQRect& r, int a, int alen)
{
m_painter.drawPie(r, a, alen);
}
void KisTQPaintDeviceCanvasPainter::drawChord(int x, int y, int w, int h, int a, int alen)
{
m_painter.drawChord(x, y, w, h, a, alen);
}
void KisTQPaintDeviceCanvasPainter::drawChord(const TQRect& r, int a, int alen)
{
m_painter.drawChord(r, a, alen);
}
void KisTQPaintDeviceCanvasPainter::drawLineSegments(const TQPointArray& pointArray, int index, int nlines)
{
m_painter.drawLineSegments(pointArray, index, nlines);
}
void KisTQPaintDeviceCanvasPainter::drawPolyline(const TQPointArray& pointArray, int index, int npoints)
{
m_painter.drawPolyline(pointArray, index, npoints);
}
void KisTQPaintDeviceCanvasPainter::drawPolygon(const TQPointArray& pointArray, bool winding, int index, int npoints)
{
m_painter.drawPolygon(pointArray, winding, index, npoints);
}
void KisTQPaintDeviceCanvasPainter::drawConvexPolygon(const TQPointArray& pointArray, int index, int npoints)
{
m_painter.drawConvexPolygon(pointArray, index, npoints);
}
void KisTQPaintDeviceCanvasPainter::drawCubicBezier(const TQPointArray& pointArray, int index)
{
m_painter.drawCubicBezier(pointArray, index);
}
void KisTQPaintDeviceCanvasPainter::drawPixmap(int x, int y, const TQPixmap& pixmap, int sx, int sy, int sw, int sh)
{
m_painter.drawPixmap(x, y, pixmap, sx, sy, sw, sh);
}
void KisTQPaintDeviceCanvasPainter::drawPixmap(const TQPoint& point, const TQPixmap& pixmap, const TQRect& sr)
{
m_painter.drawPixmap(point, pixmap, sr);
}
void KisTQPaintDeviceCanvasPainter::drawPixmap(const TQPoint& point, const TQPixmap& pixmap)
{
m_painter.drawPixmap(point, pixmap);
}
void KisTQPaintDeviceCanvasPainter::drawPixmap(const TQRect& r, const TQPixmap& pixmap)
{
m_painter.drawPixmap(r, pixmap);
}
void KisTQPaintDeviceCanvasPainter::drawImage(int x, int y, const TQImage& image, int sx, int sy, int sw, int sh, int conversionFlags)
{
m_painter.drawImage(x, y, image, sx, sy, sw, sh, conversionFlags);
}
void KisTQPaintDeviceCanvasPainter::drawImage(const TQPoint& point, const TQImage& image, const TQRect& sr, int conversionFlags)
{
m_painter.drawImage(point, image, sr, conversionFlags);
}
void KisTQPaintDeviceCanvasPainter::drawImage(const TQPoint& point, const TQImage& image, int conversion_flags)
{
m_painter.drawImage(point, image, conversion_flags);
}
void KisTQPaintDeviceCanvasPainter::drawImage(const TQRect& r, const TQImage& image)
{
m_painter.drawImage(r, image);
}
void KisTQPaintDeviceCanvasPainter::drawTiledPixmap(int x, int y, int w, int h, const TQPixmap& pixmap, int sx, int sy)
{
m_painter.drawTiledPixmap(x, y, w, h, pixmap, sx, sy);
}
void KisTQPaintDeviceCanvasPainter::drawTiledPixmap(const TQRect& r, const TQPixmap& pixmap, const TQPoint& point)
{
m_painter.drawTiledPixmap(r, pixmap, point);
}
void KisTQPaintDeviceCanvasPainter::drawTiledPixmap(const TQRect& r, const TQPixmap& pixmap)
{
m_painter.drawTiledPixmap(r, pixmap);
}
void KisTQPaintDeviceCanvasPainter::fillRect(int x, int y, int w, int h, const TQBrush& brush)
{
m_painter.fillRect(x, y, w, h, brush);
}
void KisTQPaintDeviceCanvasPainter::fillRect(const TQRect& r, const TQBrush& brush)
{
m_painter.fillRect(r, brush);
}
void KisTQPaintDeviceCanvasPainter::eraseRect(int x, int y, int w, int h)
{
m_painter.eraseRect(x, y, w, h);
}
void KisTQPaintDeviceCanvasPainter::eraseRect(const TQRect& r)
{
m_painter.eraseRect(r);
}
void KisTQPaintDeviceCanvasPainter::drawText(int x, int y, const TQString& text, int len, TQPainter::TextDirection dir)
{
m_painter.drawText(x, y, text, len, dir);
}
void KisTQPaintDeviceCanvasPainter::drawText(const TQPoint& point, const TQString& text, int len, TQPainter::TextDirection dir)
{
m_painter.drawText(point, text, len, dir);
}
void KisTQPaintDeviceCanvasPainter::drawText(int x, int y, const TQString& text, int pos, int len, TQPainter::TextDirection dir)
{
m_painter.drawText(x, y, text, pos, len, dir);
}
void KisTQPaintDeviceCanvasPainter::drawText(const TQPoint& point, const TQString& text, int pos, int len, TQPainter::TextDirection dir)
{
m_painter.drawText(point, text, pos, len, dir);
}
void KisTQPaintDeviceCanvasPainter::drawText(int x, int y, int w, int h, int flags, const TQString& text, int len, TQRect *br, TQTextParag **intern)
{
m_painter.drawText(x, y, w, h, flags, text, len, br, intern);
}
void KisTQPaintDeviceCanvasPainter::drawText(const TQRect& r, int flags, const TQString& text, int len, TQRect *br, TQTextParag **intern)
{
m_painter.drawText(r, flags, text, len, br, intern);
}
void KisTQPaintDeviceCanvasPainter::tqdrawTextItem(int x, int y, const TQTextItem& ti, int textflags)
{
m_painter.tqdrawTextItem(x, y, ti, textflags);
}
void KisTQPaintDeviceCanvasPainter::tqdrawTextItem(const TQPoint& p, const TQTextItem& ti, int textflags)
{
m_painter.tqdrawTextItem(p, ti, textflags);
}
TQRect KisTQPaintDeviceCanvasPainter::boundingRect(int x, int y, int w, int h, int flags, const TQString& text, int len, TQTextParag **intern)
{
return m_painter.boundingRect(x, y, w, h, flags, text, len, intern);
}
TQRect KisTQPaintDeviceCanvasPainter::boundingRect(const TQRect& r, int flags, const TQString& text, int len, TQTextParag **intern)
{
return m_painter.boundingRect(r, flags, text, len, intern);
}
int KisTQPaintDeviceCanvasPainter::tabStops() const
{
return m_painter.tabStops();
}
void KisTQPaintDeviceCanvasPainter::setTabStops(int ts)
{
m_painter.setTabStops(ts);
}
int *KisTQPaintDeviceCanvasPainter::tabArray() const
{
return m_painter.tabArray();
}
void KisTQPaintDeviceCanvasPainter::setTabArray(int *ts)
{
m_painter.setTabArray(ts);
}
|