summaryrefslogtreecommitdiff
path: root/ui/qt/byte_view_text.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-10-30 19:21:24 +0000
committerGerald Combs <gerald@wireshark.org>2012-10-30 19:21:24 +0000
commit0a28fb8f6a354aa9a446b6bf70733c305534e074 (patch)
treea075f90a96240ec13bbb5b15135e4f81cb9c75f3 /ui/qt/byte_view_text.h
parent27b5d556cb53bee24e20a9bb5862189ee2e55a61 (diff)
downloadwireshark-0a28fb8f6a354aa9a446b6bf70733c305534e074.tar.gz
Update the Qt byte view widget to reflect the recent changes in the GTK+
byte view. Move the packet_char_enc enum from packet.h to frame_data.h. Make the encoding flag a packet_char_enc and make it one bit. Get rid of the "cfile" global in a few places. C++-ize some of the font code. Clean up some variable names. svn path=/trunk/; revision=45838
Diffstat (limited to 'ui/qt/byte_view_text.h')
-rw-r--r--ui/qt/byte_view_text.h58
1 files changed, 47 insertions, 11 deletions
diff --git a/ui/qt/byte_view_text.h b/ui/qt/byte_view_text.h
index a2dca40bbe..c20af58625 100644
--- a/ui/qt/byte_view_text.h
+++ b/ui/qt/byte_view_text.h
@@ -35,27 +35,63 @@
// XXX - Is there any reason we shouldn't add ByteViewImage, etc?
+// XXX Copied from gtk/packet_panes.h
+typedef enum {
+ BYTES_HEX,
+ BYTES_BITS
+} bytes_view_type;
+
class ByteViewText : public QTextEdit
{
Q_OBJECT
public:
- explicit ByteViewText(QWidget *parent = 0, tvbuff_t *tvb = NULL, proto_tree *tree = NULL, QTreeWidget *protoTree = NULL, unsigned int encoding = PACKET_CHAR_ENC_CHAR_ASCII);
- void hexPrintCommon();
+ explicit ByteViewText(QWidget *parent = 0, tvbuff_t *tvb = NULL, proto_tree *tree = NULL, QTreeWidget *protoTree = NULL, packet_char_enc encoding = PACKET_CHAR_ENC_CHAR_ASCII);
bool hasDataSource(tvbuff_t *ds_tvb = NULL);
- void highlight(int start, int len, bool is_root = false);
+ void setEncoding(packet_char_enc encoding);
+ void setFormat(bytes_view_type format);
+ void setHighlightStyle(bool bold);
+ void setProtocolHighlight(int start, int end);
+ void setFieldHighlight(int start, int end, guint32 mask = 0, int mask_le = 0);
+ void setFieldAppendixHighlight(int start, int end);
+ void render();
private:
- tvbuff_t *m_tvb;
- proto_tree *m_tree;
- QTreeWidget *m_protoTree;
- int m_encoding;
- unsigned int m_useDigits;
- int m_start, m_len;
+ typedef enum {
+ StateNormal,
+ StateField,
+ StateProtocol
+ } highlight_state;
+
+ void lineCommon(const int org_off);
+ void setState(highlight_state state);
+ int flushBytes(QString &str);
+ void scrollToByte(int byte);
+
+ int byteFromRowCol(int row, int col);
void mousePressEvent (QMouseEvent * event);
-signals:
+ tvbuff_t *tvb_;
+ proto_tree *proto_tree_;
+ QTreeWidget *tree_widget_;
+
+ gint adj_tag_;
+ int max_width_;
-public slots:
+ gboolean bold_highlight_;
+
+/* data */
+ packet_char_enc encoding_; /* ASCII or EBCDIC */
+ bytes_view_type format_; /* bytes in hex or bytes as bits */
+
+/* data-highlight */
+ int p_start_, p_end_; /* Protocol */
+ int f_start_, f_end_; /* Field */
+ int fa_start_, fa_end_; /* Field appendix */
+
+ int per_line_; /* Number of bytes per line */
+ int offset_width_; /* Byte offset field width */
+
+signals:
};