]> sigrok.org Git - pulseview.git/blobdiff - pv/view/trace.h
Refactored common row functionality into RowItem
[pulseview.git] / pv / view / trace.h
index c6c92e2d619d1a24572602b81a5f4594c888a6ea..ef327edb29a0207fb660c7b915f46b23487573f9 100644 (file)
 
 #include <stdint.h>
 
-#include "selectableitem.h"
+#include "rowitem.h"
 
 class QFormLayout;
 
 namespace pv {
-namespace view {
 
-class View;
+namespace widgets {
+class Popup;
+}
+
+namespace view {
 
-class Trace : public SelectableItem
+class Trace : public RowItem
 {
        Q_OBJECT
 
@@ -70,47 +73,6 @@ public:
         */
        void set_colour(QColor colour);
 
-       /**
-        * Gets the vertical layout offset of this signal.
-        */
-       int get_v_offset() const;
-
-       /**
-        * Sets the vertical layout offset of this signal.
-        */
-       void set_v_offset(int v_offset);
-
-       /**
-        * Returns true if the trace is visible and enabled.
-        */
-       virtual bool enabled() const = 0;
-
-       void set_view(pv::view::View *view);
-
-       /**
-        * Paints the background layer of the trace with a QPainter
-        * @param p the QPainter to paint into.
-        * @param left the x-coordinate of the left edge of the signal
-        * @param right the x-coordinate of the right edge of the signal
-        **/
-       virtual void paint_back(QPainter &p, int left, int right);
-
-       /**
-        * Paints the mid-layer of the trace with a QPainter
-        * @param p the QPainter to paint into.
-        * @param left the x-coordinate of the left edge of the signal
-        * @param right the x-coordinate of the right edge of the signal
-        **/
-       virtual void paint_mid(QPainter &p, int left, int right);
-
-       /**
-        * Paints the foreground layer of the trace with a QPainter
-        * @param p the QPainter to paint into.
-        * @param left the x-coordinate of the left edge of the signal
-        * @param right the x-coordinate of the right edge of the signal
-        **/
-       virtual void paint_fore(QPainter &p, int left, int right);
-
        /**
         * Paints the signal label.
         * @param p the QPainter to paint into.
@@ -124,11 +86,6 @@ public:
 
        pv::widgets::Popup* create_popup(QWidget *parent);
 
-       /**
-        * Gets the y-offset of the axis.
-        */
-       int get_y() const;
-
        /**
         * Computes the outline rectangle of a label.
         * @param right the x-coordinate of the right edge of the header
@@ -137,9 +94,6 @@ public:
         */
        QRectF label_rect(int right);
 
-public:
-       virtual void hover_point_changed();
-
 protected:
 
        /**
@@ -178,11 +132,8 @@ Q_SIGNALS:
        void colour_changed();
 
 protected:
-       pv::view::View *_view;
-
        QString _name;
        QColor _colour;
-       int _v_offset;
 
 private:
        pv::widgets::Popup *_popup;