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