X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=sigview.h;h=cc7b78af35fa410a4775907a4d7cb3b996996daa;hb=adb4b10cf99ca7c257b2f749bff90b67286d9992;hp=b43ae9a55e5b0b49987f94b3fb756eed76f97ff8;hpb=e3f65ace22c6bcd371967302f8d01d0769e3a23f;p=pulseview.git diff --git a/sigview.h b/sigview.h index b43ae9a5..cc7b78af 100644 --- a/sigview.h +++ b/sigview.h @@ -21,34 +21,63 @@ #ifndef SIGVIEW_H #define SIGVIEW_H -#include -#include +#include + +#include 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