diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
commit | e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch) | |
tree | 68cb5ef9081156392f1dd62a00c6ccc1451b93df /ui/qt/sequence_diagram.h | |
parent | Initial commit. (diff) | |
download | wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip |
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ui/qt/sequence_diagram.h')
-rw-r--r-- | ui/qt/sequence_diagram.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/ui/qt/sequence_diagram.h b/ui/qt/sequence_diagram.h new file mode 100644 index 00000000..aa9a377a --- /dev/null +++ b/ui/qt/sequence_diagram.h @@ -0,0 +1,80 @@ +/** @file + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef SEQUENCE_DIAGRAM_H +#define SEQUENCE_DIAGRAM_H + +#include <config.h> + +#include <glib.h> + +#include <epan/address.h> + +#include <QObject> +#include <QMultiMap> +#include <ui/qt/widgets/qcustomplot.h> + +struct _seq_analysis_info; +struct _seq_analysis_item; + +// Some of this is probably unnecessary +class WSCPSeqData +{ +public: + WSCPSeqData(); + WSCPSeqData(double key, _seq_analysis_item *value); + double key; + struct _seq_analysis_item *value; +}; + +typedef QMultiMap<double, WSCPSeqData> WSCPSeqDataMap; + +class SequenceDiagram : public QCPAbstractPlottable +{ + Q_OBJECT +public: + explicit SequenceDiagram(QCPAxis *keyAxis, QCPAxis *valueAxis, QCPAxis *commentAxis); + virtual ~SequenceDiagram(); + + // getters: + // Next / previous packet. + int adjacentPacket(bool next); + + double selectedKey() { return selected_key_; } + + // setters: + void setData(struct _seq_analysis_info *sainfo); + + // non-property methods: + struct _seq_analysis_item *itemForPosY(int ypos); + + // reimplemented virtual methods: + virtual void clearData() { data_->clear(); } + virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE; + +public slots: + void setSelectedPacket(int selected_packet); + +protected: + virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE; + virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const Q_DECL_OVERRIDE; + virtual QCPRange getKeyRange(bool &validRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE; + virtual QCPRange getValueRange(bool &validRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange = QCPRange()) const Q_DECL_OVERRIDE; + +private: + QCPAxis *key_axis_; + QCPAxis *value_axis_; + QCPAxis *comment_axis_; + WSCPSeqDataMap *data_; + struct _seq_analysis_info *sainfo_; + guint32 selected_packet_; + double selected_key_; +}; + +#endif // SEQUENCE_DIAGRAM_H |