]> sigrok.org Git - pulseview.git/blame_incremental - pv/binding/decoder.hpp
View: Prevent header from being resized when view is resized
[pulseview.git] / pv / binding / decoder.hpp
... / ...
CommitLineData
1/*
2 * This file is part of the PulseView project.
3 *
4 * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
5 *
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.
10 *
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.
15 *
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/>.
18 */
19
20#ifndef PULSEVIEW_PV_BINDING_DECODER_HPP
21#define PULSEVIEW_PV_BINDING_DECODER_HPP
22
23#include "binding.hpp"
24
25#include <pv/prop/property.hpp>
26
27using std::shared_ptr;
28
29struct srd_decoder_option;
30
31namespace pv {
32
33namespace data {
34class DecoderStack;
35namespace decode {
36class Decoder;
37}
38}
39
40namespace binding {
41
42class Decoder : public Binding
43{
44public:
45 Decoder(shared_ptr<pv::data::DecoderStack> decoder_stack,
46 shared_ptr<pv::data::decode::Decoder> decoder);
47
48private:
49 static shared_ptr<prop::Property> bind_enum(const QString &name,
50 const QString &desc, const srd_decoder_option *option,
51 prop::Property::Getter getter, prop::Property::Setter setter);
52
53 Glib::VariantBase getter(const char *id);
54
55 void setter(const char *id, Glib::VariantBase value);
56
57private:
58 shared_ptr<pv::data::DecoderStack> decoder_stack_;
59 shared_ptr<pv::data::decode::Decoder> decoder_;
60};
61
62} // namespace binding
63} // namespace pv
64
65#endif // PULSEVIEW_PV_BINDING_DECODER_HPP