#ifndef SIGVIEW_H
#define SIGVIEW_H
-#include <QtOpenGL/QGLWidget>
-#include <QTimer>
+#include <stdint.h>
+
+#include <QAbstractScrollArea>
class SigSession;
+class SigViewport;
-class SigView : public QGLWidget
-{
+class SigView : public QAbstractScrollArea {
Q_OBJECT
private:
- static const int SignalHeight;
+ static const double MaxScale;
+ static const double MinScale;
+
+ static const int LabelMarginWidth;
+ static const int RulerHeight;
public:
explicit SigView(SigSession &session, QWidget *parent = 0);
-protected:
+ double scale() const;
+ double offset() const;
+ int v_offset() const;
- void initializeGL();
+ void zoom(double steps);
- void resizeGL(int width, int height);
+ void set_scale_offset(double scale, double offset);
+
+private:
+ void update_scroll();
+
+ void zoom(double steps, int offset);
+
+private:
+ bool viewportEvent(QEvent *e);
- void paintGL();
+ void resizeEvent(QResizeEvent *e);
private slots:
- void dataUpdated();
+ void h_scroll_value_changed(int value);
+ void v_scroll_value_changed(int value);
+
+ void data_updated();
private:
SigSession &_session;
+
+ SigViewport *_viewport;
+
+ uint64_t _data_length;
+
+ double _scale;
+ double _offset;
+
+ int _v_offset;
+
+ friend class SigViewport;
};
#endif // SIGVIEW_H