X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fdecode%2Frow.hpp;h=8e76dfa0b64d9a10ac555419cc752cbbbce16b88;hp=2411d4f61afaa2344660429fc2b76348f034a269;hb=02078aa15a4747b8ab7a91d54e2e141c3acb5628;hpb=f98070844c2d468fdbb6beb5b65e4ccbbcd3f10b diff --git a/pv/data/decode/row.hpp b/pv/data/decode/row.hpp index 2411d4f6..8e76dfa0 100644 --- a/pv/data/decode/row.hpp +++ b/pv/data/decode/row.hpp @@ -22,7 +22,10 @@ #include -#include "annotation.hpp" +#include + +#include +#include struct srd_decoder; struct srd_decoder_annotation_row; @@ -31,26 +34,58 @@ namespace pv { namespace data { namespace decode { -class Row +#define DECODE_COLOR_SATURATION (180) /* 0-255 */ +#define DECODE_COLOR_VALUE (170) /* 0-255 */ + +class AnnotationClass; +class Decoder; + +class Row: public QObject { + Q_OBJECT + public: Row(); - Row(int index, const srd_decoder *decoder, - const srd_decoder_annotation_row *row = nullptr); + Row(uint32_t index, Decoder* decoder, + const srd_decoder_annotation_row* srd_row = nullptr); - const srd_decoder* decoder() const; - const srd_decoder_annotation_row* row() const; + const Decoder* decoder() const; + const srd_decoder_annotation_row* get_srd_row() const; const QString title() const; - int index() const; + const QString description() const; + vector ann_classes() const; + uint32_t index() const; + + bool visible() const; + void set_visible(bool visible); - bool operator<(const Row &other) const; + 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: - int index_; - const srd_decoder *decoder_; - const srd_decoder_annotation_row *row_; + 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