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 #include <kdebug.h>
00025 
00026 KisQPaintDeviceCanvasWidget::KisQPaintDeviceCanvasWidget(QWidget *parent, const char *name)
00027     : QWidget(parent, name)
00028 {
00029 }
00030 
00031 KisQPaintDeviceCanvasWidget::~KisQPaintDeviceCanvasWidget()
00032 {
00033 }
00034 
00035 void KisQPaintDeviceCanvasWidget::paintEvent(QPaintEvent *e)
00036 {
00037     widgetGotPaintEvent(e);
00038 }
00039 
00040 void KisQPaintDeviceCanvasWidget::mousePressEvent(QMouseEvent *e)
00041 {
00042     widgetGotMousePressEvent(e);
00043 }
00044 
00045 void KisQPaintDeviceCanvasWidget::mouseReleaseEvent(QMouseEvent *e)
00046 {
00047     widgetGotMouseReleaseEvent(e);
00048 }
00049 
00050 void KisQPaintDeviceCanvasWidget::mouseDoubleClickEvent(QMouseEvent *e)
00051 {
00052     widgetGotMouseDoubleClickEvent(e);
00053 }
00054 
00055 void KisQPaintDeviceCanvasWidget::mouseMoveEvent(QMouseEvent *e)
00056 {
00057     widgetGotMouseMoveEvent(e);
00058 }
00059 
00060 void KisQPaintDeviceCanvasWidget::tabletEvent(QTabletEvent *e)
00061 {
00062     widgetGotTabletEvent(e);
00063 }
00064 
00065 void KisQPaintDeviceCanvasWidget::enterEvent(QEvent *e)
00066 {
00067     widgetGotEnterEvent(e);
00068 }
00069 
00070 void KisQPaintDeviceCanvasWidget::leaveEvent(QEvent *e)
00071 {
00072     widgetGotLeaveEvent(e);
00073 }
00074 
00075 void KisQPaintDeviceCanvasWidget::wheelEvent(QWheelEvent *e)
00076 {
00077     widgetGotWheelEvent(e);
00078 }
00079 
00080 void KisQPaintDeviceCanvasWidget::keyPressEvent(QKeyEvent *e)
00081 {
00082     widgetGotKeyPressEvent(e);
00083 }
00084 
00085 void KisQPaintDeviceCanvasWidget::keyReleaseEvent(QKeyEvent *e)
00086 {
00087     widgetGotKeyReleaseEvent(e);
00088 }
00089 
00090 void KisQPaintDeviceCanvasWidget::dragEnterEvent(QDragEnterEvent *e)
00091 {
00092     widgetGotDragEnterEvent(e);
00093 }
00094 
00095 void KisQPaintDeviceCanvasWidget::dropEvent(QDropEvent *e)
00096 {
00097     widgetGotDropEvent(e);
00098 }
00099 
00100 #ifdef Q_WS_X11
00101 
00102 bool KisQPaintDeviceCanvasWidget::x11Event(XEvent *event)
00103 {
00104     return KisCanvasWidget::x11Event(event, x11Display(), winId(), mapToGlobal(QPoint(0, 0)));
00105 }
00106 
00107 #endif // Q_WS_X11
00108 
00109 KisCanvasWidgetPainter *KisQPaintDeviceCanvasWidget::createPainter()
00110 {
00111     return new KisQPaintDeviceCanvasPainter(this);
00112 }
00113 
00114 #if defined(EXTENDED_X11_TABLET_SUPPORT)
00115 void KisQPaintDeviceCanvasWidget::selectTabletDeviceEvents()
00116 {
00117     KisCanvasWidget::selectTabletDeviceEvents(this);
00118 }
00119 #endif
00120 
KDE Home | KDE Accessibility Home | Description of Access Keys