okteta
bytearrayrowcolumnrenderer.cpp
Go to the documentation of this file.
50 (AbstractByteArrayView::CodingTypes)( AbstractByteArrayView::ValueCodingId | AbstractByteArrayView::CharCodingId );
53 AbstractByteArrayModel* byteArrayModel, ByteArrayTableLayout* layout, ByteArrayTableRanges* ranges )
96 PixelY ByteArrayRowColumnRenderer::yOfCodingId( AbstractByteArrayView::CodingTypeId codingId ) const
148 bool ByteArrayRowColumnRenderer::setSpacing( PixelX byteSpacingWidth, Size NoGB, PixelX groupSpacingWidth )
151 if( mByteSpacingWidth == byteSpacingWidth && mNoOfGroupedBytes == NoGB && mGroupSpacingWidth == groupSpacingWidth )
212 void ByteArrayRowColumnRenderer::setValueCodec( ValueCoding valueCoding, const ValueCodec* valueCodec )
258 void ByteArrayRowColumnRenderer::renderEditedByte( QPainter* painter, Byte byte, const QString& editBuffer )
301 void ByteArrayRowColumnRenderer::renderCode( QPainter* painter, const QString& code, const QColor& color ) const
317 mSpacingTrigger = noOfGroupedBytes() > 0 ? noOfGroupedBytes()-1 : mLastLinePos+1; // last ensures to never trigger the spacing
435 LinePositionRange ByteArrayRowColumnRenderer::linePositionsOfColumnXs( PixelX pixelX, PixelX pixelWidth ) const
467 PixelX ByteArrayRowColumnRenderer::columnRightXOfLinePosition( LinePosition linePosition ) const
473 PixelXRange ByteArrayRowColumnRenderer::xsOfLinePositionsInclSpaces( const LinePositionRange& linePositions ) const
475 const PixelX x = (linePositions.start()>0) ? rightXOfLinePosition( linePositions.nextBeforeStart() ) + 1 :
477 const PixelX rightX = (linePositions.end()<mLastLinePos) ? xOfLinePosition( linePositions.nextBehindEnd() ) - 1 :
483 PixelXRange ByteArrayRowColumnRenderer::columnXsOfLinePositionsInclSpaces( const LinePositionRange& linePositions ) const
485 const PixelX x = (linePositions.start()>0) ? columnRightXOfLinePosition( linePositions.nextBeforeStart() ) + 1 :
487 const PixelX rightX = (linePositions.end()<mLastLinePos) ? columnXOfLinePosition( linePositions.nextBehindEnd() ) - 1 :
507 QRect ByteArrayRowColumnRenderer::byteRect( const Coord& coord, AbstractByteArrayView::CodingTypeId codingId ) const
537 void ByteArrayRowColumnRenderer::renderFirstLine( QPainter* painter, const PixelXRange& Xs, Line firstLineIndex )
553 void ByteArrayRowColumnRenderer::renderLinePositions( QPainter* painter, Line lineIndex, const LinePositionRange& _linePositions )
576 AddressRange::fromWidth( mLayout->indexAtCoord(Coord( linePositions.start(), lineIndex )), linePositions.width() );
585 //kDebug() << QString("painting linePositions (painter%1-%2L%3): ").arg(linePositions.start()).arg(linePositions.end()).arg(lineIndex)
606 else if( positionsPart.start() == firstLinePosition && selectedRange.includes(byteIndizesPart.start()) )
611 else if( positionsPart.end() == linePositions.end() && selectedRange.includes(byteIndizesPart.end()) )
621 const bool hasMarkingBeforeSelectionEnd = ( hasMarking && markedRange.start() <= selectedRange.end() );
623 byteIndizesPart.setEnd( hasMarkingBeforeSelectionEnd ? markedRange.nextBeforeStart() : selectedRange.end() );
652 void ByteArrayRowColumnRenderer::renderPlain( QPainter* painter, const LinePositionRange& linePositions, Address byteIndex )
669 for( LinePosition linePosition=linePositions.start(); linePosition<=linePositions.end(); ++linePosition,++byteIndex )
680 nextBookmarkOffset = bit.hasNext() ? bit.next().offset() : -1;//TODO )&& ( bit->offset() <= LastIndex );
697 void ByteArrayRowColumnRenderer::renderSelection( QPainter* painter, const LinePositionRange& linePositions, Address byteIndex, int flag )
716 for( LinePosition linePosition=linePositions.start(); linePosition<=linePositions.end(); ++linePosition,++byteIndex )
727 nextBookmarkOffset = bit.hasNext() ? bit.next().offset() : -1;//TODO )&& ( bit->offset() <= LastIndex );
743 void ByteArrayRowColumnRenderer::renderSelectionSpaceBehind( QPainter* painter, LinePosition linePosition )
752 void ByteArrayRowColumnRenderer::renderMarking( QPainter* painter, const LinePositionRange& linePositions, Address byteIndex, int flag )
782 void ByteArrayRowColumnRenderer::renderRange( QPainter* painter, const QBrush& brush, const LinePositionRange& linePositions, int flag )
795 void ByteArrayRowColumnRenderer::renderSpaceBehind( QPainter* painter, const QBrush& brush, LinePosition linePosition )
830 const QBrush bookmarkBackgroundBrush = colorScheme.background( KColorScheme::NeutralBackground );
856 const KColorScheme::ColorSet colorSet = isInSelection ? KColorScheme::Selection : KColorScheme::View;
874 void ByteArrayRowColumnRenderer::renderCursor( QPainter* painter, Address byteIndex, AbstractByteArrayView::CodingTypeId codingId )
881 const KColorScheme::ColorSet colorSet = isInSelection ? KColorScheme::Selection : KColorScheme::View;
892 bool ByteArrayRowColumnRenderer::getNextSelectedAddressRange( AddressRange* _selection, unsigned int* _flag,
922 bool ByteArrayRowColumnRenderer::getNextMarkedAddressRange( AddressRange* _markedSection, unsigned int* _flag,
virtual void renderFirstLine(QPainter *painter, const PixelXRange &Xs, Line firstLineIndex)
Definition: bytearrayrowcolumnrenderer.cpp:537
could it be useful to hide the data access behind an iterator? * class KDataBufferIterator { public: ...
Definition: abstractbytearraymodel.h:79
bool setBinaryGapWidth(PixelX binaryGapWidth)
sets the spacing in the middle of a binary byte in the value column
Definition: bytearrayrowcolumnrenderer.cpp:226
void prepareRendering(const PixelXRange &Xs)
Definition: bytearrayrowcolumnrenderer.cpp:521
virtual ~ByteArrayRowColumnRenderer()
Definition: bytearrayrowcolumnrenderer.cpp:950
void restrictToXSpan(PixelXRange *xSpan) const
Definition: abstractcolumnrenderer.cpp:54
static const PixelX DefaultRowSpacingHeight
Definition: oktetagui.h:48
KDE::NumberRange< LinePosition, LinePositionSize > LinePositionRange
Definition: linepositionrange.h:34
void renderEditedByte(QPainter *painter, Byte byte, const QString &editBuffer)
Definition: bytearrayrowcolumnrenderer.cpp:258
void recalcByteWidth()
default implementation sets byte width to one digit width
Definition: bytearrayrowcolumnrenderer.cpp:243
bool getNextSelectedAddressRange(AddressRange *selectedRange, unsigned int *flag, const AddressRange &range) const
Definition: bytearrayrowcolumnrenderer.cpp:892
void renderByteText(QPainter *painter, Byte byte, Character charByte, int codings, const QColor &color) const
Definition: bytearrayrowcolumnrenderer.cpp:275
const AddressRange * overlappingMarking(const AddressRange &range) const
Definition: bytearraytableranges.cpp:203
void renderSelectionSpaceBehind(QPainter *painter, LinePosition linePosition)
Definition: bytearrayrowcolumnrenderer.cpp:743
a class to control all the ranges like marking and selections holds also all modified ranges and merg...
Definition: bytearraytableranges.h:45
Size noOfBytesPerLine() const
returns number of bytes per line
Definition: bytearraytablelayout.h:209
bool mByteTypeColored
Definition: bytearrayrowcolumnrenderer.h:288
PixelX mByteSpacingWidth
width of inserting cursor in pixel
Definition: bytearrayrowcolumnrenderer.h:272
PixelY rowHeight() const
Definition: bytearrayrowcolumnrenderer.cpp:90
bool setSpacing(PixelX byteSpacingWidth, Size noOfGroupedBytes=0, PixelX groupSpacingWidth=0)
sets the spacing in the hex column
Definition: bytearrayrowcolumnrenderer.cpp:148
AbstractByteArrayModel * mByteArrayModel
pointer to the buffer
Definition: bytearrayrowcolumnrenderer.h:245
PixelX columnRightXOfLinePosition(LinePosition posInLine) const
returns right relative x-coord of byte at position posInLine
Definition: bytearrayrowcolumnrenderer.cpp:467
static const PixelX DefaultByteSpacingWidth
Definition: oktetagui.h:46
PixelX mBinaryGapWidth
Definition: bytearrayrowcolumnrenderer.h:296
PixelX mDigitWidth
Definition: bytearrayrowcolumnrenderer.h:257
LinePositionRange mRenderLinePositions
Definition: bytearrayrowcolumnrenderer.h:313
PixelX xOfLinePosition(LinePosition posInLine) const
returns absolute x-coord of byte at position posInLine
Definition: bytearrayrowcolumnrenderer.cpp:410
virtual Character decode(Byte byte) const =0
PixelX mRenderX
Definition: bytearrayrowcolumnrenderer.h:315
bool selectionIncludes(Address index) const
Definition: bytearraytableranges.h:141
LinePositionRange linePositions(Line line) const
returns the used positions in line
Definition: bytearraytablelayout.cpp:267
PixelY yOfCodingId(AbstractByteArrayView::CodingTypeId codingId) const
Definition: bytearrayrowcolumnrenderer.cpp:96
void setVisibleCodings(int visibleCodings)
Definition: bytearrayrowcolumnrenderer.cpp:126
void recalcX()
Definition: bytearrayrowcolumnrenderer.cpp:315
void renderLinePositions(QPainter *painter, Line lineIndex, const LinePositionRange &linePositions)
Definition: bytearrayrowcolumnrenderer.cpp:553
const AddressRange * firstOverlappingSelection(const AddressRange &range) const
Definition: bytearraytableranges.cpp:197
static const PixelX DefaultGroupSpacingWidth
Definition: oktetagui.h:47
void renderCode(QPainter *painter, const QString &code, const QColor &color) const
Definition: bytearrayrowcolumnrenderer.cpp:301
QChar mUndefinedChar
Definition: bytearrayrowcolumnrenderer.h:310
Definition: bookmarkable.h:39
Line mRenderLine
Definition: bytearrayrowcolumnrenderer.h:314
virtual Okteta::BookmarksConstIterator createBookmarksConstIterator() const =0
AbstractByteArrayView::CodingTypes mVisibleCodings
Definition: bytearrayrowcolumnrenderer.h:255
void set(AbstractByteArrayModel *byteArrayModel)
Definition: bytearrayrowcolumnrenderer.cpp:106
bool setGroupSpacingWidth(PixelX groupSpacingWidth)
sets the spacing between the groups of bytes in the hex column
Definition: bytearrayrowcolumnrenderer.cpp:196
the logical layout of a byte array table for a view
Definition: bytearraytablelayout.h:61
LinePosition linePositionOfColumnX(PixelX x) const
returns byte pos at pixel with relative x-coord x
Definition: bytearrayrowcolumnrenderer.cpp:421
void resetXBuffer()
creates new buffer for x-values; to be called on any change of NoOfBytesPerLine or metrics ...
Definition: bytearrayrowcolumnrenderer.cpp:113
PixelX mBinaryHalfOffset
calculated: Offset in pixels of the second half of the binary
Definition: bytearrayrowcolumnrenderer.h:302
bool hasContent(Line line) const
returns true if the line has content
Definition: bytearraytablelayout.cpp:293
PixelX mRenderWidth
Definition: bytearrayrowcolumnrenderer.h:316
bool hasSelection() const
Definition: bytearraytableranges.h:136
void setFontMetrics(const QFontMetrics &fontMetrics)
sets the metrics of the used font
Definition: bytearrayrowcolumnrenderer.cpp:132
LinePositionRange linePositionsOfColumnXs(PixelX x, PixelX width) const
returns byte linePositions covered by pixels with relative x-coord x
Definition: bytearrayrowcolumnrenderer.cpp:435
PixelX byteSpacingWidth() const
Definition: bytearrayrowcolumnrenderer.h:325
Bookmarkable * mBookmarks
Definition: bytearrayrowcolumnrenderer.h:251
ValueCoding mValueCoding
Definition: bytearrayrowcolumnrenderer.h:292
Class that is able to convert codings to and from hexadecimal, decimal, octal, and binary...
Definition: valuecodec.h:45
static NumberRange fromWidth(AddressstartIndex, Sizewidth)
constructs a range by width
int mSpacingTrigger
Definition: bytearrayrowcolumnrenderer.h:317
bool endsBehind(T Value) const
returns true if the range ends later than index.
Definition: range.h:101
PixelXRange xsOfLinePositionsInclSpaces(const LinePositionRange &linePositions) const
returns the
Definition: bytearrayrowcolumnrenderer.cpp:473
void renderPlain(QPainter *painter, const LinePositionRange &linePositions, Address byteIndex)
Definition: bytearrayrowcolumnrenderer.cpp:652
void renderSpaceBehind(QPainter *painter, const QBrush &brush, LinePosition linePosition)
Definition: bytearrayrowcolumnrenderer.cpp:795
void setValueCodec(ValueCoding valueCoding, const ValueCodec *valueCodec)
Definition: bytearrayrowcolumnrenderer.cpp:212
PixelY mDigitBaseLine
Definition: bytearrayrowcolumnrenderer.h:259
Size noOfGroupedBytes() const
Definition: bytearrayrowcolumnrenderer.h:328
virtual void renderNextLine(QPainter *painter)
the actual painting call for a column's line.
Definition: bytearrayrowcolumnrenderer.cpp:547
ByteArrayRowColumnRenderer(AbstractColumnStylist *stylist, AbstractByteArrayModel *byteArrayModel, ByteArrayTableLayout *layout, ByteArrayTableRanges *ranges)
Definition: bytearrayrowcolumnrenderer.cpp:52
PixelX binaryGapWidth() const
Definition: bytearrayrowcolumnrenderer.h:347
void renderMarking(QPainter *painter, const LinePositionRange &linePositions, Address byteIndex, int flag)
Definition: bytearrayrowcolumnrenderer.cpp:752
virtual Byte byte(Address offset) const =0
locates working range The idea behind is to tell buffer which range will be requested in the followin...
Definition: oktetacore.h:34
void setEndByWidth(S width)
sets the last index of the range's range to be width-1 behind the start If the range is invalid the b...
Definition: numberrange.h:152
void setStartNextBehind(const NumberRange &other)
sets the first index of the range's range one behind the other's end If one of both is invalid the be...
Definition: numberrange.h:154
static const bool DefaultShowingNonprinting
Definition: oktetagui.h:56
void renderByte(QPainter *painter, Address byteIndex, AbstractByteArrayView::CodingTypeId codingId)
paints the byte with background.
Definition: bytearrayrowcolumnrenderer.cpp:804
QFontMetrics mFontMetrics
Definition: bytearrayrowcolumnrenderer.h:263
void renderSelection(QPainter *painter, const LinePositionRange &linePositions, Address byteIndex, int flag)
Definition: bytearrayrowcolumnrenderer.cpp:697
const ValueCodec * mValueCodec
Definition: bytearrayrowcolumnrenderer.h:294
const Okteta::Bookmark & next()
Definition: bookmarksconstiterator.h:78
QString mDecodedByteText
buffer to hold the formatted valueCoding
Definition: bytearrayrowcolumnrenderer.h:300
bool hasMarking() const
Definition: bytearraytableranges.h:140
PixelXRange columnXsOfLinePositionsInclSpaces(const LinePositionRange &linePositions) const
Definition: bytearrayrowcolumnrenderer.cpp:483
bool mShowingNonprinting
Definition: bytearrayrowcolumnrenderer.h:306
static KColorScheme::ForegroundRole foregroundRoleForChar(const Okteta::Character byteChar)
Definition: helper.h:46
bool setNoOfGroupedBytes(Size noOfGroupedBytes)
sets the number of grouped bytes in the hex column
Definition: bytearrayrowcolumnrenderer.cpp:182
bool setByteSpacingWidth(PixelX byteSpacingWidth)
sets the spacing between the bytes in the hex column
Definition: bytearrayrowcolumnrenderer.cpp:166
LinePositionRange linePositionsOfX(PixelX x, PixelX width) const
returns byte linePositions covered by pixels with absolute x-coord x
Definition: bytearrayrowcolumnrenderer.cpp:382
LinePosition linePositionOfX(PixelX x) const
returns byte pos at pixel with absolute x-coord x
Definition: bytearrayrowcolumnrenderer.cpp:345
AbstractColumnStylist * stylist() const
Definition: abstractcolumnrenderer.cpp:40
PixelX columnXOfLinePosition(LinePosition posInLine) const
returns relative x-coord of byte at position posInLine
Definition: bytearrayrowcolumnrenderer.cpp:462
Address indexAtCoord(const Coord &coord) const
calculates the index of coord.
Definition: bytearraytablelayout.cpp:213
const ByteArrayTableLayout * mLayout
pointer to the layout
Definition: bytearrayrowcolumnrenderer.h:247
QRect byteRect(const Coord &coord) const
Definition: bytearrayrowcolumnrenderer.cpp:493
PixelX byteWidth() const
Definition: bytearrayrowcolumnrenderer.h:323
PixelX rightXOfLinePosition(LinePosition posInLine) const
returns right absolute x-coord of byte at position posInLine
Definition: bytearrayrowcolumnrenderer.cpp:415
void renderFramedByte(QPainter *painter, Address byteIndex, AbstractByteArrayView::CodingTypeId codingId, FrameStyle style)
paints the byte with background and a frame around.
Definition: bytearrayrowcolumnrenderer.cpp:846
bool getNextMarkedAddressRange(AddressRange *markedRange, unsigned int *flag, const AddressRange &range) const
Definition: bytearrayrowcolumnrenderer.cpp:922
bool startsBefore(T Value) const
returns true is the range starts before index.
Definition: range.h:99
static const AbstractByteArrayView::CodingTypes DefaultVisibleCodings
Definition: bytearrayrowcolumnrenderer.cpp:49
const CharCodec * mCharCodec
Definition: bytearrayrowcolumnrenderer.h:253
PixelY lineHeight() const
Definition: abstractcolumnrenderer.cpp:47
base class for columns of the ColumnsView
Definition: abstractcolumnrenderer.h:46
void renderBookmark(QPainter *painter, const QBrush &brush)
Definition: bytearrayrowcolumnrenderer.cpp:775
virtual const QPalette & palette() const =0
AbstractByteArrayView::CodingTypeId codingIdofY(PixelY y) const
Definition: bytearrayrowcolumnrenderer.cpp:80
bool findNextFrom(unsigned int offset)
Definition: bookmarksconstiterator.h:76
virtual unsigned int encodingWidth() const =0
PixelX groupSpacingWidth() const
Definition: bytearrayrowcolumnrenderer.h:326
void renderRange(QPainter *painter, const QBrush &brush, const LinePositionRange &linePositions, int flag)
Definition: bytearrayrowcolumnrenderer.cpp:782
void renderCursor(QPainter *painter, Address byteIndex, AbstractByteArrayView::CodingTypeId codingId)
paints a cursor based on the type of the byte.
Definition: bytearrayrowcolumnrenderer.cpp:874
virtual bool containsBookmarkFor(int offset) const =0
Definition: character.h:35
PixelX * mLinePosLeftPixelX
pointer to array with buffered linePositions (relative to column position) any spacing gets assigned ...
Definition: bytearrayrowcolumnrenderer.h:282
PixelX * mLinePosRightPixelX
Definition: bytearrayrowcolumnrenderer.h:283
LinePosition magneticLinePositionOfX(PixelX x) const
returns byte pos at pixel with absolute x-coord x, and sets the flag to true if we are closer to the ...
Definition: bytearrayrowcolumnrenderer.cpp:361
virtual void encode(QString &digits, unsigned int pos, Byte byte) const =0
Encodes the byte using full coding width, prefixing with 0s if needed, and writes the result to digit...
QChar mSubstituteChar
Definition: bytearrayrowcolumnrenderer.h:308
PixelY mDigitHeight
Definition: bytearrayrowcolumnrenderer.h:261
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.