X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=pv%2Fview%2Fviewport.h;h=1171a70730c8ed9490e5de549c19b46b250de8a0;hb=8dbbc7f0b9ea59d0f0d62225772f8a56eee125f5;hp=b79526ac2c8d783685aa100b6df8d424dde821fd;hpb=ccdd3ef548ce34f25c6c168598556a350831aa37;p=pulseview.git diff --git a/pv/view/viewport.h b/pv/view/viewport.h index b79526ac..1171a707 100644 --- a/pv/view/viewport.h +++ b/pv/view/viewport.h @@ -1,5 +1,5 @@ /* - * This file is part of the sigrok project. + * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth * @@ -18,11 +18,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef PV_VIEW_VIEWPORT_H -#define PV_VIEW_VIEWPORT_H +#ifndef PULSEVIEW_PV_VIEW_VIEWPORT_H +#define PULSEVIEW_PV_VIEW_VIEWPORT_H -#include #include +#include +#include class QPainter; class QPaintEvent; @@ -33,39 +34,41 @@ namespace view { class View; -class Viewport : public QGLWidget +class Viewport : public QWidget { Q_OBJECT public: explicit Viewport(View &parent); - int get_total_height() const; - protected: - void initializeGL(); - - void resizeGL(int width, int height); - void paintEvent(QPaintEvent *event); private: + bool event(QEvent *event); void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void mouseDoubleClickEvent(QMouseEvent * event); void wheelEvent(QWheelEvent *event); + bool touchEvent(QTouchEvent *e); -private: - void setup_viewport(int width, int height); +private Q_SLOTS: + void on_signals_moved(); private: - View &_view; + View &view_; + + QPoint mouse_down_point_; + double mouse_down_offset_; + bool mouse_down_valid_; - QPoint _mouse_down_point; - double _mouse_down_offset; + double pinch_offset0_; + double pinch_offset1_; + bool pinch_zoom_active_; }; } // namespace view } // namespace pv -#endif // PV_VIEW_VIEWPORT_H +#endif // PULSEVIEW_PV_VIEW_VIEWPORT_H