chalk

kis_opengl_canvas.h
1/*
2 * Copyright (c) 2005 Adrian Page <adrian@pagenet.plus.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef KIS_OPENGL_CANVAS_H_
20#define KIS_OPENGL_CANVAS_H_
21
22#ifdef HAVE_CONFIG_H
23#include <config.h>
24#endif
25
26#ifdef HAVE_GL
27
28#include <tqwidget.h>
29#include <tqgl.h>
30
31#include "kis_global.h"
32#include "kis_canvas.h"
33
34#ifdef Q_MOC_RUN
35#define TQ_WS_X11
36#endif // Q_MOC_RUN
37
38#ifdef TQ_WS_X11
39#include <X11/Xlib.h>
40#endif // TQ_WS_X11
41
42#define KisOpenGLCanvasFormat (TQGL::DoubleBuffer|TQGL::Rgba|TQGL::DirectRendering|TQGL::NoDepthBuffer)
43
44class KisOpenGLCanvasWidget : public virtual TQGLWidget, public virtual KisCanvasWidget {
45public:
46 KisOpenGLCanvasWidget(TQWidget *parent, const char *name, TQGLWidget *sharedContextWidget);
47 ~KisOpenGLCanvasWidget();
48
49 virtual KisCanvasWidgetPainter *createPainter();
50
51#if defined(EXTENDED_X11_TABLET_SUPPORT)
52 virtual void selectTabletDeviceEvents();
53#endif
54
55protected:
56 virtual void paintEvent(TQPaintEvent *event);
57 virtual void mousePressEvent(TQMouseEvent *event);
58 virtual void mouseReleaseEvent(TQMouseEvent *event);
59 virtual void mouseDoubleClickEvent(TQMouseEvent *event);
60 virtual void mouseMoveEvent(TQMouseEvent *event);
61 virtual void tabletEvent(TQTabletEvent *event);
62 virtual void enterEvent(TQEvent *event );
63 virtual void leaveEvent(TQEvent *event);
64 virtual void wheelEvent(TQWheelEvent *event);
65 virtual void keyPressEvent(TQKeyEvent *event);
66 virtual void keyReleaseEvent(TQKeyEvent *event);
67 virtual void dragEnterEvent(TQDragEnterEvent *event);
68 virtual void dropEvent(TQDropEvent *event);
69#ifdef TQ_WS_X11
70 bool x11Event(XEvent *event);
71#endif // TQ_WS_X11
72};
73#endif // HAVE_GL
74
75#endif // KIS_OPENGL_CANVAS_H_
76