krita
kis_opengl_canvas.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KIS_OPENGL_CANVAS_H_
00020 #define KIS_OPENGL_CANVAS_H_
00021
00022 #ifdef HAVE_CONFIG_H
00023 #include <config.h>
00024 #endif
00025
00026 #ifdef HAVE_GL
00027
00028 #include <qwidget.h>
00029 #include <qgl.h>
00030
00031 #include "kis_global.h"
00032 #include "kis_canvas.h"
00033
00034 #ifdef Q_WS_X11
00035 #include <X11/Xlib.h>
00036 #endif // Q_WS_X11
00037
00038 #define KisOpenGLCanvasFormat (QGL::DoubleBuffer|QGL::Rgba|QGL::DirectRendering|QGL::NoDepthBuffer)
00039
00040 class KisOpenGLCanvasWidget : public virtual QGLWidget, public virtual KisCanvasWidget {
00041 public:
00042 KisOpenGLCanvasWidget(QWidget *parent, const char *name, QGLWidget *sharedContextWidget);
00043 ~KisOpenGLCanvasWidget();
00044
00045 virtual KisCanvasWidgetPainter *createPainter();
00046
00047 #if defined(EXTENDED_X11_TABLET_SUPPORT)
00048 virtual void selectTabletDeviceEvents();
00049 #endif
00050
00051 protected:
00052 virtual void paintEvent(QPaintEvent *event);
00053 virtual void mousePressEvent(QMouseEvent *event);
00054 virtual void mouseReleaseEvent(QMouseEvent *event);
00055 virtual void mouseDoubleClickEvent(QMouseEvent *event);
00056 virtual void mouseMoveEvent(QMouseEvent *event);
00057 virtual void tabletEvent(QTabletEvent *event);
00058 virtual void enterEvent(QEvent *event );
00059 virtual void leaveEvent(QEvent *event);
00060 virtual void wheelEvent(QWheelEvent *event);
00061 virtual void keyPressEvent(QKeyEvent *event);
00062 virtual void keyReleaseEvent(QKeyEvent *event);
00063 virtual void dragEnterEvent(QDragEnterEvent *event);
00064 virtual void dropEvent(QDropEvent *event);
00065 #ifdef Q_WS_X11
00066 bool x11Event(XEvent *event);
00067 #endif // Q_WS_X11
00068 };
00069 #endif // HAVE_GL
00070
00071 #endif // KIS_OPENGL_CANVAS_H_
00072
|