X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fview.h;h=cc06f80dae12ac19dccdb7f00ca0c7971a1d7368;hp=06616376c96045447dcd81af766bf236f1d1e0a0;hb=bcaa184ed439d801cb1a56b877bb2763246150da;hpb=3925091ab254d42f1ce29ee0df042d343b4113e0 diff --git a/pv/view/view.h b/pv/view/view.h index 06616376..cc06f80d 100644 --- a/pv/view/view.h +++ b/pv/view/view.h @@ -23,18 +23,17 @@ #include +#include #include #include -#include -#include - #include #include #include #include "cursorpair.h" +#include "rowitemowner.h" namespace pv { @@ -42,12 +41,12 @@ class SigSession; namespace view { +class CursorHeader; class Header; class Ruler; -class Trace; class Viewport; -class View : public QAbstractScrollArea { +class View : public QAbstractScrollArea, public RowItemOwner { Q_OBJECT private: @@ -71,6 +70,20 @@ public: SigSession& session(); const SigSession& session() const; + /** + * Returns the view of the owner. + */ + virtual pv::view::View* view(); + + /** + * Returns the view of the owner. + */ + virtual const pv::view::View* view() const; + + Viewport* viewport(); + + const Viewport* viewport() const; + /** * Returns the view time scale in seconds per pixel. */ @@ -81,7 +94,7 @@ public: * seconds. */ double offset() const; - int v_offset() const; + int owner_v_offset() const; void zoom(double steps); void zoom(double steps, int offset); @@ -97,11 +110,7 @@ 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 > + std::set< std::shared_ptr > get_visible_data() const; std::pair get_time_extents() const; @@ -137,7 +146,7 @@ public: void update_viewport(); -signals: +Q_SIGNALS: void hover_point_changed(); void signals_moved(); @@ -161,9 +170,22 @@ private: void update_layout(); - static bool compare_trace_v_offsets( - const boost::shared_ptr &a, - const boost::shared_ptr &b); + /** + * Satisifies RowItem functionality. + * @param p the QPainter to paint into. + * @param right the x-coordinate of the right edge of the header + * area. + * @param hover true if the label is being hovered over by the mouse. + */ + void paint_label(QPainter &p, int right, bool hover); + + /** + * Computes the outline rectangle of a label. + * @param right the x-coordinate of the right edge of the header + * area. + * @return Returns the rectangle of the signal label. + */ + QRectF label_rect(int right); private: bool eventFilter(QObject *object, QEvent *event); @@ -172,7 +194,7 @@ private: void resizeEvent(QResizeEvent *e); -private slots: +private Q_SLOTS: void h_scroll_value_changed(int value); void v_scroll_value_changed(int value); @@ -186,11 +208,14 @@ private slots: void on_geometry_updated(); + void on_hover_point_changed(); + private: SigSession &_session; Viewport *_viewport; Ruler *_ruler; + CursorHeader *_cursorheader; Header *_header; /// The view time scale in seconds per pixel.