krita
kis_opengl_canvas.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "kis_canvas.h"
00020 #include "kis_opengl_canvas.h"
00021 #include "kis_opengl_canvas_painter.h"
00022
00023 #ifdef HAVE_GL
00024 KisOpenGLCanvasWidget::KisOpenGLCanvasWidget(QWidget *parent, const char *name, QGLWidget *sharedContextWidget)
00025 : QGLWidget(KisOpenGLCanvasFormat, parent, name, sharedContextWidget)
00026 {
00027 if (isSharing()) {
00028 kdDebug(41001) << "Created QGLWidget with sharing\n";
00029 } else {
00030 kdDebug(41001) << "Created QGLWidget with no sharing\n";
00031 }
00032 }
00033
00034 KisOpenGLCanvasWidget::~KisOpenGLCanvasWidget()
00035 {
00036 }
00037
00038 void KisOpenGLCanvasWidget::paintEvent(QPaintEvent *e)
00039 {
00040 QGLWidget::paintEvent(e);
00041
00042 widgetGotPaintEvent(e);
00043 }
00044
00045 void KisOpenGLCanvasWidget::mousePressEvent(QMouseEvent *e)
00046 {
00047 widgetGotMousePressEvent(e);
00048 }
00049
00050 void KisOpenGLCanvasWidget::mouseReleaseEvent(QMouseEvent *e)
00051 {
00052 widgetGotMouseReleaseEvent(e);
00053 }
00054
00055 void KisOpenGLCanvasWidget::mouseDoubleClickEvent(QMouseEvent *e)
00056 {
00057 widgetGotMouseDoubleClickEvent(e);
00058 }
00059
00060 void KisOpenGLCanvasWidget::mouseMoveEvent(QMouseEvent *e)
00061 {
00062 widgetGotMouseMoveEvent(e);
00063 }
00064
00065 void KisOpenGLCanvasWidget::tabletEvent(QTabletEvent *e)
00066 {
00067 widgetGotTabletEvent(e);
00068 }
00069
00070 void KisOpenGLCanvasWidget::enterEvent(QEvent *e)
00071 {
00072 widgetGotEnterEvent(e);
00073 }
00074
00075 void KisOpenGLCanvasWidget::leaveEvent(QEvent *e)
00076 {
00077 widgetGotLeaveEvent(e);
00078 }
00079
00080 void KisOpenGLCanvasWidget::wheelEvent(QWheelEvent *e)
00081 {
00082 widgetGotWheelEvent(e);
00083 }
00084
00085 void KisOpenGLCanvasWidget::keyPressEvent(QKeyEvent *e)
00086 {
00087 widgetGotKeyPressEvent(e);
00088 }
00089
00090 void KisOpenGLCanvasWidget::keyReleaseEvent(QKeyEvent *e)
00091 {
00092 widgetGotKeyReleaseEvent(e);
00093 }
00094
00095 void KisOpenGLCanvasWidget::dragEnterEvent(QDragEnterEvent *e)
00096 {
00097 widgetGotDragEnterEvent(e);
00098 }
00099
00100 void KisOpenGLCanvasWidget::dropEvent(QDropEvent *e)
00101 {
00102 widgetGotDropEvent(e);
00103 }
00104
00105 #ifdef Q_WS_X11
00106
00107 bool KisOpenGLCanvasWidget::x11Event(XEvent *event)
00108 {
00109 return KisCanvasWidget::x11Event(event, x11Display(), winId(), mapToGlobal(QPoint(0, 0)));
00110 }
00111
00112 #endif // Q_WS_X11
00113
00114 KisCanvasWidgetPainter *KisOpenGLCanvasWidget::createPainter()
00115 {
00116 return new KisOpenGLCanvasPainter(this);
00117 }
00118
00119 #if defined(EXTENDED_X11_TABLET_SUPPORT)
00120 void KisOpenGLCanvasWidget::selectTabletDeviceEvents()
00121 {
00122 KisCanvasWidget::selectTabletDeviceEvents(this);
00123 }
00124 #endif
00125
00126 #endif // HAVE_GL
00127
|