X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Fdecoder_output%2FQHexView.hpp;h=e3c182a7a1d344cca8421fca8f5bcfd6fb8fcc88;hb=feda6c6bbde575242cf01c769c0ecd3e89f9f7a0;hp=b5fb01fb51ba6dfb7a16c17222645cd9b34cb04f;hpb=628b45cc0ba7ac38ac6a003fedbbc746f15dd724;p=pulseview.git diff --git a/pv/views/decoder_output/QHexView.hpp b/pv/views/decoder_output/QHexView.hpp index b5fb01fb..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); @@ -84,8 +92,10 @@ private: size_t charWidth_, charHeight_; size_t selectBegin_, selectEnd_, selectInit_, cursorPos_; - size_t current_chunk_id_, current_chunk_offset_; - const DecodeBinaryDataChunk* current_chunk_; + size_t current_chunk_id_, current_chunk_offset_, current_offset_; + DecodeBinaryDataChunk current_chunk_; // Cache locally so that we're not messed up when the vector is re-allocating its data + + vector chunk_colors_; }; #endif /* PULSEVIEW_PV_VIEWS_DECODEROUTPUT_QHEXVIEW_H */