X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fcursorpair.h;h=815276e24c0ca997faf2af5e780da632cb6108eb;hp=b152b8083a2db4ff0db7932569e7ae08c836abc3;hb=613d097c5af2d12ffd68e2dfab309b518edca1a6;hpb=199441e4fe68f1ee45f3d4b7617a7166a87c7926 diff --git a/pv/view/cursorpair.h b/pv/view/cursorpair.h index b152b808..815276e2 100644 --- a/pv/view/cursorpair.h +++ b/pv/view/cursorpair.h @@ -23,6 +23,8 @@ #include "cursor.h" +#include + #include class QPainter; @@ -32,34 +34,29 @@ namespace view { class CursorPair { +private: + static const int DeltaPadding; + public: /** * Constructor. * @param view A reference to the view that owns this cursor pair. */ - CursorPair(const View &view); - - /** - * Returns a reference to the first cursor. - */ - Cursor& first(); + CursorPair(View &view); /** - * Returns a reference to the first cursor. + * Returns a pointer to the first cursor. */ - const Cursor& first() const; + boost::shared_ptr first() const; /** - * Returns a reference to the second cursor. + * Returns a pointer to the second cursor. */ - Cursor& second(); - - /** - * Returns a reference to the second cursor. - */ - const Cursor& second() const; + boost::shared_ptr second() const; public: + QRectF get_label_rect(const QRect &rect) const; + void draw_markers(QPainter &p, const QRect &rect, unsigned int prefix); @@ -67,11 +64,15 @@ public: void draw_viewport_foreground(QPainter &p, const QRect &rect); + void compute_text_size(QPainter &p, unsigned int prefix); + std::pair get_cursor_offsets() const; private: - Cursor _first, _second; + boost::shared_ptr _first, _second; const View &_view; + + QSizeF _text_size; }; } // namespace view