X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=signal.h;h=edab476deb7d31c22f0b16929c2221e82e05cb1a;hp=ac23a3fa214a81255855934d13cb2f64430e9b07;hb=0b02e0578cf750906b20848d98e73b21c23eda42;hpb=fb0d32cb540e2ae39d80f7eab02779fb965d9f46 diff --git a/signal.h b/signal.h index ac23a3fa..edab476d 100644 --- a/signal.h +++ b/signal.h @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -30,6 +31,9 @@ class SignalData; class Signal { +private: + static const QSizeF LabelPadding; + protected: Signal(QString name); @@ -47,6 +51,26 @@ public: virtual void paint(QGLWidget &widget, const QRect &rect, double scale, double offset) = 0; + /** + * Paints the signal label into a QGLWidget. + * @param p the QPainter to paint into. + * @param rect the rectangular area to draw the label into. + */ + virtual void paint_label(QPainter &p, const QRect &rect); + +protected: + + /** + * Get the colour of the logic signal + */ + virtual QColor get_colour() const = 0; + + /** + * When painting into the rectangle, calculate the y + * offset of the zero point. + **/ + virtual int get_nominal_offset(const QRect &rect) const = 0; + protected: QString _name; };