2013-10-24 22:52:30 +00:00
|
|
|
/* sequence_diagram.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
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SEQUENCE_DIAGRAM_H
|
|
|
|
#define SEQUENCE_DIAGRAM_H
|
|
|
|
|
2015-04-26 17:21:09 +00:00
|
|
|
#include <config.h>
|
2013-10-24 22:52:30 +00:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include <epan/address.h>
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QMultiMap>
|
|
|
|
#include "qcustomplot.h"
|
|
|
|
|
2015-02-12 23:35:59 +00:00
|
|
|
struct _seq_analysis_info;
|
|
|
|
struct _seq_analysis_item;
|
|
|
|
|
2016-05-25 19:02:40 +00:00
|
|
|
// Some of this is probably unnecessary
|
2013-10-24 22:52:30 +00:00
|
|
|
class WSCPSeqData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
WSCPSeqData();
|
2015-02-12 23:35:59 +00:00
|
|
|
WSCPSeqData(double key, _seq_analysis_item *value);
|
2013-10-24 22:52:30 +00:00
|
|
|
double key;
|
2015-02-12 23:35:59 +00:00
|
|
|
struct _seq_analysis_item *value;
|
2013-10-24 22:52:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef QMap<double, WSCPSeqData> WSCPSeqDataMap;
|
|
|
|
|
|
|
|
class SequenceDiagram : public QCPAbstractPlottable
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit SequenceDiagram(QCPAxis *keyAxis, QCPAxis *valueAxis, QCPAxis *commentAxis);
|
2015-02-26 18:46:15 +00:00
|
|
|
virtual ~SequenceDiagram();
|
2013-10-24 22:52:30 +00:00
|
|
|
|
|
|
|
// getters:
|
2016-05-25 19:02:40 +00:00
|
|
|
// Next / previous packet.
|
|
|
|
int adjacentPacket(bool next);
|
|
|
|
|
|
|
|
double selectedKey() { return selected_key_; }
|
2013-10-24 22:52:30 +00:00
|
|
|
|
|
|
|
// setters:
|
2015-02-12 23:35:59 +00:00
|
|
|
void setData(struct _seq_analysis_info *sainfo);
|
2013-10-24 22:52:30 +00:00
|
|
|
|
|
|
|
// non-property methods:
|
2015-02-12 23:35:59 +00:00
|
|
|
struct _seq_analysis_item *itemForPosY(int ypos);
|
2013-10-24 22:52:30 +00:00
|
|
|
|
|
|
|
// reimplemented virtual methods:
|
2014-11-19 00:21:42 +00:00
|
|
|
virtual void clearData() { data_->clear(); }
|
2013-10-24 22:52:30 +00:00
|
|
|
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
|
|
|
|
|
2013-11-12 22:50:26 +00:00
|
|
|
public slots:
|
|
|
|
void setSelectedPacket(int selected_packet);
|
|
|
|
|
2013-10-24 22:52:30 +00:00
|
|
|
protected:
|
|
|
|
virtual void draw(QCPPainter *painter);
|
|
|
|
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const;
|
|
|
|
virtual QCPRange getKeyRange(bool &validRange, SignDomain inSignDomain=sdBoth) const;
|
|
|
|
virtual QCPRange getValueRange(bool &validRange, SignDomain inSignDomain=sdBoth) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QCPAxis *key_axis_;
|
|
|
|
QCPAxis *value_axis_;
|
|
|
|
QCPAxis *comment_axis_;
|
|
|
|
WSCPSeqDataMap *data_;
|
2015-02-12 23:35:59 +00:00
|
|
|
struct _seq_analysis_info *sainfo_;
|
2013-11-12 22:50:26 +00:00
|
|
|
guint32 selected_packet_;
|
2016-05-25 19:02:40 +00:00
|
|
|
double selected_key_;
|
2013-10-24 22:52:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SEQUENCE_DIAGRAM_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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:
|
|
|
|
*/
|