19 #ifndef OST_GUI_GL_CANVAS_HH
20 #define OST_GUI_GL_CANVAS_HH
33 #include <QBasicTimer>
37 namespace ost {
namespace gui {
48 const QGLFormat& f = QGLFormat::defaultFormat());
51 virtual void MakeActive();
52 virtual void DoRefresh();
53 virtual void StatusMessage(
const String& m);
54 virtual bool HasStereo()
const {
return format().stereo();};
61 void SetTestMode(
bool f);
67 void Select(
const String& query);
68 void CopySelectionToClipboard();
70 virtual void initializeGL();
71 virtual void resizeGL(
int w,
int h);
72 virtual void paintGL();
74 virtual void mouseMoveEvent(QMouseEvent* event);
75 virtual void mousePressEvent(QMouseEvent* event);
76 virtual void mouseReleaseEvent(QMouseEvent* event);
77 virtual void mouseDoubleClickEvent(QMouseEvent* event);
79 virtual void keyPressEvent(QKeyEvent* event);
80 virtual void keyReleaseEvent(QKeyEvent* event);
81 virtual void timerEvent(QTimerEvent * event);
82 virtual void wheelEvent(QWheelEvent* event);
83 virtual bool event(QEvent* event);
85 virtual void RequestContextMenu(
const QPoint& pos);
88 #if QT_VERSION >= 0x040600
89 bool GestureEvent(QGestureEvent* event);
91 bool IsToolEvent(QInputEvent* event)
const;
93 void HandleMousePressEvent(QMouseEvent* event);
94 void HandleMouseReleaseEvent(QMouseEvent* event);
95 void HandleMouseMoveEvent(QMouseEvent* event);
96 void build_context_menu();
97 void prepare_context_menu(
const QPoint& pos);
101 QBasicTimer master_timer_;
106 float angular_speed_;
107 #if QT_VERSION>=0x04600
108 QBasicTimer gesture_timer_;