• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdeutils
  • Sitemap
  • Contact Us
 

okteta

KHEPrint::ByteColumnRenderer

KHEPrint::ByteColumnRenderer Class Reference

#include <bytecolumnrenderer.h>

Inheritance diagram for KHEPrint::ByteColumnRenderer:

Inheritance graph
[legend]

List of all members.


Detailed Description

base class of all buffer column displayers holds all information about the vertical layout of a buffer column knows how to paint the data and the editing things (focus, cursor, selection) but does not offer

Author:
Friedrich W. H. Kossebau

Definition at line 63 of file bytecolumnrenderer.h.


Public Types

enum  KFrameStyle { Frame, Left, Right }

Public Member Functions

 ByteColumnRenderer (AbstractColumnFrameRenderer *columnFrameRenderer, const KHECore::KAbstractByteArrayModel *byteArray, const KHE::KSection &renderIndizes, const KHEUI::ByteArrayTableLayout *layout)
KPixelX byteSpacingWidth () const
KPixelX byteWidth () const
KHECore::KCharCodec * codec () const
KPixelX columnRightXOfLinePosition (int posInLine) const
KPixelX columnXOfLinePosition (int posInLine) const
KPixelXs columnXsOfLinePositionsInclSpaces (const KHE::KSection &Positions) const
KPixelX digitWidth () const
int firstPos () const
KPixelX groupSpacingWidth () const
int lastPos () const
const KHEUI::ByteArrayTableLayout * layout () const
int linePositionOfColumnX (KPixelX x) const
int linePositionOfX (KPixelX x) const
KHE::KSection linePositionsOfColumnXs (KPixelX x, KPixelX width) const
KHE::KSection linePositionsOfX (KPixelX x, KPixelX width) const
int magneticLinePositionOfX (KPixelX PX) const
int noOfGroupedBytes () const
void prepareRendering (const KPixelXs &Xs)
virtual void renderFirstLine (QPainter *painter, const KPixelXs &Xs, int firstLine)
void renderLinePositions (QPainter *painter, int Line, const KHE::KSection &Positions)
virtual void renderNextLine (QPainter *painter)
void resetXBuffer ()
KPixelX rightXOfLinePosition (int posInLine) const
void setByteArrayModel (const KHECore::KAbstractByteArrayModel *byteArrayModel, const KHE::KSection &renderIndizes)
bool setByteSpacingWidth (KPixelX ByteSpacingW)
void setCodec (KHECore::KCharCodec *C)
bool setDigitWidth (KPixelX DW)
bool setGroupSpacingWidth (KPixelX GroupSpacingW)
void setMetrics (KPixelX NewDigitWidth, KPixelY NewDigitBaseLine)
bool setNoOfGroupedBytes (int NewNoOfGroupedBytes)
bool setSpacing (KPixelX ByteSpacingW, int NewNoOfGroupedBytes=0, KPixelX GroupSpacingW=0)
KHE::KSection visibleLinePositions (KPixelX x, KPixelX width) const
KHE::KSection visiblePositions () const
KPixelX xOfLinePosition (int posInLine) const
KPixelXs xsOfLinePositionsInclSpaces (const KHE::KSection &Positions) const
virtual ~ByteColumnRenderer ()

Protected Member Functions

virtual void drawByte (QPainter *painter, char Byte, KHECore::KChar B, const QColor &Color) const
virtual void recalcByteWidth ()
void recalcX ()
void renderPlain (QPainter *painter, const KHE::KSection &Positions, int Index)
void renderRange (QPainter *painter, const QBrush &Brush, const KHE::KSection &Positions, int Flag)

Protected Attributes

const
KHECore::KAbstractByteArrayModel * 
mByteArrayModel
KPixelX mByteSpacingWidth
KPixelX mByteWidth
KHECore::KCharCodec * mCodec
KPixelY mDigitBaseLine
KPixelX mDigitWidth
KPixelX mGroupSpacingWidth
int mLastPos
const KHEUI::ByteArrayTableLayout * mLayout
int mNoOfGroupedBytes
KPixelX * mPosRightX
KPixelX * mPosX
KHE::KSection mRenderIndizes
int mRenderLine
KHE::KSection mRenderPositions
KPixelX mRenderW
KPixelX mRenderX
int mSpacingTrigger

Member Enumeration Documentation

enum KHEPrint::ByteColumnRenderer::KFrameStyle

Enumerator:
Frame 
Left 
Right 

Definition at line 66 of file bytecolumnrenderer.h.


Constructor & Destructor Documentation

KHEPrint::ByteColumnRenderer::ByteColumnRenderer ( AbstractColumnFrameRenderer *  columnFrameRenderer,
const KHECore::KAbstractByteArrayModel *  byteArray,
const KHE::KSection &  renderIndizes,
const KHEUI::ByteArrayTableLayout *  layout 
)

Definition at line 48 of file bytecolumnrenderer.cpp.

KHEPrint::ByteColumnRenderer::~ByteColumnRenderer (  )  [virtual]

Definition at line 464 of file bytecolumnrenderer.cpp.


Member Function Documentation

KPixelX KHEPrint::ByteColumnRenderer::byteSpacingWidth (  )  const [inline]

Definition at line 226 of file bytecolumnrenderer.h.

KPixelX KHEPrint::ByteColumnRenderer::byteWidth (  )  const [inline]

Definition at line 224 of file bytecolumnrenderer.h.

KHECore::KCharCodec * KHEPrint::ByteColumnRenderer::codec (  )  const [inline]

Definition at line 238 of file bytecolumnrenderer.h.

KPixelX KHEPrint::ByteColumnRenderer::columnRightXOfLinePosition ( int  posInLine  )  const

returns right relative x-coord of byte at position posInLine

Definition at line 328 of file bytecolumnrenderer.cpp.

KPixelX KHEPrint::ByteColumnRenderer::columnXOfLinePosition ( int  posInLine  )  const

returns relative x-coord of byte at position posInLine

Definition at line 327 of file bytecolumnrenderer.cpp.

KPixelXs KHEPrint::ByteColumnRenderer::columnXsOfLinePositionsInclSpaces ( const KHE::KSection &  Positions  )  const

Definition at line 341 of file bytecolumnrenderer.cpp.

KPixelX KHEPrint::ByteColumnRenderer::digitWidth (  )  const [inline]

Definition at line 225 of file bytecolumnrenderer.h.

void KHEPrint::ByteColumnRenderer::drawByte ( QPainter *  painter,
char  Byte,
KHECore::KChar  B,
const QColor &  Color 
) const [protected, virtual]

default implementation simply prints the byte as ASCII

Reimplemented in KHEPrint::CharColumnRenderer, and KHEPrint::ValueColumnRenderer.

Definition at line 457 of file bytecolumnrenderer.cpp.

int KHEPrint::ByteColumnRenderer::firstPos (  )  const [inline]

Definition at line 231 of file bytecolumnrenderer.h.

KPixelX KHEPrint::ByteColumnRenderer::groupSpacingWidth (  )  const [inline]

Definition at line 227 of file bytecolumnrenderer.h.

int KHEPrint::ByteColumnRenderer::lastPos (  )  const [inline]

Definition at line 232 of file bytecolumnrenderer.h.

const KHEUI::ByteArrayTableLayout * KHEPrint::ByteColumnRenderer::layout (  )  const [inline]

Definition at line 235 of file bytecolumnrenderer.h.

int KHEPrint::ByteColumnRenderer::linePositionOfColumnX ( KPixelX  x  )  const

returns byte pos at pixel with relative x-coord x

Definition at line 287 of file bytecolumnrenderer.cpp.

int KHEPrint::ByteColumnRenderer::linePositionOfX ( KPixelX  x  )  const

returns byte pos at pixel with absolute x-coord x

Definition at line 218 of file bytecolumnrenderer.cpp.

KHE::KSection KHEPrint::ByteColumnRenderer::linePositionsOfColumnXs ( KPixelX  x,
KPixelX  width 
) const

returns byte positions covered by pixels with relative x-coord x

Definition at line 301 of file bytecolumnrenderer.cpp.

KHE::KSection KHEPrint::ByteColumnRenderer::linePositionsOfX ( KPixelX  x,
KPixelX  width 
) const

returns byte positions covered by pixels with absolute x-coord x

Definition at line 255 of file bytecolumnrenderer.cpp.

int KHEPrint::ByteColumnRenderer::magneticLinePositionOfX ( KPixelX  PX  )  const

returns byte pos at pixel with absolute x-coord x, and sets the flag to true if we are closer to the right

Definition at line 234 of file bytecolumnrenderer.cpp.

int KHEPrint::ByteColumnRenderer::noOfGroupedBytes (  )  const [inline]

Definition at line 229 of file bytecolumnrenderer.h.

void KHEPrint::ByteColumnRenderer::prepareRendering ( const KPixelXs &  Xs  ) 

Definition at line 351 of file bytecolumnrenderer.cpp.

void KHEPrint::ByteColumnRenderer::recalcByteWidth (  )  [protected, virtual]

default implementation sets byte width to one digit width

Reimplemented in KHEPrint::ValueColumnRenderer.

Definition at line 182 of file bytecolumnrenderer.cpp.

void KHEPrint::ByteColumnRenderer::recalcX (  )  [protected]

Definition at line 188 of file bytecolumnrenderer.cpp.

void KHEPrint::ByteColumnRenderer::renderFirstLine ( QPainter *  painter,
const KPixelXs &  Xs,
int  firstLine 
) [virtual]

Before an update of the columns view each column that intersects with the area to be painted will be called with this function.

As often multiple lines of a column are affected for each lines the same values (like first and last char positions) might be calculated. This function enables a one-time-calculation for such data that must be stored in some class members, though.

Parameters:
painter painter variable
cx 
cw 
FirstLine no of the first of the range of lines to paint

Reimplemented from KHEPrint::AbstractColumnRenderer.

Definition at line 367 of file bytecolumnrenderer.cpp.

void KHEPrint::ByteColumnRenderer::renderLinePositions ( QPainter *  painter,
int  Line,
const KHE::KSection &  Positions 
)

Definition at line 383 of file bytecolumnrenderer.cpp.

void KHEPrint::ByteColumnRenderer::renderNextLine ( QPainter *  painter  )  [virtual]

the actual painting call for a column's line.

The default implementation simply paints the background

Reimplemented from KHEPrint::AbstractColumnRenderer.

Definition at line 377 of file bytecolumnrenderer.cpp.

void KHEPrint::ByteColumnRenderer::renderPlain ( QPainter *  painter,
const KHE::KSection &  Positions,
int  Index 
) [protected]

Definition at line 408 of file bytecolumnrenderer.cpp.

void KHEPrint::ByteColumnRenderer::renderRange ( QPainter *  painter,
const QBrush &  Brush,
const KHE::KSection &  Positions,
int  Flag 
) [protected]

Definition at line 448 of file bytecolumnrenderer.cpp.

void KHEPrint::ByteColumnRenderer::resetXBuffer (  ) 

creates new buffer for x-values; to be called on any change of NoOfBytesPerLine or metrics

Definition at line 79 of file bytecolumnrenderer.cpp.

KPixelX KHEPrint::ByteColumnRenderer::rightXOfLinePosition ( int  posInLine  )  const

returns right absolute x-coord of byte at position posInLine

Definition at line 284 of file bytecolumnrenderer.cpp.

void KHEPrint::ByteColumnRenderer::setByteArrayModel ( const KHECore::KAbstractByteArrayModel *  byteArrayModel,
const KHE::KSection &  renderIndizes 
)

Definition at line 70 of file bytecolumnrenderer.cpp.

bool KHEPrint::ByteColumnRenderer::setByteSpacingWidth ( KPixelX  ByteSpacingW  ) 

sets the spacing between the bytes in the hex column

Parameters:
ByteSpacingW spacing between the bytes in pixels returns true if there was a change

Definition at line 136 of file bytecolumnrenderer.cpp.

void KHEPrint::ByteColumnRenderer::setCodec ( KHECore::KCharCodec *  C  )  [inline]

sets the codec to be used by the char column.

Definition at line 237 of file bytecolumnrenderer.h.

bool KHEPrint::ByteColumnRenderer::setDigitWidth ( KPixelX  DW  ) 

sets width of digits and recalculates depend sizes returns true if there was a change

Definition at line 100 of file bytecolumnrenderer.cpp.

bool KHEPrint::ByteColumnRenderer::setGroupSpacingWidth ( KPixelX  GroupSpacingW  ) 

sets the spacing between the groups of bytes in the hex column

Parameters:
GroupSpacingW spacing between the groups in pixels returns true if there was a change

Definition at line 166 of file bytecolumnrenderer.cpp.

void KHEPrint::ByteColumnRenderer::setMetrics ( KPixelX  NewDigitWidth,
KPixelY  NewDigitBaseLine 
)

sets the metrics of the used font

Parameters:
NewDigitWidth the new width of a digit
NewDigitBaseLine the new baseline of the digits

Definition at line 93 of file bytecolumnrenderer.cpp.

bool KHEPrint::ByteColumnRenderer::setNoOfGroupedBytes ( int  NewNoOfGroupedBytes  ) 

sets the number of grouped bytes in the hex column

Parameters:
NewNoOfGroupedBytes numbers of grouped bytes, 0 means no grouping returns true if there was a change

Definition at line 152 of file bytecolumnrenderer.cpp.

bool KHEPrint::ByteColumnRenderer::setSpacing ( KPixelX  ByteSpacingW,
int  NewNoOfGroupedBytes = 0,
KPixelX  GroupSpacingW = 0 
)

sets the spacing in the hex column

Parameters:
ByteSpacingW spacing between the bytes in pixels
NewNoOfGroupedBytes numbers of grouped bytes, 0 means no grouping
GroupSpacingW spacing between the groups in pixels returns true if there was a change

Definition at line 116 of file bytecolumnrenderer.cpp.

KHE::KSection KHEPrint::ByteColumnRenderer::visibleLinePositions ( KPixelX  x,
KPixelX  width 
) const

returns the positions that overlap with the absolute x-coords

KHE::KSection KHEPrint::ByteColumnRenderer::visiblePositions (  )  const [inline]

Definition at line 233 of file bytecolumnrenderer.h.

KPixelX KHEPrint::ByteColumnRenderer::xOfLinePosition ( int  posInLine  )  const

returns absolute x-coord of byte at position posInLine

Definition at line 283 of file bytecolumnrenderer.cpp.

KPixelXs KHEPrint::ByteColumnRenderer::xsOfLinePositionsInclSpaces ( const KHE::KSection &  Positions  )  const

returns the

Definition at line 331 of file bytecolumnrenderer.cpp.


Member Data Documentation

const KHECore::KAbstractByteArrayModel* KHEPrint::ByteColumnRenderer::mByteArrayModel [protected]

pointer to the buffer

Definition at line 179 of file bytecolumnrenderer.h.

KPixelX KHEPrint::ByteColumnRenderer::mByteSpacingWidth [protected]

size of the line margin

Definition at line 199 of file bytecolumnrenderer.h.

KPixelX KHEPrint::ByteColumnRenderer::mByteWidth [protected]

total width of byte display in pixel

Definition at line 197 of file bytecolumnrenderer.h.

KHECore::KCharCodec* KHEPrint::ByteColumnRenderer::mCodec [protected]

Definition at line 187 of file bytecolumnrenderer.h.

KPixelY KHEPrint::ByteColumnRenderer::mDigitBaseLine [protected]

Definition at line 192 of file bytecolumnrenderer.h.

KPixelX KHEPrint::ByteColumnRenderer::mDigitWidth [protected]

Definition at line 190 of file bytecolumnrenderer.h.

KPixelX KHEPrint::ByteColumnRenderer::mGroupSpacingWidth [protected]

width of spacing in pixel

Definition at line 201 of file bytecolumnrenderer.h.

int KHEPrint::ByteColumnRenderer::mLastPos [protected]

index of right position

Definition at line 212 of file bytecolumnrenderer.h.

const KHEUI::ByteArrayTableLayout* KHEPrint::ByteColumnRenderer::mLayout [protected]

pointer to the layout

Definition at line 183 of file bytecolumnrenderer.h.

int KHEPrint::ByteColumnRenderer::mNoOfGroupedBytes [protected]

number of grouped bytes

Definition at line 204 of file bytecolumnrenderer.h.

KPixelX* KHEPrint::ByteColumnRenderer::mPosRightX [protected]

Definition at line 210 of file bytecolumnrenderer.h.

KPixelX* KHEPrint::ByteColumnRenderer::mPosX [protected]

pointer to array with buffered positions (relative to column position) a spacing gets assigned to the left byte -> .

..c|c|c |c|c...

Definition at line 209 of file bytecolumnrenderer.h.

KHE::KSection KHEPrint::ByteColumnRenderer::mRenderIndizes [protected]

Definition at line 181 of file bytecolumnrenderer.h.

int KHEPrint::ByteColumnRenderer::mRenderLine [protected]

Definition at line 217 of file bytecolumnrenderer.h.

KHE::KSection KHEPrint::ByteColumnRenderer::mRenderPositions [protected]

Definition at line 216 of file bytecolumnrenderer.h.

KPixelX KHEPrint::ByteColumnRenderer::mRenderW [protected]

Definition at line 219 of file bytecolumnrenderer.h.

KPixelX KHEPrint::ByteColumnRenderer::mRenderX [protected]

Definition at line 218 of file bytecolumnrenderer.h.

int KHEPrint::ByteColumnRenderer::mSpacingTrigger [protected]

Definition at line 220 of file bytecolumnrenderer.h.


The documentation for this class was generated from the following files:
  • bytecolumnrenderer.h
  • bytecolumnrenderer.cpp

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • okteta
  • printer-applet
  • superkaramba
  • sweeper
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal