]> sigrok.org Git - pulseview.git/blobdiff - pv/view/signal.h
Moved highlight pen into SelectableItem
[pulseview.git] / pv / view / signal.h
index 250d3ff36bf04c90ba542629e062f3aba8d99cd2..ece2e5a446218591f066a435454004a550b267f3 100644 (file)
 
 #include <stdint.h>
 
+#include <libsigrok/libsigrok.h>
+
+#include "selectableitem.h"
+
 namespace pv {
 
 namespace data {
@@ -39,16 +43,17 @@ class SignalData;
 
 namespace view {
 
-class Signal
+class Signal : public SelectableItem
 {
+       Q_OBJECT
+
 private:
        static const int LabelHitPadding;
-       static const int LabelHighlightRadius;
 
        static const QPen SignalAxisPen;
 
 protected:
-       Signal(QString name);
+       Signal(const sr_probe *const probe);
 
 public:
        /**
@@ -81,16 +86,6 @@ public:
         */
        void set_v_offset(int v_offset);
 
-       /**
-        * Returns true if the signal has been selected by the user.
-        */
-       bool selected() const;
-
-       /**
-        * Selects or deselects the signal.
-        */
-       void select(bool select = true);
-
        /**
         * Paints the signal with a QPainter
         * @param p the QPainter to paint into.
@@ -156,12 +151,12 @@ private:
        QRectF get_label_rect(int y, int right);
 
 protected:
+       const sr_probe *const _probe;
+
        QString _name;
        QColor _colour;
        int _v_offset;
 
-       bool _selected;
-
        QSizeF _text_size;
 };