• 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
  • gui
abstractbytearraycolumnrenderer.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta Gui library, made within the KDE community.
3 
4  Copyright 2003,2007-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 "abstractbytearraycolumnrenderer.h"
24 
25 // lib
26 #include "oktetagui.h"
27 #include "bytearraytableranges.h"
28 #include "bytearraytablecursor.h"
29 #include "bytearraytablelayout.h"
30 #include "helper.h"
31 // lib
32 #include <abstractcolumnstylist.h>
33 // Okteta core
34 #include <bookmarkable.h>
35 #include <bookmarksconstiterator.h>
36 #include <bookmark.h>
37 #include <charcodec.h>
38 // KDE
39 #include <KColorScheme>
40 // Qt
41 #include <QtGui/QPainter>
42 #include <QtGui/QFontMetrics>
43 
44 
45 namespace Okteta
46 {
47 
48 AbstractByteArrayColumnRenderer::AbstractByteArrayColumnRenderer( AbstractColumnStylist* stylist,
49  AbstractByteArrayModel* byteArrayModel, ByteArrayTableLayout* layout, ByteArrayTableRanges* ranges )
50  : AbstractColumnRenderer( stylist ),
51  mByteArrayModel( byteArrayModel ),
52  mLayout( layout ),
53  mRanges( ranges ),
54  mBookmarks( qobject_cast<Bookmarkable*>(byteArrayModel) ),
55  mDigitWidth( 0 ),
56  mDigitBaseLine( 0 ),
57  mFontMetrics( QFont() ),
58  mByteWidth( 0 ),
59  mByteSpacingWidth( DefaultByteSpacingWidth ),
60  mGroupSpacingWidth( DefaultGroupSpacingWidth ),
61  mNoOfGroupedBytes( DefaultNoOfGroupedBytes ),
62  mLinePosLeftPixelX( 0 ),
63  mLinePosRightPixelX( 0 ),
64  mLastLinePos( 0 ),
65  mByteTypeColored( true )
66 {
67 }
68 
69 
70 void AbstractByteArrayColumnRenderer::set( AbstractByteArrayModel* byteArrayModel )
71 {
72  mByteArrayModel = byteArrayModel;
73  mBookmarks = qobject_cast<Bookmarkable*>(byteArrayModel );
74 }
75 
76 
77 void AbstractByteArrayColumnRenderer::resetXBuffer()
78 {
79  delete [] mLinePosLeftPixelX;
80  delete [] mLinePosRightPixelX;
81 
82  mLastLinePos = mLayout->noOfBytesPerLine()-1;
83  mLinePosLeftPixelX = new PixelX[mLastLinePos+1];
84  mLinePosRightPixelX = new PixelX[mLastLinePos+1];
85 
86  if( mLinePosLeftPixelX )
87  recalcX();
88 }
89 
90 
91 void AbstractByteArrayColumnRenderer::setFontMetrics( const QFontMetrics& fontMetrics )
92 {
93  mFontMetrics = fontMetrics;
94 
95  mDigitBaseLine = fontMetrics.ascent();
96  mDigitWidth = fontMetrics.maxWidth();
97 
98  // recalculate depend sizes
99  recalcByteWidth();
100 
101  if( mLinePosLeftPixelX )
102  recalcX();
103 }
104 
105 
106 bool AbstractByteArrayColumnRenderer::setSpacing( PixelX byteSpacingWidth, int NoGB, PixelX groupSpacingWidth )
107 {
108  // no changes?
109  if( mByteSpacingWidth == byteSpacingWidth && mNoOfGroupedBytes == NoGB && mGroupSpacingWidth == groupSpacingWidth )
110  return false;
111 
112  mByteSpacingWidth = byteSpacingWidth;
113  mNoOfGroupedBytes = NoGB;
114  mGroupSpacingWidth = groupSpacingWidth;
115 
116  // recalculate depend sizes
117  if( mLinePosLeftPixelX )
118  recalcX();
119 
120  return true;
121 }
122 
123 
124 bool AbstractByteArrayColumnRenderer::setByteSpacingWidth( PixelX byteSpacingWidth )
125 {
126  // no changes?
127  if( mByteSpacingWidth == byteSpacingWidth )
128  return false;
129 
130  mByteSpacingWidth = byteSpacingWidth;
131 
132  // recalculate depend sizes
133  if( mLinePosLeftPixelX )
134  recalcX();
135 
136  return true;
137 }
138 
139 
140 bool AbstractByteArrayColumnRenderer::setNoOfGroupedBytes( int NoGB )
141 {
142  // no changes?
143  if( mNoOfGroupedBytes == NoGB )
144  return false;
145 
146  mNoOfGroupedBytes = NoGB;
147 
148  if( mLinePosLeftPixelX )
149  recalcX();
150  return true;
151 }
152 
153 
154 bool AbstractByteArrayColumnRenderer::setGroupSpacingWidth( PixelX groupSpacingWidth )
155 {
156  // no changes?
157  if( mGroupSpacingWidth == groupSpacingWidth )
158  return false;
159 
160  mGroupSpacingWidth = groupSpacingWidth;
161 
162  // recalculate depend sizes
163  if( mLinePosLeftPixelX )
164  recalcX();
165 
166  return true;
167 }
168 
169 
170 void AbstractByteArrayColumnRenderer::recalcByteWidth()
171 {
172  setByteWidth( mDigitWidth );
173 }
174 
175 
176 void AbstractByteArrayColumnRenderer::recalcX()
177 {
178  mSpacingTrigger = noOfGroupedBytes() > 0 ? noOfGroupedBytes()-1 : mLastLinePos+1; // last ensures to never trigger the spacing
179 
180  PixelX newWidth = 0;
181  Size groupedBytes = 0;
182  PixelX* PX = mLinePosLeftPixelX;
183  PixelX* PRX = mLinePosRightPixelX;
184  LinePosition p = 0;
185  for( ; p<=mLastLinePos; ++PX, ++PRX, ++p, ++groupedBytes )
186  {
187  *PX = newWidth;
188  newWidth += mByteWidth;
189  *PRX = newWidth-1;
190 
191  // is there a space behind the actual byte (if it is not the last)?
192  if( groupedBytes == mSpacingTrigger )
193  {
194  newWidth += mGroupSpacingWidth;
195  groupedBytes = -1;
196  }
197  else
198  newWidth += mByteSpacingWidth;
199  }
200  setWidth( mLinePosRightPixelX[mLastLinePos]+1 );
201 }
202 
203 
204 // TODO: why are inlined functions not available as symbols when defined before their use
205 //TODO: works not precisly for the byte rects but includes spacing and left and right
206 /*inline*/ LinePosition AbstractByteArrayColumnRenderer::linePositionOfX( PixelX PX ) const
207 {
208  if( !mLinePosLeftPixelX )
209  return NoByteFound;
210 
211  // translate
212  PX -= x();
213  // search backwards for the first byte that is equalleft to x
214  for( LinePosition p=mLastLinePos; p>=0; --p )
215  if( mLinePosLeftPixelX[p] <= PX )
216  return p;
217 
218  return 0; //NoByteFound;
219 }
220 
221 
222 LinePosition AbstractByteArrayColumnRenderer::magneticLinePositionOfX( PixelX PX ) const
223 {
224  if( !mLinePosLeftPixelX )
225  return NoByteFound;
226 
227  // translate
228  PX -= x();
229  // search backwards for the first byte that is equalleft to x
230  for( LinePosition p = mLastLinePos; p>=0; --p )
231  if( mLinePosLeftPixelX[p] <= PX )
232  {
233  // are we close to the right?
234  if( mLinePosRightPixelX[p]-PX < mDigitWidth/2 ) // TODO: perhaps cache also the middle xpos's
235  ++p;
236  return p;
237  }
238 
239  return 0; //NoByteFound;
240 }
241 
242 
243 LinePositionRange AbstractByteArrayColumnRenderer::linePositionsOfX( PixelX PX, PixelX PW ) const
244 {
245  if( !mLinePosLeftPixelX )
246  return LinePositionRange();
247 
248  // translate
249  PX -= x();
250  const PixelX PRX = PX + PW - 1;
251 
252  LinePositionRange positions;
253  // search backwards for the first byte that is equalleft to x
254  for( LinePosition p=mLastLinePos; p>=0; --p )
255  if( mLinePosLeftPixelX[p] <= PRX )
256  {
257  positions.setEnd( p );
258  for( ; p>=0; --p )
259  if( mLinePosLeftPixelX[p] <= PX )
260  {
261  positions.setStart( p );
262  break;
263  }
264  break;
265  }
266 
267  return positions;
268 }
269 
270 
271 PixelX AbstractByteArrayColumnRenderer::xOfLinePosition( LinePosition linePosition ) const
272 {
273  return x() + ( mLinePosLeftPixelX ? mLinePosLeftPixelX[linePosition] : 0 );
274 }
275 
276 PixelX AbstractByteArrayColumnRenderer::rightXOfLinePosition( LinePosition linePosition ) const
277 {
278  return x() + ( mLinePosRightPixelX ? mLinePosRightPixelX[linePosition] : 0 );
279 }
280 
281 
282 LinePosition AbstractByteArrayColumnRenderer::linePositionOfColumnX( PixelX PX ) const
283 {
284  if( !mLinePosLeftPixelX )
285  return NoByteFound;
286 
287  // search backwards for the first byte that is equalleft to x
288  for( LinePosition p=mLastLinePos; p>=0; --p )
289  if( mLinePosLeftPixelX[p] <= PX )
290  return p;
291 
292  return 0; //NoByteFound;
293 }
294 
295 
296 LinePositionRange AbstractByteArrayColumnRenderer::linePositionsOfColumnXs( PixelX pixelX, PixelX pixelWidth ) const
297 {
298  if( ! mLinePosLeftPixelX )
299  return LinePositionRange();
300 
301  const PixelX rightPixelX = pixelX + pixelWidth - 1;
302 
303  LinePositionRange positions;
304  // search backwards for the first byte that is equalleft to x
305  for( LinePosition p=mLastLinePos; p>=0; --p )
306  if( mLinePosLeftPixelX[p] <= rightPixelX )
307  {
308  const LinePosition endPos = p;
309  positions.setEnd( p );
310  for( p=0; p<=endPos; ++p )
311  if( mLinePosRightPixelX[p] >= pixelX )
312  {
313  positions.setStart( p );
314  break;
315  }
316  break;
317  }
318 
319  return positions;
320 }
321 
322 
323 PixelX AbstractByteArrayColumnRenderer::columnXOfLinePosition( LinePosition linePosition ) const
324 {
325  return mLinePosLeftPixelX ? mLinePosLeftPixelX[linePosition] : 0;
326 }
327 
328 PixelX AbstractByteArrayColumnRenderer::columnRightXOfLinePosition( LinePosition linePosition ) const
329 {
330  return mLinePosRightPixelX ? mLinePosRightPixelX[linePosition] : 0;
331 }
332 
333 
334 PixelXRange AbstractByteArrayColumnRenderer::xsOfLinePositionsInclSpaces( const LinePositionRange& linePositions ) const
335 {
336  const PixelX x = (linePositions.start()>0) ? rightXOfLinePosition( linePositions.nextBeforeStart() ) + 1 :
337  xOfLinePosition( linePositions.start() );
338  const PixelX rightX = (linePositions.end()<mLastLinePos) ? xOfLinePosition( linePositions.nextBehindEnd() ) - 1 :
339  rightXOfLinePosition( linePositions.end() );
340  return PixelXRange( x, rightX );
341 }
342 
343 
344 PixelXRange AbstractByteArrayColumnRenderer::columnXsOfLinePositionsInclSpaces( const LinePositionRange& linePositions ) const
345 {
346  const PixelX x = (linePositions.start()>0) ? columnRightXOfLinePosition( linePositions.nextBeforeStart() ) + 1 :
347  columnXOfLinePosition( linePositions.start() );
348  const PixelX rightX = (linePositions.end()<mLastLinePos) ? columnXOfLinePosition( linePositions.nextBehindEnd() ) - 1 :
349  columnRightXOfLinePosition( linePositions.end() );
350  return PixelXRange( x, rightX );
351 }
352 
353 
354 QRect AbstractByteArrayColumnRenderer::byteRect( const Coord& coord ) const
355 {
356  const int x = xOfLinePosition( coord.pos() );
357  const int y = lineHeight() * coord.line();
358  const int w = mByteWidth;
359  const int h = lineHeight();
360  const QPoint point( x, y );
361  const QSize size( w, h );
362 
363  const QRect result( point, size );
364  return result;
365 }
366 
367 
368 void AbstractByteArrayColumnRenderer::prepareRendering( const PixelXRange& _Xs )
369 {
370  PixelXRange Xs( _Xs );
371  restrictToXSpan( &Xs );
372  // translate
373  Xs.moveBy( -x() );
374 
375  // store the values
376  mRenderX = Xs.start();
377  mRenderWidth = Xs.width();
378 
379  // get line linePositions to paint
380  mRenderLinePositions = linePositionsOfColumnXs( mRenderX, mRenderWidth );
381 }
382 
383 
384 void AbstractByteArrayColumnRenderer::renderFirstLine( QPainter* painter, const PixelXRange& Xs, Line firstLineIndex )
385 {
386  prepareRendering( Xs );
387 
388  mRenderLine = firstLineIndex;
389 
390  renderLinePositions( painter, mRenderLine++, mRenderLinePositions );
391 }
392 
393 
394 void AbstractByteArrayColumnRenderer::renderNextLine( QPainter* painter )
395 {
396  renderLinePositions( painter, mRenderLine++, mRenderLinePositions );
397 }
398 
399 
400 void AbstractByteArrayColumnRenderer::renderLinePositions( QPainter* painter, Line lineIndex, const LinePositionRange& _linePositions )
401 {
402  // clear background
403  const unsigned int blankFlag =
404  (_linePositions.start()!=0?StartsBefore:0) | (_linePositions.end()!=mLastLinePos?EndsLater:0);
405  const QBrush& backgroundBrush = stylist()->palette().brush( QPalette::Base );
406 
407  renderRange( painter, backgroundBrush, _linePositions, blankFlag );
408 
409  // no bytes to paint?
410  if( !mLayout->hasContent(lineIndex) )
411  return;
412 
413  // Go through the lines TODO: handle first and last line more effeciently
414  // check for leading and trailing spaces
415  const LinePositionRange existingLinePositions = mLayout->linePositions( lineIndex );
416 
417  LinePositionRange linePositions = _linePositions;
418  linePositions.restrictTo( existingLinePositions );
419  const int firstLinePosition = linePositions.start();
420 
421  // check for leading and trailing spaces
422  AddressRange byteIndizes =
423  AddressRange::fromWidth( mLayout->indexAtCoord(Coord( linePositions.start(), lineIndex )), linePositions.width() );
424 
425  unsigned int selectionFlag = 0;
426  unsigned int markingFlag = 0;
427  AddressRange selectedRange;
428  AddressRange markedRange;
429  bool hasMarking = mRanges->hasMarking();
430  bool hasSelection = mRanges->hasSelection();
431 
432 //kDebug() << QString("painting linePositions (painter%1-%2L%3): ").arg(linePositions.start()).arg(linePositions.end()).arg(lineIndex)
433 // <<linePositions.start()<<"-"<<linePositions.start()
434 // <<" for byteIndizes "<<byteIndizes.start()<<"-"<<byteIndizes.start()<<endl;
435  while( linePositions.isValid() )
436  {
437  LinePositionRange positionsPart = linePositions; // set of linePositions to paint next
438  AddressRange byteIndizesPart = byteIndizes; // set of indizes to paint next
439 
440  if( hasMarking && markedRange.endsBefore(byteIndizesPart) )
441  hasMarking = getNextMarkedAddressRange( &markedRange, &markingFlag, byteIndizesPart );
442 
443  if( hasSelection && selectedRange.endsBefore(byteIndizesPart) )
444  hasSelection = getNextSelectedAddressRange( &selectedRange, &selectionFlag, byteIndizesPart );
445 
446  if( byteIndizesPart.start() == markedRange.start() )
447  {
448  byteIndizesPart.setEnd( markedRange.end() );
449  positionsPart.setEndByWidth( markedRange.width() );
450 
451  if( positionsPart.start() == existingLinePositions.start() ) markingFlag &= ~StartsBefore;
452  // TODO: hack: needed because otherwise the spacing will be plain
453  else if( positionsPart.start() == firstLinePosition && selectedRange.includes(byteIndizesPart.start()) )
454  renderSelectionSpaceBehind( painter, firstLinePosition-1 );
455 
456  if( positionsPart.end() == existingLinePositions.end() ) markingFlag &= ~EndsLater;
457  // TODO: hack: needed because otherwise the spacing will be plain
458  else if( positionsPart.end() == linePositions.end() && selectedRange.includes(byteIndizesPart.end()) )
459  renderSelectionSpaceBehind( painter, positionsPart.end() );
460 
461  renderMarking( painter, positionsPart, byteIndizesPart.start(), markingFlag );
462  }
463  else if( selectedRange.includes(byteIndizesPart.start()) )
464  {
465  if( selectedRange.startsBefore(byteIndizesPart) )
466  selectionFlag |= StartsBefore;
467 
468  const bool hasMarkingBeforeSelectionEnd = ( hasMarking && markedRange.start() <= selectedRange.end() );
469 
470  byteIndizesPart.setEnd( hasMarkingBeforeSelectionEnd ? markedRange.nextBeforeStart() : selectedRange.end() );
471  positionsPart.setEndByWidth( byteIndizesPart.width() );
472 
473  if( hasMarkingBeforeSelectionEnd )
474  selectionFlag |= EndsLater;
475  if( positionsPart.start() == existingLinePositions.start() ) selectionFlag &= ~StartsBefore;
476  if( positionsPart.end() == existingLinePositions.end() ) selectionFlag &= ~EndsLater;
477 
478  renderSelection( painter, positionsPart, byteIndizesPart.start(), selectionFlag );
479  }
480  else
481  {
482  // calc end of plain text
483  if( hasMarking )
484  byteIndizesPart.setEnd( markedRange.nextBeforeStart() );
485  if( hasSelection )
486  byteIndizesPart.restrictEndTo( selectedRange.nextBeforeStart() );
487 
488  positionsPart.setEndByWidth( byteIndizesPart.width() );
489 
490  renderPlain( painter, positionsPart, byteIndizesPart.start() );
491  }
492 
493  byteIndizes.setStartNextBehind( byteIndizesPart );
494  linePositions.setStartNextBehind( positionsPart );
495  }
496 }
497 
498 
499 void AbstractByteArrayColumnRenderer::renderPlain( QPainter* painter, const LinePositionRange& linePositions, Address byteIndex )
500 {
501  BookmarksConstIterator bit;
502  Address nextBookmarkOffset = -1;
503 
504  const bool hasBookmarks = ( mBookmarks != 0 );
505  if( hasBookmarks )
506  {
507  bit = mBookmarks->createBookmarksConstIterator();
508  if( bit.findNextFrom(byteIndex) )
509  nextBookmarkOffset = bit.next().offset();
510  }
511 
512  const QPalette& palette = stylist()->palette();
513  KColorScheme colorScheme( palette.currentColorGroup(), KColorScheme::View );
514 
515  // paint all the bytes affected
516  for( LinePosition linePosition=linePositions.start(); linePosition<=linePositions.end(); ++linePosition,++byteIndex )
517  {
518  const PixelX x = columnXOfLinePosition( linePosition );
519 
520  // draw the byte
521  painter->translate( x, 0 );
522 
523  if( byteIndex == nextBookmarkOffset )
524  {
525  renderBookmark( painter, colorScheme.background(KColorScheme::NeutralBackground) );
526 
527  nextBookmarkOffset = bit.hasNext() ? bit.next().offset() : -1;//TODO )&& ( bit->offset() <= LastIndex );
528  }
529 
530  const Byte byte = mByteArrayModel->byte( byteIndex );
531  const Character byteChar = mCharCodec->decode( byte );
532 
533  const KColorScheme::ForegroundRole foregroundRole =
534  mByteTypeColored ? foregroundRoleForChar(byteChar): KColorScheme::NormalText;
535  const QBrush brush = colorScheme.foreground( foregroundRole );
536  const QColor& charColor = brush.color();// palette.text().color();//colorForChar(byteChar)
537  renderByteText( painter, byte, byteChar, charColor );
538 
539  painter->translate( -x, 0 );
540  }
541 }
542 
543 
544 void AbstractByteArrayColumnRenderer::renderSelection( QPainter* painter, const LinePositionRange& linePositions, Address byteIndex, int flag )
545 {
546  BookmarksConstIterator bit;
547  Address nextBookmarkOffset = -1;
548 
549  const bool hasBookmarks = ( mBookmarks != 0 );
550  if( hasBookmarks )
551  {
552  bit = mBookmarks->createBookmarksConstIterator();
553  if( bit.findNextFrom( byteIndex) )
554  nextBookmarkOffset = bit.next().offset();
555  }
556 
557  const QPalette& palette = stylist()->palette();
558  KColorScheme colorScheme( palette.currentColorGroup(), KColorScheme::Selection );
559 
560  renderRange( painter, colorScheme.background(), linePositions, flag );
561 
562  // paint all the bytes affected
563  for( LinePosition linePosition=linePositions.start(); linePosition<=linePositions.end(); ++linePosition,++byteIndex )
564  {
565  const PixelX x = columnXOfLinePosition( linePosition );
566 
567  // draw the byte
568  painter->translate( x, 0 );
569 
570  if( byteIndex == nextBookmarkOffset )
571  {
572  renderBookmark( painter, colorScheme.background(KColorScheme::NeutralBackground) );
573 
574  nextBookmarkOffset = bit.hasNext() ? bit.next().offset() : -1;//TODO )&& ( bit->offset() <= LastIndex );
575  }
576 
577  const Byte byte = mByteArrayModel->byte( byteIndex );
578  const Character byteChar = mCharCodec->decode( byte );
579 
580  const KColorScheme::ForegroundRole foregroundRole =
581  mByteTypeColored ? foregroundRoleForChar(byteChar): KColorScheme::NormalText;
582  const QBrush brush = colorScheme.foreground( foregroundRole );
583  const QColor& charColor = brush.color();
584  renderByteText( painter, byte, byteChar, charColor );
585 
586  painter->translate( -x, 0 );
587  }
588 }
589 
590 void AbstractByteArrayColumnRenderer::renderSelectionSpaceBehind( QPainter* painter, LinePosition linePosition )
591 {
592  const QPalette& palette = stylist()->palette();
593  KColorScheme colorScheme( palette.currentColorGroup(), KColorScheme::Selection );
594 
595  renderSpaceBehind( painter, colorScheme.background(), linePosition );
596 }
597 
598 
599 void AbstractByteArrayColumnRenderer::renderMarking( QPainter* painter, const LinePositionRange& linePositions, Address byteIndex, int flag )
600 {
601  const QPalette& palette = stylist()->palette();
602 
603  renderRange( painter, palette.text(), linePositions, flag );
604 
605  const QColor& baseColor = palette.base().color();
606  // paint all the bytes affected
607  for( LinePosition p=linePositions.start(); p<=linePositions.end(); ++p,++byteIndex )
608  {
609  const PixelX x = columnXOfLinePosition( p );
610 
611  // draw the byte
612  painter->translate( x, 0 );
613  const Byte byte = mByteArrayModel->byte( byteIndex );
614  const Character byteChar = mCharCodec->decode( byte );
615  renderByteText( painter, byte, byteChar, baseColor );
616 
617  painter->translate( -x, 0 );
618  }
619 }
620 
621 
622 void AbstractByteArrayColumnRenderer::renderBookmark( QPainter* painter, const QBrush& brush )
623 {
624  // TODO: think about how bookmarks should really be rendered
625  painter->fillRect( 1,1, mByteWidth-2,lineHeight()-2, brush );
626 }
627 
628 
629 void AbstractByteArrayColumnRenderer::renderRange( QPainter* painter, const QBrush& brush, const LinePositionRange& linePositions, int flag )
630 {
631  const PixelX rangeX =
632  ( flag & StartsBefore ) ? columnRightXOfLinePosition( linePositions.nextBeforeStart() ) + 1 :
633  columnXOfLinePosition( linePositions.start() );
634  const PixelX rangeW =
635  ( (flag & EndsLater) ? columnXOfLinePosition( linePositions.nextBehindEnd() ) :
636  columnRightXOfLinePosition( linePositions.end() ) + 1 )
637  - rangeX;
638 
639  painter->fillRect( rangeX,0, rangeW,lineHeight(), brush );
640 }
641 
642 void AbstractByteArrayColumnRenderer::renderSpaceBehind( QPainter* painter, const QBrush& brush, LinePosition linePosition )
643 {
644  const PixelX rangeX = columnRightXOfLinePosition( linePosition ) + 1;
645  const PixelX rangeW = columnXOfLinePosition( linePosition+1 ) - rangeX;
646 
647  painter->fillRect( rangeX,0, rangeW,lineHeight(), brush );
648 }
649 
650 
651 void AbstractByteArrayColumnRenderer::renderByte( QPainter* painter, Address byteIndex )
652 {
653  const Byte byte = ( byteIndex > -1 ) ? mByteArrayModel->byte( byteIndex ) : EmptyByte;
654  const Character byteChar = mCharCodec->decode( byte );
655 
656  const QPalette& palette = stylist()->palette();
657 
658  KColorScheme::ColorSet colorSet = KColorScheme::View;
659  if( byteIndex > -1 )
660  {
661  if( mRanges->selectionIncludes(byteIndex) )
662  colorSet = KColorScheme::Selection;
663 // else if( mRanges->markingIncludes(byteIndex) )
664 // {
665 // charColor = palette.base().color();
666 // brush = palette.text();
667 // }
668  }
669  KColorScheme colorScheme( palette.currentColorGroup(), colorSet );
670 
671  const QBrush backgroundBrush = colorScheme.background();
672  painter->fillRect( 0,0, mByteWidth,lineHeight(), backgroundBrush );
673 
674  if( mBookmarks && mBookmarks->containsBookmarkFor(byteIndex) )
675  renderBookmark( painter, colorScheme.background(KColorScheme::NeutralBackground) );
676 
677  if( byteIndex > -1 )
678  {
679  const KColorScheme::ForegroundRole foregroundRole =
680  mByteTypeColored ? foregroundRoleForChar(byteChar): KColorScheme::NormalText;
681  const QBrush brush = colorScheme.foreground( foregroundRole );
682  const QColor& charColor = brush.color();
683 
684  renderByteText( painter, byte, byteChar, charColor );
685  }
686 }
687 
688 // TODO: think about making framestyle a enum of a class ByteArrayColumnCursor
689 void AbstractByteArrayColumnRenderer::renderFramedByte( QPainter* painter, Address byteIndex, FrameStyle frameStyle )
690 {
691  renderByte( painter, byteIndex );
692 
693  const Byte byte = ( byteIndex > -1 ) ? mByteArrayModel->byte( byteIndex ) : EmptyByte;
694  const Character byteChar = mCharCodec->decode( byte );
695 
696  const bool isInSelection = ( byteIndex > -1 && mRanges->selectionIncludes(byteIndex) );
697  const KColorScheme::ColorSet colorSet = isInSelection ? KColorScheme::Selection : KColorScheme::View;
698 
699  const QPalette& palette = stylist()->palette();
700  KColorScheme colorScheme( palette.currentColorGroup(), colorSet );
701  const KColorScheme::ForegroundRole foregroundRole =
702  mByteTypeColored ? foregroundRoleForChar(byteChar): KColorScheme::NormalText;
703  const QBrush brush = colorScheme.foreground( foregroundRole );
704  const QColor& charColor = brush.color();
705  painter->setPen( charColor );
706  if( frameStyle == Frame )
707  painter->drawRect( 0,0, mByteWidth-1,lineHeight()-1 );
708  else if( frameStyle == Left )
709  painter->drawLine( 0,0, 0,lineHeight()-1 );
710  else
711  painter->drawLine( mByteWidth-1,0, mByteWidth-1,lineHeight()-1 );
712 }
713 
714 
715 void AbstractByteArrayColumnRenderer::renderCursor( QPainter* painter, Address byteIndex )
716 {
717  const Byte byte = ( byteIndex > -1 ) ? mByteArrayModel->byte( byteIndex ) : EmptyByte;
718  const Character byteChar = mCharCodec->decode( byte );
719 
720  const bool isInSelection = ( byteIndex > -1 && mRanges->selectionIncludes(byteIndex) );
721  const KColorScheme::ColorSet colorSet = isInSelection ? KColorScheme::Selection : KColorScheme::View;
722 
723  const QPalette& palette = stylist()->palette();
724  KColorScheme colorScheme( palette.currentColorGroup(), colorSet );
725  const KColorScheme::ForegroundRole foregroundRole =
726  mByteTypeColored ? foregroundRoleForChar(byteChar): KColorScheme::NormalText;
727  const QBrush brush = colorScheme.foreground( foregroundRole );
728  painter->fillRect( 0,0, mByteWidth,lineHeight(), brush );
729 }
730 
731 
732 bool AbstractByteArrayColumnRenderer::getNextSelectedAddressRange( AddressRange* _selection, unsigned int* _flag,
733  const AddressRange& range ) const
734 {
735  const AddressRange* overlappingSelectedSection = mRanges->firstOverlappingSelection( range );
736  if( !overlappingSelectedSection )
737  return false;
738 
739  AddressRange selectedRange = *overlappingSelectedSection;
740  unsigned int flag = 0;
741 
742  // does selectedRange start before asked range?
743  if( selectedRange.startsBefore(range) )
744  {
745  selectedRange.setStart( range.start() );
746  flag |= StartsBefore;
747  }
748 
749  // does selectedRange go on behind asked range?
750  if( selectedRange.endsBehind(range) )
751  {
752  selectedRange.setEnd( range.end() );
753  flag |= EndsLater;
754  }
755 
756  *_selection = selectedRange;
757  *_flag = flag;
758  return true;
759 }
760 
761 
762 bool AbstractByteArrayColumnRenderer::getNextMarkedAddressRange( AddressRange* _markedSection, unsigned int* _flag,
763  const AddressRange& range ) const
764 {
765  const AddressRange* overlappingMarkedSection = mRanges->overlappingMarking( range );
766  if( !overlappingMarkedSection )
767  return false;
768 
769  unsigned int flag = 0;
770  AddressRange markedRange = *overlappingMarkedSection;
771 
772  if( markedRange.startsBefore(range) )
773  {
774  markedRange.setStart( range.start() );
775  flag |= StartsBefore;
776  }
777 
778  if( markedRange.endsBehind(range) )
779  {
780  markedRange.setEnd( range.end() );
781  flag |= EndsLater;
782  }
783 
784  *_markedSection = markedRange;
785  *_flag = flag;
786  return true;
787 }
788 
789 
790 AbstractByteArrayColumnRenderer::~AbstractByteArrayColumnRenderer()
791 {
792  delete [] mLinePosLeftPixelX;
793  delete [] mLinePosRightPixelX;
794 }
795 
796 }
Okteta::AbstractByteArrayColumnRenderer::AbstractByteArrayColumnRenderer
AbstractByteArrayColumnRenderer(AbstractColumnStylist *stylist, AbstractByteArrayModel *byteArrayModel, ByteArrayTableLayout *layout, ByteArrayTableRanges *ranges)
Definition: abstractbytearraycolumnrenderer.cpp:48
Okteta::AbstractByteArrayColumnRenderer::renderByte
void renderByte(QPainter *painter, Address byteIndex)
paints the byte with background.
Definition: abstractbytearraycolumnrenderer.cpp:651
Okteta::AbstractByteArrayColumnRenderer::renderBookmark
void renderBookmark(QPainter *painter, const QBrush &brush)
Definition: abstractbytearraycolumnrenderer.cpp:622
Okteta::AbstractByteArrayColumnRenderer::mByteTypeColored
bool mByteTypeColored
Definition: abstractbytearraycolumnrenderer.h:237
Okteta::AbstractByteArrayColumnRenderer::mLinePosLeftPixelX
PixelX * mLinePosLeftPixelX
pointer to array with buffered linePositions (relative to column position) a spacing gets assigned to...
Definition: abstractbytearraycolumnrenderer.h:231
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::AbstractByteArrayColumnRenderer::recalcByteWidth
virtual void recalcByteWidth()
default implementation sets byte width to one digit width
Definition: abstractbytearraycolumnrenderer.cpp:170
Okteta::AbstractColumnRenderer::restrictToXSpan
void restrictToXSpan(PixelXRange *xSpan) const
Definition: abstractcolumnrenderer.cpp:54
Okteta::AbstractByteArrayColumnRenderer::renderFramedByte
void renderFramedByte(QPainter *painter, Address byteIndex, FrameStyle style)
paints the byte with background and a frame around.
Definition: abstractbytearraycolumnrenderer.cpp:689
Okteta::LinePositionRange
KDE::NumberRange< LinePosition, LinePositionSize > LinePositionRange
Definition: linepositionrange.h:34
bookmark.h
Okteta::ByteArrayTableRanges::overlappingMarking
const AddressRange * overlappingMarking(const AddressRange &range) const
Definition: bytearraytableranges.cpp:203
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
abstractcolumnstylist.h
Okteta::AbstractByteArrayColumnRenderer::linePositionOfColumnX
LinePosition linePositionOfColumnX(PixelX x) const
returns byte pos at pixel with relative x-coord x
Definition: abstractbytearraycolumnrenderer.cpp:282
KDE::Range::moveBy
void moveBy(T D)
moves the range by D.
Definition: range.h:82
Okteta::Bookmark::offset
Address offset() const
Definition: bookmark.h:66
Okteta::AbstractByteArrayColumnRenderer::prepareRendering
void prepareRendering(const PixelXRange &Xs)
Definition: abstractbytearraycolumnrenderer.cpp:368
Okteta::AbstractByteArrayColumnRenderer::mDigitWidth
PixelX mDigitWidth
Definition: abstractbytearraycolumnrenderer.h:209
Okteta::AbstractByteArrayColumnRenderer::renderPlain
void renderPlain(QPainter *painter, const LinePositionRange &linePositions, Address byteIndex)
Definition: abstractbytearraycolumnrenderer.cpp:499
Okteta::DefaultByteSpacingWidth
static const PixelX DefaultByteSpacingWidth
Definition: oktetagui.h:46
KDE::NumberRange::nextBehindEnd
N nextBehindEnd() const
Definition: numberrange.h:145
Okteta::AbstractByteArrayColumnRenderer::renderRange
void renderRange(QPainter *painter, const QBrush &brush, const LinePositionRange &linePositions, int flag)
Definition: abstractbytearraycolumnrenderer.cpp:629
KDE::NumberRange< LinePosition, LinePositionSize >
oktetagui.h
KDE::Range::start
T start() const
Definition: range.h:86
KDE::Range::setEnd
void setEnd(T E)
sets the last index of the range
Definition: range.h:60
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
Okteta::AbstractByteArrayColumnRenderer::mCharCodec
const CharCodec * mCharCodec
Definition: abstractbytearraycolumnrenderer.h:206
Okteta::Byte
unsigned char Byte
Definition: byte.h:29
Okteta::AbstractByteArrayColumnRenderer::xOfLinePosition
PixelX xOfLinePosition(LinePosition posInLine) const
returns absolute x-coord of byte at position posInLine
Definition: abstractbytearraycolumnrenderer.cpp:271
Okteta::AbstractByteArrayColumnRenderer::renderSelection
void renderSelection(QPainter *painter, const LinePositionRange &linePositions, Address byteIndex, int flag)
Definition: abstractbytearraycolumnrenderer.cpp:544
Okteta::CharCodec::decode
virtual Character decode(Byte byte) const =0
Okteta::AbstractByteArrayColumnRenderer::groupSpacingWidth
PixelX groupSpacingWidth() const
Definition: abstractbytearraycolumnrenderer.h:252
Okteta::ByteArrayTableRanges::selectionIncludes
bool selectionIncludes(Address index) const
Definition: bytearraytableranges.h:141
Okteta::ByteArrayTableLayout::linePositions
LinePositionRange linePositions(Line line) const
returns the used positions in line
Definition: bytearraytablelayout.cpp:267
Okteta::AbstractByteArrayColumnRenderer::renderByteText
virtual void renderByteText(QPainter *painter, Byte byte, Character charByte, const QColor &color) const =0
KDE::Range::restrictTo
void restrictTo(const Range &Limit)
restricts the range to Limit.
Definition: range.h:64
Okteta::Coord
a class which represents a coord in a 2-dim.
Definition: coord.h:47
Okteta::AbstractByteArrayColumnRenderer::Frame
Definition: abstractbytearraycolumnrenderer.h:63
Okteta::ByteArrayTableRanges::firstOverlappingSelection
const AddressRange * firstOverlappingSelection(const AddressRange &range) const
Definition: bytearraytableranges.cpp:197
Okteta::DefaultGroupSpacingWidth
static const PixelX DefaultGroupSpacingWidth
Definition: oktetagui.h:47
Okteta::AbstractByteArrayColumnRenderer::mLastLinePos
LinePosition mLastLinePos
index of right position
Definition: abstractbytearraycolumnrenderer.h:234
Okteta::Bookmarkable
Definition: bookmarkable.h:39
Okteta::Line
qint32 Line
Definition: line.h:33
Okteta::AbstractByteArrayColumnRenderer::linePositionsOfColumnXs
LinePositionRange linePositionsOfColumnXs(PixelX x, PixelX width) const
returns byte linePositions covered by pixels with relative x-coord x
Definition: abstractbytearraycolumnrenderer.cpp:296
Okteta::Bookmarkable::createBookmarksConstIterator
virtual Okteta::BookmarksConstIterator createBookmarksConstIterator() const =0
Okteta::AbstractByteArrayColumnRenderer::mFontMetrics
QFontMetrics mFontMetrics
Definition: abstractbytearraycolumnrenderer.h:213
KDE::NumberRange::width
S width() const
Definition: numberrange.h:141
Okteta::AbstractColumnStylist
Definition: abstractcolumnstylist.h:38
Okteta::BookmarksConstIterator
Definition: bookmarksconstiterator.h:36
bytearraytablelayout.h
Okteta::ByteArrayTableLayout
the logical layout of a byte array table for a view
Definition: bytearraytablelayout.h:61
Okteta::AbstractByteArrayColumnRenderer::mSpacingTrigger
int mSpacingTrigger
Definition: abstractbytearraycolumnrenderer.h:245
Okteta::PixelX
int PixelX
Definition: kadds.h:34
Okteta::AbstractByteArrayColumnRenderer::mBookmarks
Bookmarkable * mBookmarks
Definition: abstractbytearraycolumnrenderer.h:204
Okteta::AbstractByteArrayColumnRenderer::setByteWidth
void setByteWidth(int byteWidth)
Definition: abstractbytearraycolumnrenderer.h:273
Okteta::ByteArrayTableLayout::hasContent
bool hasContent(Line line) const
returns true if the line has content
Definition: bytearraytablelayout.cpp:293
Okteta::AbstractByteArrayColumnRenderer::mRenderLinePositions
LinePositionRange mRenderLinePositions
Definition: abstractbytearraycolumnrenderer.h:241
Okteta::AbstractByteArrayColumnRenderer::rightXOfLinePosition
PixelX rightXOfLinePosition(LinePosition posInLine) const
returns right absolute x-coord of byte at position posInLine
Definition: abstractbytearraycolumnrenderer.cpp:276
Okteta::AbstractByteArrayColumnRenderer::mRenderWidth
PixelX mRenderWidth
Definition: abstractbytearraycolumnrenderer.h:244
Okteta::ByteArrayTableRanges::hasSelection
bool hasSelection() const
Definition: bytearraytableranges.h:136
Okteta::AbstractByteArrayColumnRenderer::xsOfLinePositionsInclSpaces
PixelXRange xsOfLinePositionsInclSpaces(const LinePositionRange &linePositions) const
returns the
Definition: abstractbytearraycolumnrenderer.cpp:334
KDE::Range::restrictEndTo
void restrictEndTo(T Limit)
restricts the end to Limit.
Definition: range.h:69
Okteta::AbstractByteArrayColumnRenderer::mByteSpacingWidth
PixelX mByteSpacingWidth
width of inserting cursor in pixel
Definition: abstractbytearraycolumnrenderer.h:221
Okteta::AbstractByteArrayColumnRenderer::magneticLinePositionOfX
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: abstractbytearraycolumnrenderer.cpp:222
Okteta::AbstractByteArrayColumnRenderer::recalcX
void recalcX()
Definition: abstractbytearraycolumnrenderer.cpp:176
bookmarksconstiterator.h
abstractbytearraycolumnrenderer.h
KDE::Range::end
T end() const
Definition: range.h:88
KDE::NumberRange< Address, Size >::fromWidth
static NumberRange fromWidth(AddressstartIndex, Sizewidth)
constructs a range by width
Okteta::AbstractByteArrayColumnRenderer::mRenderX
PixelX mRenderX
Definition: abstractbytearraycolumnrenderer.h:243
Okteta::AbstractByteArrayColumnRenderer::columnXsOfLinePositionsInclSpaces
PixelXRange columnXsOfLinePositionsInclSpaces(const LinePositionRange &linePositions) const
Definition: abstractbytearraycolumnrenderer.cpp:344
Okteta::AbstractByteArrayColumnRenderer::renderCursor
void renderCursor(QPainter *painter, Address byteIndex)
paints a cursor based on the type of the byte.
Definition: abstractbytearraycolumnrenderer.cpp:715
KDE::Range::endsBehind
bool endsBehind(T Value) const
returns true if the range ends later than index.
Definition: range.h:101
Okteta::AbstractByteArrayColumnRenderer::mByteArrayModel
AbstractByteArrayModel * mByteArrayModel
pointer to the buffer
Definition: abstractbytearraycolumnrenderer.h:198
Okteta::Coord::pos
LinePosition pos() const
Definition: coord.h:213
Okteta::AbstractColumnRenderer::setWidth
void setWidth(PixelX width)
sets width of the column
Definition: abstractcolumnrenderer.cpp:50
Okteta::AbstractByteArrayColumnRenderer::renderNextLine
virtual void renderNextLine(QPainter *painter)
the actual painting call for a column's line.
Definition: abstractbytearraycolumnrenderer.cpp:394
Okteta::AbstractByteArrayColumnRenderer::setNoOfGroupedBytes
bool setNoOfGroupedBytes(int noOfGroupedBytes)
sets the number of grouped bytes in the hex column
Definition: abstractbytearraycolumnrenderer.cpp:140
Okteta::AbstractByteArrayColumnRenderer::mByteWidth
PixelX mByteWidth
total width of byte display in pixel
Definition: abstractbytearraycolumnrenderer.h:217
Okteta::AbstractByteArrayModel::byte
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...
Okteta::AbstractByteArrayColumnRenderer::setGroupSpacingWidth
bool setGroupSpacingWidth(PixelX groupSpacingWidth)
sets the spacing between the groups of bytes in the hex column
Definition: abstractbytearraycolumnrenderer.cpp:154
KDE::NumberRange::setEndByWidth
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
KDE::NumberRange::setStartNextBehind
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
Okteta::EmptyByte
static const Byte EmptyByte
Definition: oktetagui.h:43
Okteta::AbstractByteArrayColumnRenderer::setSpacing
bool setSpacing(PixelX byteSpacingWidth, int noOfGroupedBytes=0, PixelX groupSpacingWidth=0)
sets the spacing in the hex column
Definition: abstractbytearraycolumnrenderer.cpp:106
Okteta::AbstractByteArrayColumnRenderer::linePositionsOfX
LinePositionRange linePositionsOfX(PixelX x, PixelX width) const
returns byte linePositions covered by pixels with absolute x-coord x
Definition: abstractbytearraycolumnrenderer.cpp:243
Okteta::AbstractByteArrayColumnRenderer::mLinePosRightPixelX
PixelX * mLinePosRightPixelX
Definition: abstractbytearraycolumnrenderer.h:232
Okteta::BookmarksConstIterator::next
const Okteta::Bookmark & next()
Definition: bookmarksconstiterator.h:78
Okteta::AbstractByteArrayColumnRenderer::byteRect
QRect byteRect(const Coord &coord) const
Definition: abstractbytearraycolumnrenderer.cpp:354
Okteta::ByteArrayTableRanges::hasMarking
bool hasMarking() const
Definition: bytearraytableranges.h:140
Okteta::AbstractByteArrayColumnRenderer::getNextSelectedAddressRange
bool getNextSelectedAddressRange(AddressRange *selectedRange, unsigned int *flag, const AddressRange &range) const
Definition: abstractbytearraycolumnrenderer.cpp:732
KDE::Range::includes
bool includes(T Value) const
returns true if Value is covered
Definition: range.h:93
Okteta::AbstractByteArrayColumnRenderer::set
void set(AbstractByteArrayModel *byteArrayModel)
Definition: abstractbytearraycolumnrenderer.cpp:70
charcodec.h
Okteta::LinePosition
qint32 LinePosition
Definition: lineposition.h:33
Okteta::AbstractByteArrayColumnRenderer::Left
Definition: abstractbytearraycolumnrenderer.h:63
Okteta::AbstractByteArrayColumnRenderer::linePositionOfX
LinePosition linePositionOfX(PixelX x) const
returns byte pos at pixel with absolute x-coord x
Definition: abstractbytearraycolumnrenderer.cpp:206
Okteta::AbstractByteArrayColumnRenderer::~AbstractByteArrayColumnRenderer
virtual ~AbstractByteArrayColumnRenderer()
Definition: abstractbytearraycolumnrenderer.cpp:790
Okteta::BookmarksConstIterator::hasNext
bool hasNext() const
Definition: bookmarksconstiterator.h:69
Okteta::AbstractByteArrayColumnRenderer::mNoOfGroupedBytes
int mNoOfGroupedBytes
number of grouped bytes
Definition: abstractbytearraycolumnrenderer.h:226
foregroundRoleForChar
static KColorScheme::ForegroundRole foregroundRoleForChar(const Okteta::Character byteChar)
Definition: helper.h:46
Okteta::AbstractColumnRenderer::stylist
AbstractColumnStylist * stylist() const
Definition: abstractcolumnrenderer.cpp:40
Okteta::ByteArrayTableLayout::indexAtCoord
Address indexAtCoord(const Coord &coord) const
calculates the index of coord.
Definition: bytearraytablelayout.cpp:213
Okteta::AbstractByteArrayColumnRenderer::renderSelectionSpaceBehind
void renderSelectionSpaceBehind(QPainter *painter, LinePosition linePosition)
Definition: abstractbytearraycolumnrenderer.cpp:590
Okteta::StartsBefore
static const unsigned int StartsBefore
Definition: oktetagui.h:41
Okteta::Coord::line
Line line() const
Definition: coord.h:214
bytearraytableranges.h
Okteta::AbstractColumnRenderer::rightX
PixelX rightX() const
right offset x in pixel
Definition: abstractcolumnrenderer.cpp:43
Okteta::AbstractByteArrayColumnRenderer::mRanges
ByteArrayTableRanges * mRanges
pointer to the ranges
Definition: abstractbytearraycolumnrenderer.h:202
Okteta::AbstractByteArrayColumnRenderer::renderFirstLine
virtual void renderFirstLine(QPainter *painter, const PixelXRange &Xs, Line firstLineIndex)
Definition: abstractbytearraycolumnrenderer.cpp:384
KDE::Range::startsBefore
bool startsBefore(T Value) const
returns true is the range starts before index.
Definition: range.h:99
Okteta::AbstractColumnRenderer::x
PixelX x() const
left offset x in pixel
Definition: abstractcolumnrenderer.cpp:42
KDE::Range::endsBefore
bool endsBefore(T Value) const
returns true if range is before index.
Definition: range.h:103
Okteta::Size
qint32 Size
Definition: size.h:33
Okteta::AbstractColumnRenderer::lineHeight
PixelY lineHeight() const
Definition: abstractcolumnrenderer.cpp:47
Okteta::AbstractColumnRenderer
base class for columns of the ColumnsView
Definition: abstractcolumnrenderer.h:46
Okteta::AbstractByteArrayColumnRenderer::getNextMarkedAddressRange
bool getNextMarkedAddressRange(AddressRange *markedRange, unsigned int *flag, const AddressRange &range) const
Definition: abstractbytearraycolumnrenderer.cpp:762
Okteta::AbstractColumnStylist::palette
virtual const QPalette & palette() const =0
Okteta::AbstractByteArrayColumnRenderer::mRenderLine
Line mRenderLine
Definition: abstractbytearraycolumnrenderer.h:242
Okteta::BookmarksConstIterator::findNextFrom
bool findNextFrom(unsigned int offset)
Definition: bookmarksconstiterator.h:76
Okteta::DefaultNoOfGroupedBytes
static const int DefaultNoOfGroupedBytes
Definition: oktetagui.h:49
Okteta::AbstractByteArrayColumnRenderer::mGroupSpacingWidth
PixelX mGroupSpacingWidth
width of spacing in pixel
Definition: abstractbytearraycolumnrenderer.h:223
KDE::Range::setStart
void setStart(T S)
sets the first index of the range
Definition: range.h:58
Okteta::AbstractByteArrayColumnRenderer::renderLinePositions
void renderLinePositions(QPainter *painter, Line lineIndex, const LineRange &linePositions)
Definition: abstractbytearraycolumnrenderer.cpp:400
bytearraytablecursor.h
Okteta::AbstractByteArrayColumnRenderer::renderMarking
void renderMarking(QPainter *painter, const LinePositionRange &linePositions, Address byteIndex, int flag)
Definition: abstractbytearraycolumnrenderer.cpp:599
KDE::Range::isValid
bool isValid() const
returns true if the range covers at least one index
Definition: range.h:122
Okteta::AbstractByteArrayColumnRenderer::setFontMetrics
void setFontMetrics(const QFontMetrics &fontMetrics)
sets the metrics of the used font
Definition: abstractbytearraycolumnrenderer.cpp:91
Okteta::AbstractByteArrayColumnRenderer::noOfGroupedBytes
int noOfGroupedBytes() const
Definition: abstractbytearraycolumnrenderer.h:254
Okteta::Bookmarkable::containsBookmarkFor
virtual bool containsBookmarkFor(int offset) const =0
Okteta::Character
Definition: character.h:35
Okteta::AbstractByteArrayColumnRenderer::setByteSpacingWidth
bool setByteSpacingWidth(PixelX byteSpacingWidth)
sets the spacing between the bytes in the hex column
Definition: abstractbytearraycolumnrenderer.cpp:124
Okteta::AbstractByteArrayColumnRenderer::renderSpaceBehind
void renderSpaceBehind(QPainter *painter, const QBrush &brush, LinePosition linePosition)
Definition: abstractbytearraycolumnrenderer.cpp:642
Okteta::PixelXRange
KDE::NumberRange< PixelX > PixelXRange
Definition: kadds.h:37
Okteta::AbstractByteArrayColumnRenderer::mLayout
const ByteArrayTableLayout * mLayout
pointer to the layout
Definition: abstractbytearraycolumnrenderer.h:200
Okteta::AbstractByteArrayColumnRenderer::columnRightXOfLinePosition
PixelX columnRightXOfLinePosition(LinePosition posInLine) const
returns right relative x-coord of byte at position posInLine
Definition: abstractbytearraycolumnrenderer.cpp:328
Okteta::AbstractByteArrayColumnRenderer::byteSpacingWidth
PixelX byteSpacingWidth() const
Definition: abstractbytearraycolumnrenderer.h:251
bookmarkable.h
Okteta::AbstractByteArrayColumnRenderer::columnXOfLinePosition
PixelX columnXOfLinePosition(LinePosition posInLine) const
returns relative x-coord of byte at position posInLine
Definition: abstractbytearraycolumnrenderer.cpp:323
KDE::NumberRange::nextBeforeStart
N nextBeforeStart() const
Definition: numberrange.h:143
Okteta::EndsLater
static const unsigned int EndsLater
Definition: oktetagui.h:42
Okteta::AbstractByteArrayColumnRenderer::mDigitBaseLine
PixelY mDigitBaseLine
Definition: abstractbytearraycolumnrenderer.h:211
helper.h
Okteta::AbstractByteArrayColumnRenderer::FrameStyle
FrameStyle
Definition: abstractbytearraycolumnrenderer.h:63
Okteta::NoByteFound
static const LinePosition NoByteFound
Definition: oktetagui.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:06 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