• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • kasten
  • controllers
  • view
  • print
bytearrayframerenderer.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta Kasten module, made within the KDE community.
3 
4  Copyright 2003,2008-2009 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) version 3, or any
10  later version accepted by the membership of KDE e.V. (or its
11  successor approved by the membership of KDE e.V.), which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #include "bytearrayframerenderer.h"
24 
25 // lib
26 #include "printcolumnstylist.h"
27 // Okteta gui
28 #include <offsetcolumnrenderer.h>
29 #include <bordercolumnrenderer.h>
30 #include <valuebytearraycolumnrenderer.h>
31 #include <charbytearraycolumnrenderer.h>
32 #include <bytearraytablelayout.h>
33 #include <bytearraytableranges.h>
34 // Okteta core
35 #include <abstractbytearraymodel.h>
36 #include <valuecodec.h>
37 #include <charcodec.h>
38 // KDE
39 #include <KGlobalSettings>
40 // Qt
41 #include <QtCore/QHash>
42 #include <QtCore/QDateTime>
43 #include <QtGui/QPainter>
44 #include <QtGui/QFontMetrics>
45 #include <QtGui/QApplication>
46 #include <QtCore/QListIterator>
47 
48 
49 static const Okteta::Address DefaultStartOffset = 0;
50 static const Okteta::Address DefaultFirstLineOffset = 0;
51 static const int DefaultNoOfBytesPerLine = 16;
52 static const LayoutStyle DefaultResizeStyle = FixedLayoutStyle; //krazy:exclude=staticobjects
53 static const Okteta::ValueCoding DefaultValueCoding = Okteta::HexadecimalCoding; //krazy:exclude=staticobjects
54 static const Okteta::CharCoding DefaultCharCoding = Okteta::LocalEncoding; //krazy:exclude=staticobjects
55 
56 
57 static const int BAFInitialHeight = 50;
58 static const int BAFInitialWidth = 50;
59 
60 
61 ByteArrayFrameRenderer::ByteArrayFrameRenderer()
62  : mHeight( BAFInitialHeight ),
63  mWidth( BAFInitialWidth ),
64  mByteArrayModel( 0 ),
65  mCharCodec( 0 ),
66  mResizeStyle( DefaultResizeStyle )
67 {
68  mLayout = new Okteta::ByteArrayTableLayout( DefaultNoOfBytesPerLine, DefaultFirstLineOffset, DefaultStartOffset, 0, 0 );
69  mLayout->setNoOfLinesPerPage( noOfLinesPerFrame() );
70  mTableRanges = new Okteta::ByteArrayTableRanges( mLayout );
71 
72  // set codecs
73  mValueCodec = Okteta::ValueCodec::createCodec( (Okteta::ValueCoding)DefaultValueCoding );
74  mValueCoding = DefaultValueCoding;
75  mCharCodec = Okteta::CharCodec::createCodec( (Okteta::CharCoding)DefaultCharCoding );
76  mCharCoding = DefaultCharCoding;
77 
78  mStylist = new Okteta::PrintColumnStylist();
79 
80  // creating the columns in the needed order
81  mOffsetColumnRenderer =
82  new Okteta::OffsetColumnRenderer( mStylist, mLayout, Okteta::OffsetFormat::Hexadecimal );
83  mFirstBorderColumnRenderer =
84  new Okteta::BorderColumnRenderer( mStylist, true, false );
85  mValueColumnRenderer =
86  new Okteta::ValueByteArrayColumnRenderer( mStylist, mByteArrayModel, mLayout, mTableRanges );
87  mSecondBorderColumnRenderer =
88  new Okteta::BorderColumnRenderer( mStylist, true, false );
89  mCharColumnRenderer =
90  new Okteta::CharByteArrayColumnRenderer( mStylist, mByteArrayModel, mLayout, mTableRanges );
91 
92  addColumn( mOffsetColumnRenderer );
93  addColumn( mFirstBorderColumnRenderer );
94  addColumn( mValueColumnRenderer );
95  addColumn( mSecondBorderColumnRenderer );
96  addColumn( mCharColumnRenderer );
97 
98  mValueColumnRenderer->setValueCodec( (Okteta::ValueCoding)mValueCoding, mValueCodec );
99  mValueColumnRenderer->setCharCodec( mCharCodec );
100  mCharColumnRenderer->setCharCodec( mCharCodec );
101 
102  setFont( KGlobalSettings::fixedFont() );
103 }
104 
105 Okteta::AbstractByteArrayModel* ByteArrayFrameRenderer::byteArrayModel() const { return mByteArrayModel; }
106 Okteta::Address ByteArrayFrameRenderer::offset() const { return mLayout->startOffset(); }
107 Okteta::Size ByteArrayFrameRenderer::length() const { return mLayout->length(); }
108 
109 int ByteArrayFrameRenderer::noOfBytesPerLine() const { return mLayout->noOfBytesPerLine(); }
110 Okteta::Address ByteArrayFrameRenderer::firstLineOffset() const { return mLayout->firstLineOffset(); }
111 Okteta::Address ByteArrayFrameRenderer::startOffset() const { return mLayout->startOffset(); }
112 LayoutStyle ByteArrayFrameRenderer::layoutStyle() const { return mResizeStyle; }
113 Okteta::ValueCoding ByteArrayFrameRenderer::valueCoding() const { return mValueCoding; }
114 Okteta::PixelX ByteArrayFrameRenderer::byteSpacingWidth() const { return mValueColumnRenderer->byteSpacingWidth(); }
115 int ByteArrayFrameRenderer::noOfGroupedBytes() const { return mValueColumnRenderer->noOfGroupedBytes(); }
116 Okteta::PixelX ByteArrayFrameRenderer::groupSpacingWidth() const { return mValueColumnRenderer->groupSpacingWidth(); }
117 Okteta::PixelX ByteArrayFrameRenderer::binaryGapWidth() const { return mValueColumnRenderer->binaryGapWidth(); }
118 bool ByteArrayFrameRenderer::showsNonprinting() const { return mCharColumnRenderer->isShowingNonprinting(); }
119 QChar ByteArrayFrameRenderer::substituteChar() const { return mCharColumnRenderer->substituteChar(); }
120 QChar ByteArrayFrameRenderer::undefinedChar() const { return mCharColumnRenderer->undefinedChar(); }
121 Okteta::CharCoding ByteArrayFrameRenderer::charCoding() const { return mCharCoding; }
122 const QString& ByteArrayFrameRenderer::charCodingName() const { return mCharCodec->name(); }
123 
124 bool ByteArrayFrameRenderer::offsetColumnVisible() const { return mOffsetColumnRenderer->isVisible(); }
125 int ByteArrayFrameRenderer::visibleByteArrayCodings() const
126 { return (mValueColumnRenderer->isVisible() ? ValueCodingId : 0) | (mCharColumnRenderer->isVisible() ? CharCodingId : 0); }
127 
128 int ByteArrayFrameRenderer::height() const { return mHeight; }
129 int ByteArrayFrameRenderer::width() const { return mWidth; }
130 
131 int ByteArrayFrameRenderer::framesCount() const
132 {
133  const int charsPerFrame = mLayout->noOfBytesPerLine() * noOfLinesPerFrame();
134 
135  // clever calculation works: at least one page for the rest
136  // hard to describe, think yourself
137  // TODO: needs to include the offset in the first line
138  const int frames = ( (mLayout->length()-1) / charsPerFrame ) + 1;
139 
140  return frames;
141 }
142 
143 void ByteArrayFrameRenderer::setByteArrayModel( Okteta::AbstractByteArrayModel* byteArrayModel,
144  Okteta::Address offset, Okteta::Size length )
145 {
146  mByteArrayModel = byteArrayModel;
147  length = ( byteArrayModel == 0 ) ? 0 :
148  ( length == -1 ) ? byteArrayModel->size()-offset :
149  ( length <= byteArrayModel->size()-offset ) ? length :
150  byteArrayModel->size()-offset;
151 
152  mValueColumnRenderer->set( byteArrayModel );
153  mCharColumnRenderer->set( byteArrayModel );
154 
155  // affected:
156  // length -> no of lines -> width
157  mLayout->setByteArrayOffset( offset );
158  mLayout->setLength( length );
159 
160  adjustLayoutToSize();
161 }
162 
163 void ByteArrayFrameRenderer::setHeight( int height ) { mHeight = height; }
164 void ByteArrayFrameRenderer::setWidth( int width )
165 {
166  if( mWidth == width )
167  return;
168 
169  mWidth = width;
170 
171  adjustToWidth();
172 }
173 
174 void ByteArrayFrameRenderer::setFirstLineOffset( Okteta::Address firstLineOffset )
175 {
176  if( !mLayout->setFirstLineOffset(firstLineOffset) )
177  return;
178 
179  // affects:
180  // the no of lines -> width
181  adjustLayoutToSize();
182 }
183 
184 void ByteArrayFrameRenderer::setStartOffset( Okteta::Address startOffset )
185 {
186  if( !mLayout->setStartOffset(startOffset) )
187  return;
188 
189  // affects:
190  // the no of lines -> width
191  adjustLayoutToSize();
192 }
193 
194 
195 void ByteArrayFrameRenderer::setBufferSpacing( Okteta::PixelX byteSpacing, int noOfGroupedBytes, Okteta::PixelX groupSpacing )
196 {
197  if( !mValueColumnRenderer->setSpacing(byteSpacing,noOfGroupedBytes,groupSpacing) )
198  return;
199 
200  adjustToWidth();
201 }
202 
203 
204 void ByteArrayFrameRenderer::setLayoutStyle( LayoutStyle style )
205 {
206  if( mResizeStyle == style )
207  return;
208 
209  mResizeStyle = style;
210 
211  adjustToWidth();
212 }
213 
214 
215 void ByteArrayFrameRenderer::setNoOfBytesPerLine( int noOfBytesPerLine )
216 {
217  // if the number is explicitly set we expect a wish for no automatic resize
218  mResizeStyle = FixedLayoutStyle;
219 
220  if( !mLayout->setNoOfBytesPerLine(noOfBytesPerLine) )
221  return;
222  adjustToWidth();
223 }
224 
225 
226 void ByteArrayFrameRenderer::setByteSpacingWidth( Okteta::PixelX byteSpacingWidth )
227 {
228  if( !mValueColumnRenderer->setByteSpacingWidth(byteSpacingWidth) )
229  return;
230  adjustToWidth();
231 }
232 
233 void ByteArrayFrameRenderer::setNoOfGroupedBytes( int noOfGroupedBytes )
234 {
235  if( !mValueColumnRenderer->setNoOfGroupedBytes(noOfGroupedBytes) )
236  return;
237  adjustToWidth();
238 }
239 
240 
241 void ByteArrayFrameRenderer::setGroupSpacingWidth( Okteta::PixelX groupSpacingWidth )
242 {
243  if( !mValueColumnRenderer->setGroupSpacingWidth(groupSpacingWidth) )
244  return;
245  adjustToWidth();
246 }
247 
248 
249 void ByteArrayFrameRenderer::setBinaryGapWidth( Okteta::PixelX binaryGapWidth )
250 {
251  if( !mValueColumnRenderer->setBinaryGapWidth(binaryGapWidth) )
252  return;
253  adjustToWidth();
254 }
255 
256 
257 void ByteArrayFrameRenderer::setSubstituteChar( QChar substituteChar )
258 {
259  mCharColumnRenderer->setSubstituteChar( substituteChar );
260 }
261 
262 void ByteArrayFrameRenderer::setUndefinedChar( QChar undefinedChar )
263 {
264  mCharColumnRenderer->setUndefinedChar( undefinedChar );
265 }
266 
267 void ByteArrayFrameRenderer::setShowsNonprinting( bool showsNonprinting )
268 {
269  mCharColumnRenderer->setShowingNonprinting( showsNonprinting );
270 }
271 
272 
273 void ByteArrayFrameRenderer::setValueCoding( Okteta::ValueCoding valueCoding )
274 {
275  if( mValueCoding == valueCoding )
276  return;
277 
278  const uint oldCodingWidth = mValueCodec->encodingWidth();
279 
280  Okteta::ValueCodec* newValueCodec =
281  Okteta::ValueCodec::createCodec( valueCoding );
282  if( newValueCodec == 0 )
283  return;
284 
285  delete mValueCodec;
286  mValueCodec = newValueCodec;
287  mValueCoding = valueCoding;
288 
289  mValueColumnRenderer->setValueCodec( (Okteta::ValueCoding)mValueCoding, mValueCodec );
290 
291  const uint newCodingWidth = mValueCodec->encodingWidth();
292 
293  // change in the width?
294  if( newCodingWidth != oldCodingWidth )
295  adjustToWidth();
296 }
297 
298 
299 void ByteArrayFrameRenderer::setCharCoding( Okteta::CharCoding charCoding )
300 {
301  if( mCharCoding == charCoding )
302  return;
303 
304  Okteta::CharCodec* newCharCodec = Okteta::CharCodec::createCodec( charCoding );
305  if( newCharCodec == 0 )
306  return;
307 
308  delete mCharCodec;
309  mCharCodec = newCharCodec;
310  mCharCoding = charCoding;
311 
312  mValueColumnRenderer->setCharCodec( mCharCodec );
313  mCharColumnRenderer->setCharCodec( mCharCodec );
314 }
315 
316 // TODO: join with function above!
317 void ByteArrayFrameRenderer::setCharCoding( const QString& newCharCodingName )
318 {
319  if( charCodingName() == newCharCodingName )
320  return;
321 
322  Okteta::CharCodec* newCharCodec = Okteta::CharCodec::createCodec( newCharCodingName );
323  if( newCharCodec == 0 )
324  return;
325 
326  delete mCharCodec;
327  mCharCodec = newCharCodec;
328  mCharCoding = Okteta::LocalEncoding; // TODO: add encoding no to every known codec
329 
330  mValueColumnRenderer->setCharCodec( mCharCodec );
331  mCharColumnRenderer->setCharCodec( mCharCodec );
332 }
333 
334 
335 void ByteArrayFrameRenderer::setFont( const QFont& font )
336 {
337  mFont = font;
338 
339  // get new values
340  QFontMetrics fontMetrics( font );
341 
342  setLineHeight( fontMetrics.height() );
343 
344  // update all dependant structures
345  mLayout->setNoOfLinesPerPage( noOfLinesPerFrame() );
346 
347  mOffsetColumnRenderer->setFontMetrics( fontMetrics );
348  mValueColumnRenderer->setFontMetrics( fontMetrics );
349  mCharColumnRenderer->setFontMetrics( fontMetrics );
350 
351  adjustToWidth();
352 }
353 
354 void ByteArrayFrameRenderer::prepare()
355 {
356 }
357 
358 void ByteArrayFrameRenderer::renderFrame( QPainter *painter, int frameIndex )
359 {
360  painter->setFont( mFont );
361  AbstractColumnFrameRenderer::renderFrame( painter, frameIndex );
362 }
363 
364 void ByteArrayFrameRenderer::adjustToWidth()
365 {
366  adjustToLayoutNoOfBytesPerLine();
367  adjustLayoutToSize();
368 }
369 
370 void ByteArrayFrameRenderer::adjustLayoutToSize()
371 {
372  // check whether there is a change with the numbers of fitting bytes per line
373  if( mResizeStyle != FixedLayoutStyle )
374  {
375  const int bytesPerLine = fittingBytesPerLine();
376 
377  // changes?
378  if( mLayout->setNoOfBytesPerLine(bytesPerLine) )
379  adjustToLayoutNoOfBytesPerLine();
380  }
381 
382  setNoOfLines( mLayout->noOfLines() );
383 }
384 
385 
386 void ByteArrayFrameRenderer::adjustToLayoutNoOfBytesPerLine()
387 {
388  mValueColumnRenderer->resetXBuffer();
389  mCharColumnRenderer->resetXBuffer();
390 
391  updateWidths();
392 }
393 
394 void ByteArrayFrameRenderer::showOffsetColumn( bool visible )
395 {
396  bool OCVisible = mOffsetColumnRenderer->isVisible();
397  // no change?
398  if( OCVisible == visible )
399  return;
400 
401  mOffsetColumnRenderer->setVisible( visible );
402  mFirstBorderColumnRenderer->setVisible( visible );
403 
404  adjustToWidth();
405 }
406 
407 #if 0
408 QSize ByteArrayFrameRenderer::sizeHint() const
409 {
410  return QSize( columnsWidth(), columnsHeight() );
411 }
412 
413 
414 QSize ByteArrayFrameRenderer::minimumSizeHint() const
415 {
416  // TODO: better minimal width (visibility!)
417 
418  const int width =
419  mOffsetColumnRenderer->visibleWidth()
420  + mFirstBorderColumnRenderer->visibleWidth()
421  + mSecondBorderColumnRenderer->visibleWidth()
422  + mValueColumnRenderer->byteWidth()
423  + mCharColumnRenderer->byteWidth();
424  const int height = lineHeight() * noOfLines();
425 
426  return QSize( width, height );
427 }
428 #endif
429 
430 int ByteArrayFrameRenderer::fittingBytesPerLine() const
431 {
432  const Okteta::PixelX nonDataWidth =
433  mOffsetColumnRenderer->visibleWidth()
434  + mFirstBorderColumnRenderer->visibleWidth()
435  + mSecondBorderColumnRenderer->visibleWidth();
436 
437  // abstract offset and border columns width
438  const Okteta::PixelX maxDataWidth = width() - nonDataWidth;
439 
440  // prepare needed values
441  const Okteta::PixelX charByteWidth = mCharColumnRenderer->isVisible() ? mCharColumnRenderer->digitWidth() : 0;
442  const Okteta::PixelX valueByteWidth = mValueColumnRenderer->isVisible() ? mValueColumnRenderer->byteWidth() : 0;
443  const Okteta::PixelX valueByteSpacingWidth = mValueColumnRenderer->isVisible() ? mValueColumnRenderer->byteSpacingWidth() : 0;
444  Okteta::PixelX valueByteGroupSpacingWidth;
445  int noOfGroupedBytes = mValueColumnRenderer->noOfGroupedBytes();
446  // no grouping?
447  if( noOfGroupedBytes == 0 )
448  {
449  // faking grouping by 1
450  noOfGroupedBytes = 1;
451  valueByteGroupSpacingWidth = 0;
452  }
453  else
454  valueByteGroupSpacingWidth = mValueColumnRenderer->isVisible() ? mValueColumnRenderer->groupSpacingWidth() : 0;
455 
456  Okteta::PixelX valueByteGroupWidth = noOfGroupedBytes * valueByteWidth + (noOfGroupedBytes-1)*valueByteSpacingWidth;
457  Okteta::PixelX charByteGroupWidth = noOfGroupedBytes * charByteWidth;
458  Okteta::PixelX charAndValueGroupWidth = (valueByteGroupWidth + valueByteGroupSpacingWidth) + charByteGroupWidth;
459 
460  // calculate fitting groups per line
461 
462  // the last value byte group does not need a group spacing behind, but it gets into the calculation.
463  // so we simply add one to the max width to match that
464  const int fittingGroupsPerLine = (maxDataWidth+valueByteGroupSpacingWidth)
465  / charAndValueGroupWidth;
466 
467  // calculate the fitting bytes per line by groups
468  int fittingBytesPerLine = noOfGroupedBytes * fittingGroupsPerLine;
469 
470  // groups can be split and not only full groups are requested?
471  if( noOfGroupedBytes > 1 && mResizeStyle == FullSizeLayoutStyle )
472  {
473  const int leftDataWidth = maxDataWidth - fittingGroupsPerLine * charAndValueGroupWidth;
474 
475  if( leftDataWidth > 0 )
476  {
477  const int charAndValueByteWidth = valueByteWidth + valueByteSpacingWidth + charByteWidth;
478  // the last value byte does not need a spacing behind, but it gets into the calculation.
479  // so we simply add one to the left width to match that
480  const int ungroupedBytes = (leftDataWidth+valueByteSpacingWidth)
481  / charAndValueByteWidth;
482  fittingBytesPerLine += ungroupedBytes;
483  }
484 
485  // is there not even the space for a single byte?
486 // if( fittingBytesPerLine < 1 )
487  // ensure at least one byte per line
488 // fittingBytesPerLine = 1;
489  }
490  else
491  {
492  // is there not the space for a single group?
493 // if( fittingBytesPerLine < 1 )
494  // ensures at least one group
495 // fittingBytesPerLine = noOfGroupedBytes;
496  }
497 
498  return fittingBytesPerLine;
499 }
500 
501 
502 
503 void ByteArrayFrameRenderer::showByteArrayColumns( int newColumns )
504 {
505  int columns = visibleByteArrayCodings();
506 
507  // no changes or no column selected?
508  if( newColumns == columns || !(newColumns&( ValueCodingId | CharCodingId )) )
509  return;
510 
511  mValueColumnRenderer->setVisible( ValueCodingId & newColumns );
512  mCharColumnRenderer->setVisible( CharCodingId & newColumns );
513  mSecondBorderColumnRenderer->setVisible( newColumns == (ValueCodingId|CharCodingId) );
514 
515  adjustToWidth();
516 }
517 
518 ByteArrayFrameRenderer::~ByteArrayFrameRenderer()
519 {
520  delete mStylist;
521  delete mTableRanges;
522  delete mLayout;
523  delete mValueCodec;
524  delete mCharCodec;
525 }
Okteta::ByteArrayTableLayout::noOfLines
LineSize noOfLines() const
tells how much lines this layout needs (incl.
Definition: bytearraytablelayout.h:221
ByteArrayFrameRenderer::setFirstLineOffset
void setFirstLineOffset(Okteta::Address firstLineOffset)
Definition: bytearrayframerenderer.cpp:174
ByteArrayFrameRenderer::setWidth
void setWidth(int width)
Definition: bytearrayframerenderer.cpp:164
AbstractColumnFrameRenderer::updateWidths
void updateWidths()
recalculates the positions of the columns and the total width
Definition: abstractcolumnframerenderer.cpp:115
Okteta::OffsetColumnRenderer
Definition: offsetcolumnrenderer.h:42
Okteta::ByteArrayTableLayout::startOffset
Address startOffset() const
Definition: bytearraytablelayout.h:207
Okteta::Address
qint32 Address
Definition: address.h:34
Okteta::AbstractByteArrayModel
could it be useful to hide the data access behind an iterator? * class KDataBufferIterator { public: ...
Definition: abstractbytearraymodel.h:79
Okteta::ValueCodec::createCodec
static ValueCodec * createCodec(ValueCoding valueCoding)
Definition: valuecodec.cpp:36
DefaultNoOfBytesPerLine
static const int DefaultNoOfBytesPerLine
Definition: bytearrayframerenderer.cpp:51
ByteArrayFrameRenderer::width
virtual int width() const
Definition: bytearrayframerenderer.cpp:129
ByteArrayFrameRenderer::CharCodingId
Definition: bytearrayframerenderer.h:57
Okteta::CharByteArrayColumnRenderer::setSubstituteChar
bool setSubstituteChar(QChar substituteChar)
sets the substitute character for "unprintable" chars returns true if there was a change ...
Definition: charbytearraycolumnrenderer.h:90
abstractbytearraymodel.h
Okteta::ByteArrayTableLayout::setNoOfLinesPerPage
void setNoOfLinesPerPage(LineSize noOfLinesPerPage)
sets number of lines per page, 1 as default
Definition: bytearraytablelayout.cpp:138
Okteta::ByteArrayTableRanges
a class to control all the ranges like marking and selections holds also all modified ranges and merg...
Definition: bytearraytableranges.h:45
Okteta::ByteArrayTableLayout::noOfBytesPerLine
Size noOfBytesPerLine() const
returns number of bytes per line
Definition: bytearraytablelayout.h:209
ByteArrayFrameRenderer::visibleByteArrayCodings
int visibleByteArrayCodings() const
Definition: bytearrayframerenderer.cpp:125
ByteArrayFrameRenderer::setLayoutStyle
void setLayoutStyle(LayoutStyle style)
Definition: bytearrayframerenderer.cpp:204
Okteta::ByteArrayTableLayout::firstLineOffset
Address firstLineOffset() const
Definition: bytearraytablelayout.h:208
AbstractColumnFrameRenderer::noOfLines
Okteta::LineSize noOfLines() const
returns the number of all lines
Definition: abstractcolumnframerenderer.cpp:85
offsetcolumnrenderer.h
Okteta::ValueByteArrayColumnRenderer::setBinaryGapWidth
bool setBinaryGapWidth(PixelX binaryGapWidth)
sets the spacing in the middle of a binary byte in the value column
Definition: valuebytearraycolumnrenderer.cpp:65
ByteArrayFrameRenderer::mCharCodec
Okteta::CharCodec * mCharCodec
Definition: bytearrayframerenderer.h:165
Okteta::CharCoding
CharCoding
Definition: oktetacore.h:39
ByteArrayFrameRenderer::binaryGapWidth
Okteta::PixelX binaryGapWidth() const
Definition: bytearrayframerenderer.cpp:117
printcolumnstylist.h
ByteArrayFrameRenderer::offset
Okteta::Address offset() const
Definition: bytearrayframerenderer.cpp:106
ByteArrayFrameRenderer::showByteArrayColumns
void showByteArrayColumns(int CCs)
Definition: bytearrayframerenderer.cpp:503
ByteArrayFrameRenderer::byteSpacingWidth
Okteta::PixelX byteSpacingWidth() const
Definition: bytearrayframerenderer.cpp:114
ByteArrayFrameRenderer::undefinedChar
QChar undefinedChar() const
Definition: bytearrayframerenderer.cpp:120
ByteArrayFrameRenderer::mValueCoding
Okteta::ValueCoding mValueCoding
Definition: bytearrayframerenderer.h:163
ByteArrayFrameRenderer::setBinaryGapWidth
void setBinaryGapWidth(Okteta::PixelX binaryGapWidth)
Definition: bytearrayframerenderer.cpp:249
ByteArrayFrameRenderer::mStylist
Okteta::PrintColumnStylist * mStylist
Definition: bytearrayframerenderer.h:157
ByteArrayFrameRenderer::height
virtual int height() const
Definition: bytearrayframerenderer.cpp:128
FixedLayoutStyle
Definition: bytearrayframerenderer.h:51
Okteta::AbstractByteArrayColumnRenderer::resetXBuffer
void resetXBuffer()
creates new buffer for x-values; to be called on any change of NoOfBytesPerLine or metrics ...
Definition: abstractbytearraycolumnrenderer.cpp:77
DefaultValueCoding
static const Okteta::ValueCoding DefaultValueCoding
Definition: bytearrayframerenderer.cpp:53
ByteArrayFrameRenderer::setBufferSpacing
void setBufferSpacing(Okteta::PixelX byteSpacing, int noOfGroupedBytes, Okteta::PixelX groupSpacing)
Definition: bytearrayframerenderer.cpp:195
ByteArrayFrameRenderer::offsetColumnVisible
bool offsetColumnVisible() const
Definition: bytearrayframerenderer.cpp:124
AbstractColumnFrameRenderer::noOfLinesPerFrame
Okteta::LineSize noOfLinesPerFrame() const
returns number of fully visible lines, at least 1 (as needed by page down/up) doesn't care about the ...
Definition: abstractcolumnframerenderer.cpp:121
ByteArrayFrameRenderer::mLayout
Okteta::ByteArrayTableLayout * mLayout
holds the logical layout
Definition: bytearrayframerenderer.h:148
Okteta::AbstractByteArrayColumnRenderer::groupSpacingWidth
PixelX groupSpacingWidth() const
Definition: abstractbytearraycolumnrenderer.h:252
Okteta::BorderColumnRenderer
column that does nothing but draw a vertical line in the middle of the column
Definition: bordercolumnrenderer.h:38
LayoutStyle
LayoutStyle
Definition: bytearrayframerenderer.h:51
valuebytearraycolumnrenderer.h
Okteta::PrintColumnStylist
Definition: printcolumnstylist.h:35
ByteArrayFrameRenderer::setGroupSpacingWidth
void setGroupSpacingWidth(Okteta::PixelX groupSpacingWidth)
Definition: bytearrayframerenderer.cpp:241
Okteta::ValueByteArrayColumnRenderer
buffer column which displays the numerical values of the bytes
Definition: valuebytearraycolumnrenderer.h:39
Okteta::AbstractColumnRenderer::setVisible
void setVisible(bool isVisible)
sets visibily
Definition: abstractcolumnrenderer.cpp:51
AbstractColumnFrameRenderer::setLineHeight
virtual void setLineHeight(Okteta::PixelY NewLineHeight)
sets height of all lines and propagates this information to all columns doesn't update the content si...
Definition: abstractcolumnframerenderer.cpp:100
ByteArrayFrameRenderer::setShowsNonprinting
void setShowsNonprinting(bool showsNonprinting)
Definition: bytearrayframerenderer.cpp:267
AbstractColumnFrameRenderer::columnsHeight
Okteta::PixelY columnsHeight() const
returns the height of all lines together
Definition: abstractcolumnframerenderer.cpp:88
Okteta::ByteArrayTableLayout::setFirstLineOffset
bool setFirstLineOffset(Address firstLineOffset)
sets mStartOffset, returns true if changed
Definition: bytearraytablelayout.cpp:63
ByteArrayFrameRenderer::adjustToLayoutNoOfBytesPerLine
void adjustToLayoutNoOfBytesPerLine()
Definition: bytearrayframerenderer.cpp:386
ByteArrayFrameRenderer::length
Okteta::Size length() const
Definition: bytearrayframerenderer.cpp:107
bytearraytablelayout.h
Okteta::ByteArrayTableLayout
the logical layout of a byte array table for a view
Definition: bytearraytablelayout.h:61
ByteArrayFrameRenderer::setByteSpacingWidth
void setByteSpacingWidth(Okteta::PixelX byteSpacingWidth)
Definition: bytearrayframerenderer.cpp:226
Okteta::AbstractByteArrayColumnRenderer::digitWidth
PixelX digitWidth() const
Definition: abstractbytearraycolumnrenderer.h:250
ByteArrayFrameRenderer::framesCount
virtual int framesCount() const
Definition: bytearrayframerenderer.cpp:131
Okteta::ValueByteArrayColumnRenderer::setValueCodec
void setValueCodec(ValueCoding valueCoding, const ValueCodec *valueCodec)
Definition: valuebytearraycolumnrenderer.cpp:51
Okteta::PixelX
int PixelX
Definition: kadds.h:34
Okteta::AbstractByteArrayColumnRenderer::byteWidth
PixelX byteWidth() const
Definition: abstractbytearraycolumnrenderer.h:249
Okteta::AbstractByteArrayModel::size
virtual Size size() const =0
ByteArrayFrameRenderer::setValueCoding
void setValueCoding(Okteta::ValueCoding valueCoding)
Definition: bytearrayframerenderer.cpp:273
ByteArrayFrameRenderer::mCharColumnRenderer
Okteta::CharByteArrayColumnRenderer * mCharColumnRenderer
Definition: bytearrayframerenderer.h:156
ByteArrayFrameRenderer::charCoding
Okteta::CharCoding charCoding() const
Definition: bytearrayframerenderer.cpp:121
Okteta::CharByteArrayColumnRenderer::substituteChar
QChar substituteChar() const
returns the actually used substitute character for "unprintable" chars, default is '...
Definition: charbytearraycolumnrenderer.h:87
ByteArrayFrameRenderer::mFirstBorderColumnRenderer
Okteta::BorderColumnRenderer * mFirstBorderColumnRenderer
Definition: bytearrayframerenderer.h:153
Okteta::AbstractColumnRenderer::visibleWidth
PixelX visibleWidth() const
convenience: returns width if visible else 0
Definition: abstractcolumnrenderer.cpp:46
Okteta::CharByteArrayColumnRenderer::setShowingNonprinting
bool setShowingNonprinting(bool showingNonprinting=true)
sets whether "unprintable" chars (>32) should be displayed in the char column with their correspondin...
Definition: charbytearraycolumnrenderer.h:108
Okteta::CharCodec
Definition: charcodec.h:42
ByteArrayFrameRenderer::noOfGroupedBytes
int noOfGroupedBytes() const
Definition: bytearrayframerenderer.cpp:115
ByteArrayFrameRenderer::showOffsetColumn
void showOffsetColumn(bool visible)
Definition: bytearrayframerenderer.cpp:394
AbstractColumnFrameRenderer::setNoOfLines
virtual void setNoOfLines(Okteta::LineSize NewNoOfLines)
sets the number of lines doesn't update the content size
Definition: abstractcolumnframerenderer.cpp:91
AbstractColumnFrameRenderer::renderFrame
virtual void renderFrame(QPainter *painter, int frameIndex)
Definition: abstractcolumnframerenderer.cpp:157
ByteArrayFrameRenderer::mByteArrayModel
Okteta::AbstractByteArrayModel * mByteArrayModel
Definition: bytearrayframerenderer.h:144
bordercolumnrenderer.h
Okteta::OffsetFormat::Hexadecimal
Definition: offsetformat.h:43
Okteta::ValueCodec
Class that is able to convert codings to and from hexadecimal, decimal, octal, and binary...
Definition: valuecodec.h:45
ByteArrayFrameRenderer::mFont
QFont mFont
Definition: bytearrayframerenderer.h:142
ByteArrayFrameRenderer::~ByteArrayFrameRenderer
virtual ~ByteArrayFrameRenderer()
Definition: bytearrayframerenderer.cpp:518
ByteArrayFrameRenderer::setUndefinedChar
void setUndefinedChar(QChar undefinedChar)
Definition: bytearrayframerenderer.cpp:262
ByteArrayFrameRenderer::fittingBytesPerLine
int fittingBytesPerLine() const
Definition: bytearrayframerenderer.cpp:430
Okteta::CharCodec::createCodec
static CharCodec * createCodec(CharCoding charCoding)
Definition: charcodec.cpp:68
DefaultFirstLineOffset
static const Okteta::Address DefaultFirstLineOffset
Definition: bytearrayframerenderer.cpp:50
ByteArrayFrameRenderer::mTableRanges
Okteta::ByteArrayTableRanges * mTableRanges
Definition: bytearrayframerenderer.h:149
ByteArrayFrameRenderer::setSubstituteChar
void setSubstituteChar(QChar substituteChar)
Definition: bytearrayframerenderer.cpp:257
valuecodec.h
Okteta::AbstractByteArrayColumnRenderer::setNoOfGroupedBytes
bool setNoOfGroupedBytes(int noOfGroupedBytes)
sets the number of grouped bytes in the hex column
Definition: abstractbytearraycolumnrenderer.cpp:140
ByteArrayFrameRenderer::startOffset
Okteta::Address startOffset() const
Definition: bytearrayframerenderer.cpp:111
Okteta::AbstractByteArrayColumnRenderer::setGroupSpacingWidth
bool setGroupSpacingWidth(PixelX groupSpacingWidth)
sets the spacing between the groups of bytes in the hex column
Definition: abstractbytearraycolumnrenderer.cpp:154
Okteta::CharByteArrayColumnRenderer::undefinedChar
QChar undefinedChar() const
returns the actually used undefined character for "undefined" chars, default is '?'
Definition: charbytearraycolumnrenderer.h:88
bytearrayframerenderer.h
Okteta::AbstractByteArrayColumnRenderer::setSpacing
bool setSpacing(PixelX byteSpacingWidth, int noOfGroupedBytes=0, PixelX groupSpacingWidth=0)
sets the spacing in the hex column
Definition: abstractbytearraycolumnrenderer.cpp:106
ByteArrayFrameRenderer::mResizeStyle
LayoutStyle mResizeStyle
Definition: bytearrayframerenderer.h:170
ByteArrayFrameRenderer::setByteArrayModel
void setByteArrayModel(Okteta::AbstractByteArrayModel *byteArrayModel, Okteta::Address offset=0, Okteta::Size length=-1)
Definition: bytearrayframerenderer.cpp:143
ByteArrayFrameRenderer::setFont
void setFont(const QFont &font)
Definition: bytearrayframerenderer.cpp:335
Okteta::AbstractByteArrayColumnRenderer::set
void set(AbstractByteArrayModel *byteArrayModel)
Definition: abstractbytearraycolumnrenderer.cpp:70
charcodec.h
AbstractColumnFrameRenderer::lineHeight
Okteta::PixelY lineHeight() const
returns the height of each line
Definition: abstractcolumnframerenderer.cpp:86
Okteta::ValueByteArrayColumnRenderer::binaryGapWidth
PixelX binaryGapWidth() const
Definition: valuebytearraycolumnrenderer.h:84
ByteArrayFrameRenderer::charCodingName
const QString & charCodingName() const
Definition: bytearrayframerenderer.cpp:122
ByteArrayFrameRenderer::substituteChar
QChar substituteChar() const
Definition: bytearrayframerenderer.cpp:119
Okteta::CharByteArrayColumnRenderer::setUndefinedChar
bool setUndefinedChar(QChar undefinedChar)
sets the undefined character for "undefined" chars returns true if there was a change ...
Definition: charbytearraycolumnrenderer.h:99
ByteArrayFrameRenderer::firstLineOffset
Okteta::Address firstLineOffset() const
Definition: bytearrayframerenderer.cpp:110
Okteta::ByteArrayTableLayout::setByteArrayOffset
bool setByteArrayOffset(Address byteArrayOffset)
sets offset in the data to display, returns true if changed
Definition: bytearraytablelayout.cpp:99
ByteArrayFrameRenderer::mValueColumnRenderer
Okteta::ValueByteArrayColumnRenderer * mValueColumnRenderer
Definition: bytearrayframerenderer.h:154
ByteArrayFrameRenderer::valueCoding
Okteta::ValueCoding valueCoding() const
Definition: bytearrayframerenderer.cpp:113
ByteArrayFrameRenderer::showsNonprinting
bool showsNonprinting() const
Definition: bytearrayframerenderer.cpp:118
ByteArrayFrameRenderer::layoutStyle
LayoutStyle layoutStyle() const
Definition: bytearrayframerenderer.cpp:112
ByteArrayFrameRenderer::setStartOffset
void setStartOffset(Okteta::Address startOffset)
Definition: bytearrayframerenderer.cpp:184
AbstractColumnFrameRenderer::columnsWidth
Okteta::PixelX columnsWidth() const
returns the width of all visible columns together
Definition: abstractcolumnframerenderer.cpp:89
Okteta::ValueCoding
ValueCoding
Definition: oktetacore.h:34
Okteta::CharCodec::name
virtual const QString & name() const =0
ByteArrayFrameRenderer::groupSpacingWidth
Okteta::PixelX groupSpacingWidth() const
Definition: bytearrayframerenderer.cpp:116
AbstractColumnFrameRenderer::addColumn
void addColumn(Okteta::AbstractColumnRenderer *column)
takes ownership of column renderer
Definition: abstractcolumnframerenderer.cpp:137
ByteArrayFrameRenderer::mHeight
int mHeight
Definition: bytearrayframerenderer.h:140
Okteta::ByteArrayTableLayout::setLength
bool setLength(Size length)
sets length of data to display, returns true if changed
Definition: bytearraytablelayout.cpp:119
DefaultResizeStyle
static const LayoutStyle DefaultResizeStyle
Definition: bytearrayframerenderer.cpp:52
bytearraytableranges.h
Okteta::LocalEncoding
the coding of your shell
Definition: oktetacore.h:42
DefaultCharCoding
static const Okteta::CharCoding DefaultCharCoding
Definition: bytearrayframerenderer.cpp:54
BAFInitialHeight
static const int BAFInitialHeight
Definition: bytearrayframerenderer.cpp:57
ByteArrayFrameRenderer::noOfBytesPerLine
int noOfBytesPerLine() const
Definition: bytearrayframerenderer.cpp:109
Okteta::Size
qint32 Size
Definition: size.h:33
ByteArrayFrameRenderer::renderFrame
virtual void renderFrame(QPainter *painter, int frameIndex)
Definition: bytearrayframerenderer.cpp:358
ByteArrayFrameRenderer::setHeight
void setHeight(int height)
Definition: bytearrayframerenderer.cpp:163
ByteArrayFrameRenderer::mOffsetColumnRenderer
Okteta::OffsetColumnRenderer * mOffsetColumnRenderer
Definition: bytearrayframerenderer.h:152
ByteArrayFrameRenderer::byteArrayModel
Okteta::AbstractByteArrayModel * byteArrayModel() const
Definition: bytearrayframerenderer.cpp:105
ByteArrayFrameRenderer::adjustToWidth
void adjustToWidth()
Definition: bytearrayframerenderer.cpp:364
Okteta::CharByteArrayColumnRenderer::isShowingNonprinting
bool isShowingNonprinting() const
returns true if "unprintable" chars (>32) are displayed in the char column with their corresponding c...
Definition: charbytearraycolumnrenderer.h:86
FullSizeLayoutStyle
Definition: bytearrayframerenderer.h:51
ByteArrayFrameRenderer::setNoOfGroupedBytes
void setNoOfGroupedBytes(int noOfGroupedBytes)
Definition: bytearrayframerenderer.cpp:233
Okteta::OffsetColumnRenderer::setFontMetrics
void setFontMetrics(const QFontMetrics &fontMetrics)
Definition: offsetcolumnrenderer.cpp:124
Okteta::AbstractColumnRenderer::isVisible
bool isVisible() const
should Column be displayed?
Definition: abstractcolumnrenderer.cpp:45
Okteta::ValueCodec::encodingWidth
virtual unsigned int encodingWidth() const =0
ByteArrayFrameRenderer::adjustLayoutToSize
void adjustLayoutToSize()
Definition: bytearrayframerenderer.cpp:370
Okteta::CharByteArrayColumnRenderer
buffer column that interprets the bytes as chars
Definition: charbytearraycolumnrenderer.h:37
ByteArrayFrameRenderer::ByteArrayFrameRenderer
ByteArrayFrameRenderer()
Definition: bytearrayframerenderer.cpp:61
ByteArrayFrameRenderer::mValueCodec
Okteta::ValueCodec * mValueCodec
Definition: bytearrayframerenderer.h:161
ByteArrayFrameRenderer::mSecondBorderColumnRenderer
Okteta::BorderColumnRenderer * mSecondBorderColumnRenderer
Definition: bytearrayframerenderer.h:155
BAFInitialWidth
static const int BAFInitialWidth
Definition: bytearrayframerenderer.cpp:58
ByteArrayFrameRenderer::prepare
virtual void prepare()
painting will start, fix all things like Time and Data
Definition: bytearrayframerenderer.cpp:354
Okteta::ByteArrayTableLayout::setStartOffset
bool setStartOffset(Address startOffset)
sets mStartOffset, returns true if changed
Definition: bytearraytablelayout.cpp:46
charbytearraycolumnrenderer.h
ByteArrayFrameRenderer::mCharCoding
Okteta::CharCoding mCharCoding
Definition: bytearrayframerenderer.h:167
ByteArrayFrameRenderer::setCharCoding
void setCharCoding(Okteta::CharCoding charCoding)
Definition: bytearrayframerenderer.cpp:299
Okteta::AbstractByteArrayColumnRenderer::setFontMetrics
void setFontMetrics(const QFontMetrics &fontMetrics)
sets the metrics of the used font
Definition: abstractbytearraycolumnrenderer.cpp:91
Okteta::ByteArrayTableLayout::setNoOfBytesPerLine
bool setNoOfBytesPerLine(LineSize noOfBytesPerLine)
sets number of bytes per line, returns true if changed
Definition: bytearraytablelayout.cpp:81
Okteta::AbstractByteArrayColumnRenderer::noOfGroupedBytes
int noOfGroupedBytes() const
Definition: abstractbytearraycolumnrenderer.h:254
Okteta::AbstractByteArrayColumnRenderer::setByteSpacingWidth
bool setByteSpacingWidth(PixelX byteSpacingWidth)
sets the spacing between the bytes in the hex column
Definition: abstractbytearraycolumnrenderer.cpp:124
Okteta::AbstractByteArrayColumnRenderer::byteSpacingWidth
PixelX byteSpacingWidth() const
Definition: abstractbytearraycolumnrenderer.h:251
ByteArrayFrameRenderer::ValueCodingId
Definition: bytearrayframerenderer.h:57
Okteta::HexadecimalCoding
Definition: oktetacore.h:34
Okteta::ByteArrayTableLayout::length
Size length() const
returns the length of the displayed byte array section
Definition: bytearraytablelayout.h:211
DefaultStartOffset
static const Okteta::Address DefaultStartOffset
Definition: bytearrayframerenderer.cpp:49
ByteArrayFrameRenderer::setNoOfBytesPerLine
void setNoOfBytesPerLine(int noOfBytesPerLine)
Definition: bytearrayframerenderer.cpp:215
Okteta::AbstractByteArrayColumnRenderer::setCharCodec
void setCharCodec(const CharCodec *charCodec)
sets the codec to be used by the char column.
Definition: abstractbytearraycolumnrenderer.h:262
ByteArrayFrameRenderer::mWidth
int mWidth
Definition: bytearrayframerenderer.h:141
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

KDE's Doxygen guidelines are available online.

okteta

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

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal