aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/bineditor/markup.h
blob: 026fa7e1e89995d1e11c6511704dada28b8cad95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <QColor>
#include <QString>
#include <QList>
#include <QMetaType>

namespace BinEditor {

class Markup
{
public:
    Markup(quint64 a = 0, quint64 l = 0, QColor c = Qt::yellow, const QString &tt = QString()) :
        address(a), length(l), color(c), toolTip(tt) {}
    bool covers(quint64 a) const { return a >= address && a < (address + length); }

    quint64 address;
    quint64 length;
    QColor color;
    QString toolTip;
};

} // namespace BinEditor

Q_DECLARE_METATYPE(BinEditor::Markup)