]> sigrok.org Git - pulseview.git/blobdiff - pv/data/decode/row.hpp
Fix #1663 by handling the case where annotations aren't assigned a row
[pulseview.git] / pv / data / decode / row.hpp
index 000bdf9e6b935c8ee838367c7a5c8460badfcca9..80aa114c1edb8dde8514c67f7ee67139a55c0d91 100644 (file)
 #ifndef PULSEVIEW_PV_DATA_DECODE_ROW_HPP
 #define PULSEVIEW_PV_DATA_DECODE_ROW_HPP
 
+#include <map>
 #include <vector>
 
+#include <QObject>
 #include <QColor>
 
-#include <pv/data/decode/annotation.hpp>
-#include <pv/data/decode/decoder.hpp>
-
 struct srd_decoder;
 struct srd_decoder_annotation_row;
 
+using std::map;
+using std::vector;
+
 namespace pv {
 namespace data {
 namespace decode {
@@ -37,11 +39,13 @@ namespace decode {
 #define DECODE_COLOR_SATURATION (180) /* 0-255 */
 #define DECODE_COLOR_VALUE (170) /* 0-255 */
 
-struct AnnotationClass;
+class AnnotationClass;
 class Decoder;
 
-class Row
+class Row: public QObject
 {
+       Q_OBJECT
+
 public:
        Row();
 
@@ -66,10 +70,14 @@ public:
        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_;