X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fcursorpair.h;h=2e70f7da92b9dca7dec6770713624aefa8cf8b8c;hp=8c721bb63407a648044538627211160491bd7f3b;hb=58864c5c5dffac4254f199356aaeb5eabd608630;hpb=b42d25c43e52c900cbdd3e5cde0282961b8721e7 diff --git a/pv/view/cursorpair.h b/pv/view/cursorpair.h index 8c721bb6..2e70f7da 100644 --- a/pv/view/cursorpair.h +++ b/pv/view/cursorpair.h @@ -23,6 +23,10 @@ #include "cursor.h" +#include + +#include + class QPainter; namespace pv { @@ -30,6 +34,9 @@ namespace view { class CursorPair { +private: + static const int DeltaPadding; + public: /** * Constructor. @@ -38,28 +45,34 @@ public: CursorPair(const View &view); /** - * Returns a reference to the first cursor. + * Returns a pointer to the first cursor. */ - Cursor& first(); + boost::shared_ptr first() const; /** - * Returns a reference to the first cursor. + * Returns a pointer to the second cursor. */ - const Cursor& first() const; + boost::shared_ptr second() const; - /** - * Returns a reference to the second cursor. - */ - Cursor& second(); +public: + QRectF get_label_rect(const QRect &rect) const; - /** - * Returns a reference to the second cursor. - */ - const Cursor& second() const; + void draw_markers(QPainter &p, + const QRect &rect, unsigned int prefix); + + void draw_viewport_background(QPainter &p, const QRect &rect); + + 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