X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fview.h;h=62157eed76a5613e552571aa0a0e322be3a23c3a;hp=99c124733bfe094b69f7f48c3f46dbe77ff4659c;hb=1bc6525bd6274b7f06f5fa8355b539dd9307f599;hpb=949361337a82aa8765d72d8d475a79ace956945c diff --git a/pv/view/view.h b/pv/view/view.h index 99c12473..62157eed 100644 --- a/pv/view/view.h +++ b/pv/view/view.h @@ -23,11 +23,17 @@ #include +#include +#include + +#include #include #include #include +#include + #include "cursorpair.h" namespace pv { @@ -38,6 +44,7 @@ namespace view { class Header; class Ruler; +class Trace; class Viewport; class View : public QAbstractScrollArea { @@ -47,9 +54,6 @@ private: static const double MaxScale; static const double MinScale; - static const int LabelMarginWidth; - static const int RulerHeight; - static const int MaxScrollValue; public: @@ -65,6 +69,7 @@ public: explicit View(SigSession &session, QWidget *parent = 0); SigSession& session(); + const SigSession& session() const; /** * Returns the view time scale in seconds per pixel. @@ -81,6 +86,10 @@ public: void zoom(double steps); void zoom(double steps, int offset); + void zoom_fit(); + + void zoom_one_to_one(); + /** * Sets the scale and offset. * @param scale The new view scale in seconds per pixel. @@ -88,8 +97,15 @@ public: */ void set_scale_offset(double scale, double offset); + std::vector< boost::shared_ptr > get_traces() const; + std::list > selected_items() const; + std::set< boost::shared_ptr > + get_visible_data() const; + + std::pair get_time_extents() const; + /** * Returns true if cursors are displayed. false otherwise. */ @@ -119,6 +135,8 @@ public: void normalize_layout(); + void update_viewport(); + signals: void hover_point_changed(); @@ -126,12 +144,20 @@ signals: void selection_changed(); + void scale_offset_changed(); + private: void get_scroll_layout(double &length, double &offset) const; + void set_zoom(double scale, int offset); + void update_scroll(); - void reset_signal_layout(); + void update_layout(); + + static bool compare_trace_v_offsets( + const boost::shared_ptr &a, + const boost::shared_ptr &b); private: bool eventFilter(QObject *object, QEvent *event); @@ -152,6 +178,8 @@ private slots: void on_signals_moved(); + void on_geometry_updated(); + private: SigSession &_session; @@ -159,8 +187,6 @@ private: Ruler *_ruler; Header *_header; - uint64_t _data_length; - /// The view time scale in seconds per pixel. double _scale;