X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Fdecoder_output%2FQHexView.hpp;h=e3c182a7a1d344cca8421fca8f5bcfd6fb8fcc88;hb=a3c57f445a469cd9fc7ec02d529d9425a94b2256;hp=fca3c7efa798a4e95f8f9c388464516a0bcd142a;hpb=cbf428c209788f1c0860cc7a1247a279379db303;p=pulseview.git diff --git a/pv/views/decoder_output/QHexView.hpp b/pv/views/decoder_output/QHexView.hpp index fca3c7ef..e3c182a7 100644 --- a/pv/views/decoder_output/QHexView.hpp +++ b/pv/views/decoder_output/QHexView.hpp @@ -34,6 +34,7 @@ #include +using std::pair; using std::size_t; using pv::data::DecodeBinaryClass; using pv::data::DecodeBinaryDataChunk; @@ -49,13 +50,20 @@ public: }; public: - QHexView(QWidget *parent = 0); + QHexView(QWidget *parent = nullptr); - void setMode(Mode m); - void setData(const DecodeBinaryClass* data); + void set_mode(Mode m); + void set_data(const DecodeBinaryClass* data); + unsigned int get_bytes_per_line() const; void clear(); void showFromOffset(size_t offset); + virtual QSizePolicy sizePolicy() const; + + pair get_selection() const; + + size_t create_hex_line(size_t start, size_t end, QString* dest, + bool with_offset=false, bool with_ascii=false); protected: void initialize_byte_iterator(size_t offset); @@ -85,7 +93,7 @@ private: size_t selectBegin_, selectEnd_, selectInit_, cursorPos_; size_t current_chunk_id_, current_chunk_offset_, current_offset_; - const DecodeBinaryDataChunk* current_chunk_; + DecodeBinaryDataChunk current_chunk_; // Cache locally so that we're not messed up when the vector is re-allocating its data vector chunk_colors_; };