krita

kis_qpaintdevice_canvas.h

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.
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 #ifndef KIS_QPAINTDEVICE_CANVAS_H_
00021 #define KIS_QPAINTDEVICE_CANVAS_H_
00022 
00023 #ifdef HAVE_CONFIG_H
00024 #include <config.h>
00025 #endif
00026 
00027 #include <qwidget.h>
00028 
00029 #include "kis_global.h"
00030 #include "kis_canvas.h"
00031 
00032 #ifdef Q_WS_X11
00033 #include <X11/Xlib.h>
00034 #endif // Q_WS_X11
00035 
00036 class KisQPaintDeviceCanvasWidget : public virtual QWidget, public virtual KisCanvasWidget {
00037 public:
00038     KisQPaintDeviceCanvasWidget(QWidget *parent = 0, const char *name = 0);
00039     ~KisQPaintDeviceCanvasWidget();
00040 
00041     virtual KisCanvasWidgetPainter *createPainter();
00042 
00043 #if defined(EXTENDED_X11_TABLET_SUPPORT)
00044     virtual void selectTabletDeviceEvents();
00045 #endif
00046 
00047 protected:
00048     virtual void paintEvent(QPaintEvent *event);
00049     virtual void mousePressEvent(QMouseEvent *event);
00050     virtual void mouseReleaseEvent(QMouseEvent *event);
00051     virtual void mouseDoubleClickEvent(QMouseEvent *event);
00052     virtual void mouseMoveEvent(QMouseEvent *event);
00053     virtual void tabletEvent(QTabletEvent *event);
00054     virtual void enterEvent(QEvent *event );
00055     virtual void leaveEvent(QEvent *event);
00056     virtual void wheelEvent(QWheelEvent *event);
00057     virtual void keyPressEvent(QKeyEvent *event);
00058     virtual void keyReleaseEvent(QKeyEvent *event);
00059     virtual void dragEnterEvent(QDragEnterEvent *event);
00060     virtual void dropEvent(QDropEvent *event);
00061 #ifdef Q_WS_X11
00062     bool x11Event(XEvent *event);
00063 #endif // Q_WS_X11
00064 };
00065 
00066 #endif // KIS_QPAINTDEVICE_CANVAS_H_
00067 
KDE Home | KDE Accessibility Home | Description of Access Keys