X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdata%2Fdecode%2Frow.hpp;h=80aa114c1edb8dde8514c67f7ee67139a55c0d91;hb=883041605ce8536ece950b1de191cfe71068dfba;hp=b877b58b85b4ca25300dad8d45e12042ad30a7a8;hpb=81dc02212c05c99554194a15f9b584e6b500cda9;p=pulseview.git diff --git a/pv/data/decode/row.hpp b/pv/data/decode/row.hpp index b877b58b..80aa114c 100644 --- a/pv/data/decode/row.hpp +++ b/pv/data/decode/row.hpp @@ -20,23 +20,32 @@ #ifndef PULSEVIEW_PV_DATA_DECODE_ROW_HPP #define PULSEVIEW_PV_DATA_DECODE_ROW_HPP +#include #include -#include -#include +#include +#include struct srd_decoder; struct srd_decoder_annotation_row; +using std::map; +using std::vector; + namespace pv { namespace data { namespace decode { -struct AnnotationClass; +#define DECODE_COLOR_SATURATION (180) /* 0-255 */ +#define DECODE_COLOR_VALUE (170) /* 0-255 */ + +class AnnotationClass; class Decoder; -class Row +class Row: public QObject { + Q_OBJECT + public: Row(); @@ -54,16 +63,31 @@ public: bool visible() const; void set_visible(bool visible); + void set_base_color(QColor base_color); + const QColor color() const; + const QColor get_class_color(uint32_t ann_class_id) const; + const QColor get_bright_class_color(uint32_t ann_class_id) const; + const QColor get_dark_class_color(uint32_t ann_class_id) const; + bool has_hidden_classes() const; + bool class_is_visible(uint32_t ann_class_id) const; bool operator<(const Row& other) const; bool operator==(const Row& other) const; +Q_SIGNALS: + void visibility_changed(); + private: uint32_t index_; Decoder* decoder_; const srd_decoder_annotation_row* srd_row_; bool visible_; + + QColor color_; + map ann_class_color_; + map ann_bright_class_color_; + map ann_dark_class_color_; }; } // namespace decode