chalk

kis_qpaintdevice_canvas.cpp
1/*
2 * Copyright (c) 1999 Matthias Elter <me@kde.org>
3 * Copyright (c) 2004 Adrian Page <adrian@pagenet.plus.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.g
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#include "kis_canvas.h"
21#include "kis_canvas_painter.h"
22#include "kis_qpaintdevice_canvas.h"
23#include "kis_qpaintdevice_canvas_painter.h"
24#include <kdebug.h>
25
26KisTQPaintDeviceCanvasWidget::KisTQPaintDeviceCanvasWidget(TQWidget *parent, const char *name)
27 : TQWidget(parent, name)
28{
29}
30
31KisTQPaintDeviceCanvasWidget::~KisTQPaintDeviceCanvasWidget()
32{
33}
34
35void KisTQPaintDeviceCanvasWidget::paintEvent(TQPaintEvent *e)
36{
37 widgetGotPaintEvent(e);
38}
39
40void KisTQPaintDeviceCanvasWidget::mousePressEvent(TQMouseEvent *e)
41{
42 widgetGotMousePressEvent(e);
43}
44
45void KisTQPaintDeviceCanvasWidget::mouseReleaseEvent(TQMouseEvent *e)
46{
47 widgetGotMouseReleaseEvent(e);
48}
49
50void KisTQPaintDeviceCanvasWidget::mouseDoubleClickEvent(TQMouseEvent *e)
51{
52 widgetGotMouseDoubleClickEvent(e);
53}
54
55void KisTQPaintDeviceCanvasWidget::mouseMoveEvent(TQMouseEvent *e)
56{
57 widgetGotMouseMoveEvent(e);
58}
59
60void KisTQPaintDeviceCanvasWidget::tabletEvent(TQTabletEvent *e)
61{
62 widgetGotTabletEvent(e);
63}
64
65void KisTQPaintDeviceCanvasWidget::enterEvent(TQEvent *e)
66{
67 widgetGotEnterEvent(e);
68}
69
70void KisTQPaintDeviceCanvasWidget::leaveEvent(TQEvent *e)
71{
72 widgetGotLeaveEvent(e);
73}
74
75void KisTQPaintDeviceCanvasWidget::wheelEvent(TQWheelEvent *e)
76{
77 widgetGotWheelEvent(e);
78}
79
80void KisTQPaintDeviceCanvasWidget::keyPressEvent(TQKeyEvent *e)
81{
82 widgetGotKeyPressEvent(e);
83}
84
85void KisTQPaintDeviceCanvasWidget::keyReleaseEvent(TQKeyEvent *e)
86{
87 widgetGotKeyReleaseEvent(e);
88}
89
90void KisTQPaintDeviceCanvasWidget::dragEnterEvent(TQDragEnterEvent *e)
91{
92 widgetGotDragEnterEvent(e);
93}
94
95void KisTQPaintDeviceCanvasWidget::dropEvent(TQDropEvent *e)
96{
97 widgetGotDropEvent(e);
98}
99
100#ifdef TQ_WS_X11
101
102bool KisTQPaintDeviceCanvasWidget::x11Event(XEvent *event)
103{
104 return KisCanvasWidget::x11Event(event, x11Display(), winId(), mapToGlobal(TQPoint(0, 0)));
105}
106
107#endif // TQ_WS_X11
108
109KisCanvasWidgetPainter *KisTQPaintDeviceCanvasWidget::createPainter()
110{
111 return new KisTQPaintDeviceCanvasPainter(this);
112}
113
114#if defined(EXTENDED_X11_TABLET_SUPPORT)
115void KisTQPaintDeviceCanvasWidget::selectTabletDeviceEvents()
116{
117 KisCanvasWidget::selectTabletDeviceEvents(this);
118}
119#endif
120