X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fviewport.h;h=7d32c4334ff57c24f03474f9b3fe6455039d0eec;hp=690642c28c2de1f05cab75d86698bd7abdaad9fc;hb=0720481923d46cde06148c8a4aec2f96def66643;hpb=1d8dca913d07df3a53184e40246eb2e333520e31 diff --git a/pv/view/viewport.h b/pv/view/viewport.h index 690642c2..7d32c433 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,11 @@ * 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 class QPainter; class QPaintEvent; @@ -33,27 +33,16 @@ namespace view { class View; -class Viewport : public QGLWidget +class Viewport : public QWidget { Q_OBJECT -private: - static const int MinorTickSubdivision; - static const int ScaleUnits[3]; - - static const QString SIPrefixes[9]; - static const int FirstSIPrefixPower; - public: explicit Viewport(View &parent); int get_total_height() const; protected: - void initializeGL(); - - void resizeGL(int width, int height); - void paintEvent(QPaintEvent *event); private: @@ -63,9 +52,12 @@ private: void wheelEvent(QWheelEvent *event); private: - void setup_viewport(int width, int height); + void draw_cursors_background(QPainter &p); + + void draw_cursors_foreground(QPainter &p); - void paint_ruler(QPainter &p); +private slots: + void on_signals_moved(); private: View &_view; @@ -77,4 +69,4 @@ private: } // namespace view } // namespace pv -#endif // PV_VIEW_VIEWPORT_H +#endif // PULSEVIEW_PV_VIEW_VIEWPORT_H