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

Konsole

  • sources
  • kde-4.12
  • applications
  • konsole
  • src
History.cpp
Go to the documentation of this file.
1 /*
2  This file is part of Konsole, an X terminal.
3  Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  02110-1301 USA.
19 */
20 
21 // Own
22 #include "History.h"
23 
24 // System
25 #include <stdlib.h>
26 #include <stdio.h>
27 #include <sys/types.h>
28 #include <sys/mman.h>
29 #include <unistd.h>
30 #include <errno.h>
31 
32 // KDE
33 #include <kde_file.h>
34 #include <KDebug>
35 #include <KStandardDirs>
36 
37 // Reasonable line size
38 static const int LINE_SIZE = 1024;
39 
40 using namespace Konsole;
41 
42 /*
43  An arbitrary long scroll.
44 
45  One can modify the scroll only by adding either cells
46  or newlines, but access it randomly.
47 
48  The model is that of an arbitrary wide typewriter scroll
49  in that the scroll is a series of lines and each line is
50  a series of cells with no overwriting permitted.
51 
52  The implementation provides arbitrary length and numbers
53  of cells and line/column indexed read access to the scroll
54  at constant costs.
55 */
56 
57 // History File ///////////////////////////////////////////
58 HistoryFile::HistoryFile()
59  : _fd(-1),
60  _length(0),
61  _fileMap(0),
62  _readWriteBalance(0)
63 {
64  const QString tmpFormat = KStandardDirs::locateLocal("tmp", QString())
65  + "konsole-XXXXXX.history";
66  _tmpFile.setFileTemplate(tmpFormat);
67  if (_tmpFile.open()) {
68  _tmpFile.setAutoRemove(true);
69  _fd = _tmpFile.handle();
70  }
71 }
72 
73 HistoryFile::~HistoryFile()
74 {
75  if (_fileMap)
76  unmap();
77 }
78 
79 //TODO: Mapping the entire file in will cause problems if the history file becomes exceedingly large,
80 //(ie. larger than available memory). HistoryFile::map() should only map in sections of the file at a time,
81 //to avoid this.
82 void HistoryFile::map()
83 {
84  Q_ASSERT(_fileMap == 0);
85 
86  _fileMap = (char*)mmap(0 , _length , PROT_READ , MAP_PRIVATE , _fd , 0);
87 
88  //if mmap'ing fails, fall back to the read-lseek combination
89  if (_fileMap == MAP_FAILED) {
90  _readWriteBalance = 0;
91  _fileMap = 0;
92  kWarning() << "mmap'ing history failed. errno = " << errno;
93  }
94 }
95 
96 void HistoryFile::unmap()
97 {
98  int result = munmap(_fileMap , _length);
99  Q_ASSERT(result == 0);
100  Q_UNUSED(result);
101 
102  _fileMap = 0;
103 }
104 
105 bool HistoryFile::isMapped() const
106 {
107  return (_fileMap != 0);
108 }
109 
110 void HistoryFile::add(const unsigned char* buffer, int count)
111 {
112  if (_fileMap)
113  unmap();
114 
115  _readWriteBalance++;
116 
117  int rc = 0;
118 
119  rc = KDE_lseek(_fd, _length, SEEK_SET);
120  if (rc < 0) {
121  perror("HistoryFile::add.seek");
122  return;
123  }
124  rc = write(_fd, buffer, count);
125  if (rc < 0) {
126  perror("HistoryFile::add.write");
127  return;
128  }
129  _length += rc;
130 }
131 
132 void HistoryFile::get(unsigned char* buffer, int size, int loc)
133 {
134  //count number of get() calls vs. number of add() calls.
135  //If there are many more get() calls compared with add()
136  //calls (decided by using MAP_THRESHOLD) then mmap the log
137  //file to improve performance.
138  _readWriteBalance--;
139  if (!_fileMap && _readWriteBalance < MAP_THRESHOLD)
140  map();
141 
142  if (_fileMap) {
143  for (int i = 0; i < size; i++)
144  buffer[i] = _fileMap[loc + i];
145  } else {
146  int rc = 0;
147 
148  if (loc < 0 || size < 0 || loc + size > _length)
149  fprintf(stderr, "getHist(...,%d,%d): invalid args.\n", size, loc);
150  rc = KDE_lseek(_fd, loc, SEEK_SET);
151  if (rc < 0) {
152  perror("HistoryFile::get.seek");
153  return;
154  }
155  rc = read(_fd, buffer, size);
156  if (rc < 0) {
157  perror("HistoryFile::get.read");
158  return;
159  }
160  }
161 }
162 
163 int HistoryFile::len() const
164 {
165  return _length;
166 }
167 
168 // History Scroll abstract base class //////////////////////////////////////
169 
170 HistoryScroll::HistoryScroll(HistoryType* t)
171  : _historyType(t)
172 {
173 }
174 
175 HistoryScroll::~HistoryScroll()
176 {
177  delete _historyType;
178 }
179 
180 bool HistoryScroll::hasScroll()
181 {
182  return true;
183 }
184 
185 // History Scroll File //////////////////////////////////////
186 
187 /*
188  The history scroll makes a Row(Row(Cell)) from
189  two history buffers. The index buffer contains
190  start of line positions which refer to the cells
191  buffer.
192 
193  Note that index[0] addresses the second line
194  (line #1), while the first line (line #0) starts
195  at 0 in cells.
196 */
197 
198 HistoryScrollFile::HistoryScrollFile(const QString& logFileName)
199  : HistoryScroll(new HistoryTypeFile(logFileName))
200 {
201 }
202 
203 HistoryScrollFile::~HistoryScrollFile()
204 {
205 }
206 
207 int HistoryScrollFile::getLines()
208 {
209  return _index.len() / sizeof(int);
210 }
211 
212 int HistoryScrollFile::getLineLen(int lineno)
213 {
214  return (startOfLine(lineno + 1) - startOfLine(lineno)) / sizeof(Character);
215 }
216 
217 bool HistoryScrollFile::isWrappedLine(int lineno)
218 {
219  if (lineno >= 0 && lineno <= getLines()) {
220  unsigned char flag;
221  _lineflags.get((unsigned char*)&flag, sizeof(unsigned char), (lineno)*sizeof(unsigned char));
222  return flag;
223  }
224  return false;
225 }
226 
227 int HistoryScrollFile::startOfLine(int lineno)
228 {
229  if (lineno <= 0) return 0;
230  if (lineno <= getLines()) {
231  if (!_index.isMapped())
232  _index.map();
233 
234  int res;
235  _index.get((unsigned char*)&res, sizeof(int), (lineno - 1)*sizeof(int));
236  return res;
237  }
238  return _cells.len();
239 }
240 
241 void HistoryScrollFile::getCells(int lineno, int colno, int count, Character res[])
242 {
243  _cells.get((unsigned char*)res, count * sizeof(Character), startOfLine(lineno) + colno * sizeof(Character));
244 }
245 
246 void HistoryScrollFile::addCells(const Character text[], int count)
247 {
248  _cells.add((unsigned char*)text, count * sizeof(Character));
249 }
250 
251 void HistoryScrollFile::addLine(bool previousWrapped)
252 {
253  if (_index.isMapped())
254  _index.unmap();
255 
256  int locn = _cells.len();
257  _index.add((unsigned char*)&locn, sizeof(int));
258  unsigned char flags = previousWrapped ? 0x01 : 0x00;
259  _lineflags.add((unsigned char*)&flags, sizeof(unsigned char));
260 }
261 
262 // History Scroll None //////////////////////////////////////
263 
264 HistoryScrollNone::HistoryScrollNone()
265  : HistoryScroll(new HistoryTypeNone())
266 {
267 }
268 
269 HistoryScrollNone::~HistoryScrollNone()
270 {
271 }
272 
273 bool HistoryScrollNone::hasScroll()
274 {
275  return false;
276 }
277 
278 int HistoryScrollNone::getLines()
279 {
280  return 0;
281 }
282 
283 int HistoryScrollNone::getLineLen(int)
284 {
285  return 0;
286 }
287 
288 bool HistoryScrollNone::isWrappedLine(int /*lineno*/)
289 {
290  return false;
291 }
292 
293 void HistoryScrollNone::getCells(int, int, int, Character [])
294 {
295 }
296 
297 void HistoryScrollNone::addCells(const Character [], int)
298 {
299 }
300 
301 void HistoryScrollNone::addLine(bool)
302 {
303 }
304 
306 // Compact History Scroll //////////////////////////////////////
308 void* CompactHistoryBlock::allocate(size_t size)
309 {
310  Q_ASSERT(size > 0);
311  if (_tail - _blockStart + size > _blockLength)
312  return 0;
313 
314  void* block = _tail;
315  _tail += size;
316  //kDebug() << "allocated " << length << " bytes at address " << block;
317  _allocCount++;
318  return block;
319 }
320 
321 void CompactHistoryBlock::deallocate()
322 {
323  _allocCount--;
324  Q_ASSERT(_allocCount >= 0);
325 }
326 
327 void* CompactHistoryBlockList::allocate(size_t size)
328 {
329  CompactHistoryBlock* block;
330  if (list.isEmpty() || list.last()->remaining() < size) {
331  block = new CompactHistoryBlock();
332  list.append(block);
333  //kDebug() << "new block created, remaining " << block->remaining() << "number of blocks=" << list.size();
334  } else {
335  block = list.last();
336  //kDebug() << "old block used, remaining " << block->remaining();
337  }
338  return block->allocate(size);
339 }
340 
341 void CompactHistoryBlockList::deallocate(void* ptr)
342 {
343  Q_ASSERT(!list.isEmpty());
344 
345  int i = 0;
346  CompactHistoryBlock* block = list.at(i);
347  while (i < list.size() && !block->contains(ptr)) {
348  i++;
349  block = list.at(i);
350  }
351 
352  Q_ASSERT(i < list.size());
353 
354  block->deallocate();
355 
356  if (!block->isInUse()) {
357  list.removeAt(i);
358  delete block;
359  //kDebug() << "block deleted, new size = " << list.size();
360  }
361 }
362 
363 CompactHistoryBlockList::~CompactHistoryBlockList()
364 {
365  qDeleteAll(list.begin(), list.end());
366  list.clear();
367 }
368 
369 void* CompactHistoryLine::operator new(size_t size, CompactHistoryBlockList& blockList)
370 {
371  return blockList.allocate(size);
372 }
373 
374 CompactHistoryLine::CompactHistoryLine(const TextLine& line, CompactHistoryBlockList& bList)
375  : _blockListRef(bList),
376  _formatLength(0)
377 {
378  _length = line.size();
379 
380  if (line.size() > 0) {
381  _formatLength = 1;
382  int k = 1;
383 
384  // count number of different formats in this text line
385  Character c = line[0];
386  while (k < _length) {
387  if (!(line[k].equalsFormat(c))) {
388  _formatLength++; // format change detected
389  c = line[k];
390  }
391  k++;
392  }
393 
394  //kDebug() << "number of different formats in string: " << _formatLength;
395  _formatArray = (CharacterFormat*) _blockListRef.allocate(sizeof(CharacterFormat) * _formatLength);
396  Q_ASSERT(_formatArray != 0);
397  _text = (quint16*) _blockListRef.allocate(sizeof(quint16) * line.size());
398  Q_ASSERT(_text != 0);
399 
400  _length = line.size();
401  _wrapped = false;
402 
403  // record formats and their positions in the format array
404  c = line[0];
405  _formatArray[0].setFormat(c);
406  _formatArray[0].startPos = 0; // there's always at least 1 format (for the entire line, unless a change happens)
407 
408  k = 1; // look for possible format changes
409  int j = 1;
410  while (k < _length && j < _formatLength) {
411  if (!(line[k].equalsFormat(c))) {
412  c = line[k];
413  _formatArray[j].setFormat(c);
414  _formatArray[j].startPos = k;
415  //kDebug() << "format entry " << j << " at pos " << _formatArray[j].startPos << " " << &(_formatArray[j].startPos) ;
416  j++;
417  }
418  k++;
419  }
420 
421  // copy character values
422  for (int i = 0; i < line.size(); i++) {
423  _text[i] = line[i].character;
424  //kDebug() << "char " << i << " at mem " << &(text[i]);
425  }
426  }
427  //kDebug() << "line created, length " << length << " at " << &(length);
428 }
429 
430 CompactHistoryLine::~CompactHistoryLine()
431 {
432  if (_length > 0) {
433  _blockListRef.deallocate(_text);
434  _blockListRef.deallocate(_formatArray);
435  }
436  _blockListRef.deallocate(this);
437 }
438 
439 void CompactHistoryLine::getCharacter(int index, Character& r)
440 {
441  Q_ASSERT(index < _length);
442  int formatPos = 0;
443  while ((formatPos + 1) < _formatLength && index >= _formatArray[formatPos + 1].startPos)
444  formatPos++;
445 
446  r.character = _text[index];
447  r.rendition = _formatArray[formatPos].rendition;
448  r.foregroundColor = _formatArray[formatPos].fgColor;
449  r.backgroundColor = _formatArray[formatPos].bgColor;
450  r.isRealCharacter = _formatArray[formatPos].isRealCharacter;
451 }
452 
453 void CompactHistoryLine::getCharacters(Character* array, int size, int startColumn)
454 {
455  Q_ASSERT(startColumn >= 0 && size >= 0);
456  Q_ASSERT(startColumn + size <= static_cast<int>(getLength()));
457 
458  for (int i = startColumn; i < size + startColumn; i++) {
459  getCharacter(i, array[i - startColumn]);
460  }
461 }
462 
463 CompactHistoryScroll::CompactHistoryScroll(unsigned int maxLineCount)
464  : HistoryScroll(new CompactHistoryType(maxLineCount))
465  , _lines()
466  , _blockList()
467 {
468  //kDebug() << "scroll of length " << maxLineCount << " created";
469  setMaxNbLines(maxLineCount);
470 }
471 
472 CompactHistoryScroll::~CompactHistoryScroll()
473 {
474  qDeleteAll(_lines.begin(), _lines.end());
475  _lines.clear();
476 }
477 
478 void CompactHistoryScroll::addCellsVector(const TextLine& cells)
479 {
480  CompactHistoryLine* line;
481  line = new(_blockList) CompactHistoryLine(cells, _blockList);
482 
483  if (_lines.size() > static_cast<int>(_maxLineCount)) {
484  delete _lines.takeAt(0);
485  }
486  _lines.append(line);
487 }
488 
489 void CompactHistoryScroll::addCells(const Character a[], int count)
490 {
491  TextLine newLine(count);
492  qCopy(a, a + count, newLine.begin());
493  addCellsVector(newLine);
494 }
495 
496 void CompactHistoryScroll::addLine(bool previousWrapped)
497 {
498  CompactHistoryLine* line = _lines.last();
499  //kDebug() << "last line at address " << line;
500  line->setWrapped(previousWrapped);
501 }
502 
503 int CompactHistoryScroll::getLines()
504 {
505  return _lines.size();
506 }
507 
508 int CompactHistoryScroll::getLineLen(int lineNumber)
509 {
510  if ((lineNumber < 0) || (lineNumber >= _lines.size())) {
511  kDebug() << "requested line invalid: 0 < " << lineNumber << " < " <<_lines.size();
512  //Q_ASSERT(lineNumber >= 0 && lineNumber < _lines.size());
513  return 0;
514  }
515  CompactHistoryLine* line = _lines[lineNumber];
516  //kDebug() << "request for line at address " << line;
517  return line->getLength();
518 }
519 
520 void CompactHistoryScroll::getCells(int lineNumber, int startColumn, int count, Character buffer[])
521 {
522  if (count == 0) return;
523  Q_ASSERT(lineNumber < _lines.size());
524  CompactHistoryLine* line = _lines[lineNumber];
525  Q_ASSERT(startColumn >= 0);
526  Q_ASSERT((unsigned int)startColumn <= line->getLength() - count);
527  line->getCharacters(buffer, count, startColumn);
528 }
529 
530 void CompactHistoryScroll::setMaxNbLines(unsigned int lineCount)
531 {
532  _maxLineCount = lineCount;
533 
534  while (_lines.size() > static_cast<int>(lineCount)) {
535  delete _lines.takeAt(0);
536  }
537  //kDebug() << "set max lines to: " << _maxLineCount;
538 }
539 
540 bool CompactHistoryScroll::isWrappedLine(int lineNumber)
541 {
542  Q_ASSERT(lineNumber < _lines.size());
543  return _lines[lineNumber]->isWrapped();
544 }
545 
547 // History Types
549 
550 HistoryType::HistoryType()
551 {
552 }
553 
554 HistoryType::~HistoryType()
555 {
556 }
557 
559 
560 HistoryTypeNone::HistoryTypeNone()
561 {
562 }
563 
564 bool HistoryTypeNone::isEnabled() const
565 {
566  return false;
567 }
568 
569 HistoryScroll* HistoryTypeNone::scroll(HistoryScroll* old) const
570 {
571  delete old;
572  return new HistoryScrollNone();
573 }
574 
575 int HistoryTypeNone::maximumLineCount() const
576 {
577  return 0;
578 }
579 
581 
582 HistoryTypeFile::HistoryTypeFile(const QString& fileName)
583  : _fileName(fileName)
584 {
585 }
586 
587 bool HistoryTypeFile::isEnabled() const
588 {
589  return true;
590 }
591 
592 HistoryScroll* HistoryTypeFile::scroll(HistoryScroll* old) const
593 {
594  if (dynamic_cast<HistoryFile *>(old))
595  return old; // Unchanged.
596 
597  HistoryScroll* newScroll = new HistoryScrollFile(_fileName);
598 
599  Character line[LINE_SIZE];
600  int lines = (old != 0) ? old->getLines() : 0;
601  for (int i = 0; i < lines; i++) {
602  int size = old->getLineLen(i);
603  if (size > LINE_SIZE) {
604  Character* tmp_line = new Character[size];
605  old->getCells(i, 0, size, tmp_line);
606  newScroll->addCells(tmp_line, size);
607  newScroll->addLine(old->isWrappedLine(i));
608  delete [] tmp_line;
609  } else {
610  old->getCells(i, 0, size, line);
611  newScroll->addCells(line, size);
612  newScroll->addLine(old->isWrappedLine(i));
613  }
614  }
615 
616  delete old;
617  return newScroll;
618 }
619 
620 int HistoryTypeFile::maximumLineCount() const
621 {
622  return -1;
623 }
624 
626 
627 CompactHistoryType::CompactHistoryType(unsigned int nbLines)
628  : _maxLines(nbLines)
629 {
630 }
631 
632 bool CompactHistoryType::isEnabled() const
633 {
634  return true;
635 }
636 
637 int CompactHistoryType::maximumLineCount() const
638 {
639  return _maxLines;
640 }
641 
642 HistoryScroll* CompactHistoryType::scroll(HistoryScroll* old) const
643 {
644  if (old) {
645  CompactHistoryScroll* oldBuffer = dynamic_cast<CompactHistoryScroll*>(old);
646  if (oldBuffer) {
647  oldBuffer->setMaxNbLines(_maxLines);
648  return oldBuffer;
649  }
650  delete old;
651  }
652  return new CompactHistoryScroll(_maxLines);
653 }
Konsole::TextLine
QVector< Character > TextLine
Definition: History.h:174
Konsole::HistoryTypeFile::maximumLineCount
virtual int maximumLineCount() const
Returns the maximum number of lines which this history type can store or -1 if the history can store ...
Definition: History.cpp:620
Konsole::CompactHistoryBlockList::deallocate
void deallocate(void *)
Definition: History.cpp:341
Konsole::HistoryTypeNone::maximumLineCount
virtual int maximumLineCount() const
Returns the maximum number of lines which this history type can store or -1 if the history can store ...
Definition: History.cpp:575
Konsole::CompactHistoryBlockList
Definition: History.h:240
Konsole::CompactHistoryScroll::getLineLen
virtual int getLineLen(int lineno)
Definition: History.cpp:508
Konsole::CompactHistoryType::CompactHistoryType
CompactHistoryType(unsigned int size)
Definition: History.cpp:627
Konsole::CompactHistoryScroll
Definition: History.h:288
Konsole::HistoryType::HistoryType
HistoryType()
Definition: History.cpp:550
Konsole::Character::character
quint16 character
The unicode character value for this character.
Definition: Character.h:108
Konsole::CharacterFormat::setFormat
void setFormat(const Character &c)
Definition: History.h:187
Konsole::CompactHistoryLine::getLength
virtual unsigned int getLength() const
Definition: History.h:275
Konsole::HistoryScrollFile::~HistoryScrollFile
virtual ~HistoryScrollFile()
Definition: History.cpp:203
Konsole::CompactHistoryBlockList::allocate
void * allocate(size_t size)
Definition: History.cpp:327
Konsole::CompactHistoryBlock::allocate
virtual void * allocate(size_t length)
Definition: History.cpp:308
Konsole::HistoryTypeNone
Definition: History.h:348
Konsole::HistoryTypeFile::scroll
virtual HistoryScroll * scroll(HistoryScroll *) const
Converts from one type of HistoryScroll to another or if given the same type, returns it...
Definition: History.cpp:592
Konsole::HistoryTypeFile::_fileName
QString _fileName
Definition: History.h:370
LINE_SIZE
static const int LINE_SIZE
Definition: History.cpp:38
Konsole::CompactHistoryScroll::setMaxNbLines
void setMaxNbLines(unsigned int nbLines)
Definition: History.cpp:530
Konsole::HistoryTypeNone::HistoryTypeNone
HistoryTypeNone()
Definition: History.cpp:560
Konsole::HistoryScrollFile::getCells
virtual void getCells(int lineno, int colno, int count, Character res[])
Definition: History.cpp:241
Konsole::CompactHistoryLine
Definition: History.h:255
Konsole::CompactHistoryBlock
Definition: History.h:200
Konsole::CharacterFormat::rendition
quint8 rendition
Definition: History.h:196
Konsole::CompactHistoryType
Definition: History.h:373
Konsole::HistoryFile::unmap
void unmap()
Definition: History.cpp:96
Konsole::HistoryScrollNone::getLines
virtual int getLines()
Definition: History.cpp:278
Konsole::HistoryScroll::getCells
virtual void getCells(int lineno, int colno, int count, Character res[])=0
Konsole::HistoryScrollFile::addCells
virtual void addCells(const Character a[], int count)
Definition: History.cpp:246
Konsole::CompactHistoryBlock::isInUse
virtual bool isInUse()
Definition: History.h:228
Konsole::CompactHistoryScroll::addCells
virtual void addCells(const Character a[], int count)
Definition: History.cpp:489
Konsole::CompactHistoryLine::_formatArray
CharacterFormat * _formatArray
Definition: History.h:281
Konsole::HistoryScrollFile
Definition: History.h:127
Konsole::HistoryTypeNone::scroll
virtual HistoryScroll * scroll(HistoryScroll *) const
Converts from one type of HistoryScroll to another or if given the same type, returns it...
Definition: History.cpp:569
Konsole::CompactHistoryType::maximumLineCount
virtual int maximumLineCount() const
Returns the maximum number of lines which this history type can store or -1 if the history can store ...
Definition: History.cpp:637
Konsole::CompactHistoryScroll::addCellsVector
virtual void addCellsVector(const TextLine &cells)
Definition: History.cpp:478
Konsole::HistoryScroll::isWrappedLine
virtual bool isWrappedLine(int lineno)=0
Konsole::Character
A single character in the terminal which consists of a unicode character value, foreground and backgr...
Definition: Character.h:77
Konsole::HistoryScrollFile::addLine
virtual void addLine(bool previousWrapped=false)
Definition: History.cpp:251
Konsole::Character::isRealCharacter
bool isRealCharacter
Indicate whether this character really exists, or exists simply as place holder.
Definition: Character.h:128
Konsole::HistoryScrollNone::addLine
virtual void addLine(bool previousWrapped=false)
Definition: History.cpp:301
History.h
Konsole::HistoryScroll::addLine
virtual void addLine(bool previousWrapped=false)=0
Konsole::CompactHistoryBlock::contains
virtual bool contains(void *addr)
Definition: History.h:224
Konsole::HistoryScrollNone::getCells
virtual void getCells(int lineno, int colno, int count, Character res[])
Definition: History.cpp:293
Konsole::CompactHistoryType::_maxLines
unsigned int _maxLines
Definition: History.h:384
Konsole::HistoryScroll::getLines
virtual int getLines()=0
Konsole::CompactHistoryScroll::~CompactHistoryScroll
virtual ~CompactHistoryScroll()
Definition: History.cpp:472
Konsole::CompactHistoryLine::getCharacters
virtual void getCharacters(Character *array, int length, int startColumn)
Definition: History.cpp:453
Konsole::HistoryFile::HistoryFile
HistoryFile()
Definition: History.cpp:58
Konsole::HistoryScrollNone::isWrappedLine
virtual bool isWrappedLine(int lineno)
Definition: History.cpp:288
Konsole::CompactHistoryScroll::CompactHistoryScroll
CompactHistoryScroll(unsigned int maxNbLines=1000)
Definition: History.cpp:463
Konsole::CharacterFormat::fgColor
CharacterColor fgColor
Definition: History.h:194
Konsole::HistoryScrollNone::HistoryScrollNone
HistoryScrollNone()
Definition: History.cpp:264
Konsole::CompactHistoryLine::_length
quint16 _length
Definition: History.h:282
loc
#define loc(X, Y)
Definition: Screen.cpp:51
Konsole::HistoryFile::map
void map()
Definition: History.cpp:82
Konsole::CompactHistoryLine::_text
quint16 * _text
Definition: History.h:283
Konsole::HistoryScrollNone::~HistoryScrollNone
virtual ~HistoryScrollNone()
Definition: History.cpp:269
Konsole::CompactHistoryLine::_wrapped
bool _wrapped
Definition: History.h:285
Konsole::HistoryTypeFile::HistoryTypeFile
HistoryTypeFile(const QString &fileName=QString())
Definition: History.cpp:582
Konsole::CompactHistoryBlock::deallocate
virtual void deallocate()
Definition: History.cpp:321
Konsole::CompactHistoryScroll::getCells
virtual void getCells(int lineno, int colno, int count, Character res[])
Definition: History.cpp:520
Konsole::Character::backgroundColor
CharacterColor backgroundColor
The color used to draw this character's background.
Definition: Character.h:117
Konsole::HistoryFile::isMapped
bool isMapped() const
Definition: History.cpp:105
Konsole::CompactHistoryType::isEnabled
virtual bool isEnabled() const
Returns true if the history is enabled ( can store lines of output ) or false otherwise.
Definition: History.cpp:632
Konsole::HistoryScroll::HistoryScroll
HistoryScroll(HistoryType *)
Definition: History.cpp:170
Konsole::HistoryScrollNone::addCells
virtual void addCells(const Character a[], int count)
Definition: History.cpp:297
Konsole::HistoryTypeFile::isEnabled
virtual bool isEnabled() const
Returns true if the history is enabled ( can store lines of output ) or false otherwise.
Definition: History.cpp:587
Konsole::CharacterFormat::bgColor
CharacterColor bgColor
Definition: History.h:194
Konsole::HistoryScroll::getLineLen
virtual int getLineLen(int lineno)=0
Konsole::HistoryFile::add
virtual void add(const unsigned char *bytes, int len)
Definition: History.cpp:110
Konsole::HistoryTypeFile
Definition: History.h:359
Konsole::CompactHistoryLine::getCharacter
virtual void getCharacter(int index, Character &r)
Definition: History.cpp:439
Konsole::CompactHistoryType::scroll
virtual HistoryScroll * scroll(HistoryScroll *) const
Converts from one type of HistoryScroll to another or if given the same type, returns it...
Definition: History.cpp:642
Konsole::HistoryType
Definition: History.h:319
Konsole::HistoryFile::get
virtual void get(unsigned char *bytes, int len, int loc)
Definition: History.cpp:132
Konsole::HistoryScroll::~HistoryScroll
virtual ~HistoryScroll()
Definition: History.cpp:175
Konsole::CharacterFormat
Definition: History.h:176
Konsole::HistoryScroll::_historyType
HistoryType * _historyType
Definition: History.h:120
Konsole::CompactHistoryBlockList::~CompactHistoryBlockList
~CompactHistoryBlockList()
Definition: History.cpp:363
Konsole::HistoryScroll
Definition: History.h:86
Konsole::CompactHistoryLine::~CompactHistoryLine
virtual ~CompactHistoryLine()
Definition: History.cpp:430
Konsole::CompactHistoryLine::CompactHistoryLine
CompactHistoryLine(const TextLine &, CompactHistoryBlockList &blockList)
Definition: History.cpp:374
Konsole::CompactHistoryScroll::isWrappedLine
virtual bool isWrappedLine(int lineno)
Definition: History.cpp:540
Konsole::CharacterFormat::isRealCharacter
bool isRealCharacter
Definition: History.h:197
Konsole::HistoryType::~HistoryType
virtual ~HistoryType()
Definition: History.cpp:554
Konsole::HistoryTypeNone::isEnabled
virtual bool isEnabled() const
Returns true if the history is enabled ( can store lines of output ) or false otherwise.
Definition: History.cpp:564
Konsole::CompactHistoryLine::_blockListRef
CompactHistoryBlockList & _blockListRef
Definition: History.h:277
Konsole::CompactHistoryScroll::addLine
virtual void addLine(bool previousWrapped=false)
Definition: History.cpp:496
Konsole::HistoryScrollFile::HistoryScrollFile
HistoryScrollFile(const QString &logFileName)
Definition: History.cpp:198
Konsole::HistoryScrollNone
Definition: History.h:152
Konsole::CompactHistoryLine::setWrapped
virtual void setWrapped(bool value)
Definition: History.h:272
Konsole::HistoryScrollFile::isWrappedLine
virtual bool isWrappedLine(int lineno)
Definition: History.cpp:217
Konsole::HistoryScrollNone::hasScroll
virtual bool hasScroll()
Definition: History.cpp:273
Konsole::HistoryScrollNone::getLineLen
virtual int getLineLen(int lineno)
Definition: History.cpp:283
Konsole::HistoryScroll::addCells
virtual void addCells(const Character a[], int count)=0
Konsole::HistoryFile::~HistoryFile
virtual ~HistoryFile()
Definition: History.cpp:73
Konsole::Character::rendition
quint8 rendition
A combination of RENDITION flags which specify options for drawing the character. ...
Definition: Character.h:111
Konsole::HistoryScrollFile::getLineLen
virtual int getLineLen(int lineno)
Definition: History.cpp:212
Konsole::CompactHistoryLine::_formatLength
quint16 _formatLength
Definition: History.h:284
Konsole::CompactHistoryScroll::getLines
virtual int getLines()
Definition: History.cpp:503
Konsole::HistoryScrollFile::getLines
virtual int getLines()
Definition: History.cpp:207
Konsole::Character::foregroundColor
CharacterColor foregroundColor
The foreground color used to draw this character.
Definition: Character.h:114
Konsole::HistoryScroll::hasScroll
virtual bool hasScroll()
Definition: History.cpp:180
Konsole::CharacterFormat::startPos
quint16 startPos
Definition: History.h:195
Konsole::HistoryFile::len
virtual int len() const
Definition: History.cpp:163
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:24 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Applications
  •   Libraries
  •     libkonq
  • Konsole

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