2012-01-04 22:13:01 +00:00
|
|
|
/* color_utils.h
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2012-01-04 22:13:01 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef COLOR_UTILS_H
|
|
|
|
#define COLOR_UTILS_H
|
|
|
|
|
2015-04-26 17:21:09 +00:00
|
|
|
#include <config.h>
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2013-01-24 01:10:12 +00:00
|
|
|
#include <glib.h>
|
|
|
|
|
2015-12-22 20:07:00 +00:00
|
|
|
#include <epan/color_filters.h>
|
2013-01-24 01:10:12 +00:00
|
|
|
|
2014-10-25 19:36:32 +00:00
|
|
|
#include <QBrush>
|
2013-01-24 01:10:12 +00:00
|
|
|
#include <QColor>
|
2014-10-25 19:36:32 +00:00
|
|
|
#include <QObject>
|
2013-01-24 01:10:12 +00:00
|
|
|
|
|
|
|
class ColorUtils : public QObject
|
2012-01-04 22:13:01 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2013-01-24 01:10:12 +00:00
|
|
|
explicit ColorUtils(QObject *parent = 0);
|
|
|
|
|
2015-06-11 22:53:51 +00:00
|
|
|
static QColor fromColorT(const color_t *color);
|
2013-10-15 15:22:03 +00:00
|
|
|
static QColor fromColorT(color_t color);
|
2015-02-05 00:36:19 +00:00
|
|
|
static const color_t toColorT(const QColor color);
|
2014-10-25 19:36:32 +00:00
|
|
|
static QRgb alphaBlend(const QColor &color1, const QColor &color2, qreal alpha);
|
|
|
|
static QRgb alphaBlend(const QBrush &brush1, const QBrush &brush2, qreal alpha);
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2015-03-11 22:22:20 +00:00
|
|
|
// ...because they don't really fit anywhere else?
|
|
|
|
static const QColor expert_color_comment; /* green */
|
|
|
|
static const QColor expert_color_chat; /* light blue */
|
|
|
|
static const QColor expert_color_note; /* bright turquoise */
|
|
|
|
static const QColor expert_color_warn; /* yellow */
|
|
|
|
static const QColor expert_color_error; /* pale red */
|
|
|
|
static const QColor expert_color_foreground; /* black */
|
|
|
|
static const QColor hidden_proto_item; /* gray */
|
|
|
|
|
2016-05-19 02:21:02 +00:00
|
|
|
static const QList<QRgb> graphColors();
|
|
|
|
static QRgb graphColor(int item);
|
|
|
|
static QRgb sequenceColor(int item);
|
2015-11-30 22:42:42 +00:00
|
|
|
|
2012-01-04 22:13:01 +00:00
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
2015-11-30 22:42:42 +00:00
|
|
|
private:
|
2016-05-19 02:21:02 +00:00
|
|
|
static QList<QRgb> graph_colors_;
|
|
|
|
static QList<QRgb> sequence_colors_;
|
2012-01-04 22:13:01 +00:00
|
|
|
};
|
|
|
|
|
2015-12-22 20:07:00 +00:00
|
|
|
void color_filter_qt_add_cb(color_filter_t *colorf, gpointer user_data);
|
|
|
|
|
2012-01-04 22:13:01 +00:00
|
|
|
#endif // COLOR_UTILS_H
|
2012-09-04 08:18:31 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines
|
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|