X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fdecode%2Fannotation.h;h=94b7dc90c9fabfdb330c9d14f5105018f56612a4;hb=db62bbfda512aeddca5b9d7b5960e9cf24b8859c;hp=baa96657b9d863836b63a6ce95da28e63db28958;hpb=1ae79b11b6b409aae986e379f9280115395c8cf5;p=pulseview.git diff --git a/pv/view/decode/annotation.h b/pv/view/decode/annotation.h index baa9665..94b7dc9 100644 --- a/pv/view/decode/annotation.h +++ b/pv/view/decode/annotation.h @@ -35,17 +35,32 @@ class Annotation { private: static const double EndCapWidth; + static const int DrawPadding; + + static const QColor Colours[7]; public: Annotation(const srd_proto_data *const pdata); - void paint(QPainter &p, QColor fill, QColor outline, - QColor text_colour, int text_height, int left, int right, - double samples_per_pixel, double pixels_offset, int y); + uint64_t start_sample() const; + uint64_t end_sample() const; + + void paint(QPainter &p, QColor text_colour, int text_height, int left, + int right, double samples_per_pixel, double pixels_offset, + int y) const; + +private: + void draw_instant(QPainter &p, QColor fill, QColor outline, + QColor text_color, int h, double x, int y) const; + + void draw_range(QPainter &p, QColor fill, QColor outline, + QColor text_color, int h, double start, + double end, int y) const; private: uint64_t _start_sample; uint64_t _end_sample; + int _format; std::vector _annotations; };