]> sigrok.org Git - pulseview.git/blobdiff - pv/view/cursorpair.h
Added decoder stack item deletion
[pulseview.git] / pv / view / cursorpair.h
index 2bf85d835b775bc7b20245ce981401b4002575df..815276e24c0ca997faf2af5e780da632cb6108eb 100644 (file)
@@ -23,6 +23,8 @@
 
 #include "cursor.h"
 
+#include <boost/shared_ptr.hpp>
+
 #include <QPainter>
 
 class QPainter;
@@ -32,41 +34,45 @@ 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);
+       CursorPair(View &view);
 
        /**
-        * Returns a reference to the first cursor.
+        * Returns a pointer to the first cursor.
         */
-       Cursor& first();
+       boost::shared_ptr<Cursor> first() const;
 
        /**
-        * Returns a reference to the first cursor.
+        * Returns a pointer to the second cursor.
         */
-       const Cursor& first() const;
+       boost::shared_ptr<Cursor> 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);
 
-public:
        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<float, float> get_cursor_offsets() const;
+
 private:
-       Cursor _first, _second;
+       boost::shared_ptr<Cursor> _first, _second;
        const View &_view;
+
+       QSizeF _text_size;
 };
 
 } // namespace view