krita

kis_qpaintdevice_canvas.cc

00001 /*
00002  *  Copyright (c) 1999 Matthias Elter  <me@kde.org>
00003  *  Copyright (c) 2004 Adrian Page <adrian@pagenet.plus.com>
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.g
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #include "kis_canvas.h"
00021 #include "kis_canvas_painter.h"
00022 #include "kis_qpaintdevice_canvas.h"
00023 #include "kis_qpaintdevice_canvas_painter.h"
00024 
00025 KisQPaintDeviceCanvasWidget::KisQPaintDeviceCanvasWidget(QWidget *parent, const char *name)
00026     : QWidget(parent, name)
00027 {
00028 }
00029 
00030 KisQPaintDeviceCanvasWidget::~KisQPaintDeviceCanvasWidget()
00031 {
00032 }
00033 
00034 void KisQPaintDeviceCanvasWidget::paintEvent(QPaintEvent *e)
00035 {
00036     widgetGotPaintEvent(e);
00037 }
00038 
00039 void KisQPaintDeviceCanvasWidget::mousePressEvent(QMouseEvent *e)
00040 {
00041     widgetGotMousePressEvent(e);
00042 }
00043 
00044 void KisQPaintDeviceCanvasWidget::mouseReleaseEvent(QMouseEvent *e)
00045 {
00046     widgetGotMouseReleaseEvent(e);
00047 }
00048 
00049 void KisQPaintDeviceCanvasWidget::mouseDoubleClickEvent(QMouseEvent *e)
00050 {
00051     widgetGotMouseDoubleClickEvent(e);
00052 }
00053 
00054 void KisQPaintDeviceCanvasWidget::mouseMoveEvent(QMouseEvent *e)
00055 {
00056     widgetGotMouseMoveEvent(e);
00057 }
00058 
00059 void KisQPaintDeviceCanvasWidget::tabletEvent(QTabletEvent *e)
00060 {
00061     widgetGotTabletEvent(e);
00062 }
00063 
00064 void KisQPaintDeviceCanvasWidget::enterEvent(QEvent *e)
00065 {
00066     widgetGotEnterEvent(e);
00067 }
00068 
00069 void KisQPaintDeviceCanvasWidget::leaveEvent(QEvent *e)
00070 {
00071     widgetGotLeaveEvent(e);
00072 }
00073 
00074 void KisQPaintDeviceCanvasWidget::wheelEvent(QWheelEvent *e)
00075 {
00076     widgetGotWheelEvent(e);
00077 }
00078 
00079 void KisQPaintDeviceCanvasWidget::keyPressEvent(QKeyEvent *e)
00080 {
00081     widgetGotKeyPressEvent(e);
00082 }
00083 
00084 void KisQPaintDeviceCanvasWidget::keyReleaseEvent(QKeyEvent *e)
00085 {
00086     widgetGotKeyReleaseEvent(e);
00087 }
00088 
00089 void KisQPaintDeviceCanvasWidget::dragEnterEvent(QDragEnterEvent *e)
00090 {
00091     widgetGotDragEnterEvent(e);
00092 }
00093 
00094 void KisQPaintDeviceCanvasWidget::dropEvent(QDropEvent *e)
00095 {
00096     widgetGotDropEvent(e);
00097 }
00098 
00099 #ifdef Q_WS_X11
00100 
00101 bool KisQPaintDeviceCanvasWidget::x11Event(XEvent *event)
00102 {
00103     return KisCanvasWidget::x11Event(event, x11Display(), winId(), mapToGlobal(QPoint(0, 0)));
00104 }
00105 
00106 #endif // Q_WS_X11
00107 
00108 KisCanvasWidgetPainter *KisQPaintDeviceCanvasWidget::createPainter()
00109 {
00110     return new KisQPaintDeviceCanvasPainter(this);
00111 }
00112 
00113 #if defined(EXTENDED_X11_TABLET_SUPPORT)
00114 void KisQPaintDeviceCanvasWidget::selectTabletDeviceEvents()
00115 {
00116     KisCanvasWidget::selectTabletDeviceEvents(this);
00117 }
00118 #endif
00119 
KDE Home | KDE Accessibility Home | Description of Access Keys