2 * This file is part of the PulseView project.
4 * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef PULSEVIEW_PV_DATA_DECODE_ROW_HPP
21 #define PULSEVIEW_PV_DATA_DECODE_ROW_HPP
30 struct srd_decoder_annotation_row;
39 #define DECODE_COLOR_SATURATION (180) /* 0-255 */
40 #define DECODE_COLOR_VALUE (170) /* 0-255 */
42 class AnnotationClass;
45 class Row: public QObject
52 Row(uint32_t index, Decoder* decoder,
53 const srd_decoder_annotation_row* srd_row = nullptr);
55 const Decoder* decoder() const;
56 const srd_decoder_annotation_row* get_srd_row() const;
58 const QString title() const;
59 const QString description() const;
60 vector<AnnotationClass*> ann_classes() const;
61 uint32_t index() const;
64 void set_visible(bool visible);
66 void set_base_color(QColor base_color);
67 const QColor color() const;
68 const QColor get_class_color(uint32_t ann_class_id) const;
69 const QColor get_bright_class_color(uint32_t ann_class_id) const;
70 const QColor get_dark_class_color(uint32_t ann_class_id) const;
72 bool has_hidden_classes() const;
73 bool class_is_visible(uint32_t ann_class_id) const;
75 bool operator<(const Row& other) const;
76 bool operator==(const Row& other) const;
79 void visibility_changed();
84 const srd_decoder_annotation_row* srd_row_;
88 map<uint32_t, QColor> ann_class_color_;
89 map<uint32_t, QColor> ann_bright_class_color_;
90 map<uint32_t, QColor> ann_dark_class_color_;
97 #endif // PULSEVIEW_PV_DATA_DECODE_ROW_HPP