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

Konsole

  • kde-4.14
  • 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  _formatArray(0),
377  _text(0),
378  _formatLength(0),
379  _wrapped(false)
380 {
381  _length = line.size();
382 
383  if (line.size() > 0) {
384  _formatLength = 1;
385  int k = 1;
386 
387  // count number of different formats in this text line
388  Character c = line[0];
389  while (k < _length) {
390  if (!(line[k].equalsFormat(c))) {
391  _formatLength++; // format change detected
392  c = line[k];
393  }
394  k++;
395  }
396 
397  //kDebug() << "number of different formats in string: " << _formatLength;
398  _formatArray = (CharacterFormat*) _blockListRef.allocate(sizeof(CharacterFormat) * _formatLength);
399  Q_ASSERT(_formatArray != 0);
400  _text = (quint16*) _blockListRef.allocate(sizeof(quint16) * line.size());
401  Q_ASSERT(_text != 0);
402 
403  _length = line.size();
404  _wrapped = false;
405 
406  // record formats and their positions in the format array
407  c = line[0];
408  _formatArray[0].setFormat(c);
409  _formatArray[0].startPos = 0; // there's always at least 1 format (for the entire line, unless a change happens)
410 
411  k = 1; // look for possible format changes
412  int j = 1;
413  while (k < _length && j < _formatLength) {
414  if (!(line[k].equalsFormat(c))) {
415  c = line[k];
416  _formatArray[j].setFormat(c);
417  _formatArray[j].startPos = k;
418  //kDebug() << "format entry " << j << " at pos " << _formatArray[j].startPos << " " << &(_formatArray[j].startPos) ;
419  j++;
420  }
421  k++;
422  }
423 
424  // copy character values
425  for (int i = 0; i < line.size(); i++) {
426  _text[i] = line[i].character;
427  //kDebug() << "char " << i << " at mem " << &(text[i]);
428  }
429  }
430  //kDebug() << "line created, length " << length << " at " << &(length);
431 }
432 
433 CompactHistoryLine::~CompactHistoryLine()
434 {
435  if (_length > 0) {
436  _blockListRef.deallocate(_text);
437  _blockListRef.deallocate(_formatArray);
438  }
439  _blockListRef.deallocate(this);
440 }
441 
442 void CompactHistoryLine::getCharacter(int index, Character& r)
443 {
444  Q_ASSERT(index < _length);
445  int formatPos = 0;
446  while ((formatPos + 1) < _formatLength && index >= _formatArray[formatPos + 1].startPos)
447  formatPos++;
448 
449  r.character = _text[index];
450  r.rendition = _formatArray[formatPos].rendition;
451  r.foregroundColor = _formatArray[formatPos].fgColor;
452  r.backgroundColor = _formatArray[formatPos].bgColor;
453  r.isRealCharacter = _formatArray[formatPos].isRealCharacter;
454 }
455 
456 void CompactHistoryLine::getCharacters(Character* array, int size, int startColumn)
457 {
458  Q_ASSERT(startColumn >= 0 && size >= 0);
459  Q_ASSERT(startColumn + size <= static_cast<int>(getLength()));
460 
461  for (int i = startColumn; i < size + startColumn; i++) {
462  getCharacter(i, array[i - startColumn]);
463  }
464 }
465 
466 CompactHistoryScroll::CompactHistoryScroll(unsigned int maxLineCount)
467  : HistoryScroll(new CompactHistoryType(maxLineCount))
468  , _lines()
469  , _blockList()
470 {
471  //kDebug() << "scroll of length " << maxLineCount << " created";
472  setMaxNbLines(maxLineCount);
473 }
474 
475 CompactHistoryScroll::~CompactHistoryScroll()
476 {
477  qDeleteAll(_lines.begin(), _lines.end());
478  _lines.clear();
479 }
480 
481 void CompactHistoryScroll::addCellsVector(const TextLine& cells)
482 {
483  CompactHistoryLine* line;
484  line = new(_blockList) CompactHistoryLine(cells, _blockList);
485 
486  if (_lines.size() > static_cast<int>(_maxLineCount)) {
487  delete _lines.takeAt(0);
488  }
489  _lines.append(line);
490 }
491 
492 void CompactHistoryScroll::addCells(const Character a[], int count)
493 {
494  TextLine newLine(count);
495  qCopy(a, a + count, newLine.begin());
496  addCellsVector(newLine);
497 }
498 
499 void CompactHistoryScroll::addLine(bool previousWrapped)
500 {
501  CompactHistoryLine* line = _lines.last();
502  //kDebug() << "last line at address " << line;
503  line->setWrapped(previousWrapped);
504 }
505 
506 int CompactHistoryScroll::getLines()
507 {
508  return _lines.size();
509 }
510 
511 int CompactHistoryScroll::getLineLen(int lineNumber)
512 {
513  if ((lineNumber < 0) || (lineNumber >= _lines.size())) {
514  kDebug() << "requested line invalid: 0 < " << lineNumber << " < " <<_lines.size();
515  //Q_ASSERT(lineNumber >= 0 && lineNumber < _lines.size());
516  return 0;
517  }
518  CompactHistoryLine* line = _lines[lineNumber];
519  //kDebug() << "request for line at address " << line;
520  return line->getLength();
521 }
522 
523 void CompactHistoryScroll::getCells(int lineNumber, int startColumn, int count, Character buffer[])
524 {
525  if (count == 0) return;
526  Q_ASSERT(lineNumber < _lines.size());
527  CompactHistoryLine* line = _lines[lineNumber];
528  Q_ASSERT(startColumn >= 0);
529  Q_ASSERT((unsigned int)startColumn <= line->getLength() - count);
530  line->getCharacters(buffer, count, startColumn);
531 }
532 
533 void CompactHistoryScroll::setMaxNbLines(unsigned int lineCount)
534 {
535  _maxLineCount = lineCount;
536 
537  while (_lines.size() > static_cast<int>(lineCount)) {
538  delete _lines.takeAt(0);
539  }
540  //kDebug() << "set max lines to: " << _maxLineCount;
541 }
542 
543 bool CompactHistoryScroll::isWrappedLine(int lineNumber)
544 {
545  Q_ASSERT(lineNumber < _lines.size());
546  return _lines[lineNumber]->isWrapped();
547 }
548 
550 // History Types
552 
553 HistoryType::HistoryType()
554 {
555 }
556 
557 HistoryType::~HistoryType()
558 {
559 }
560 
562 
563 HistoryTypeNone::HistoryTypeNone()
564 {
565 }
566 
567 bool HistoryTypeNone::isEnabled() const
568 {
569  return false;
570 }
571 
572 HistoryScroll* HistoryTypeNone::scroll(HistoryScroll* old) const
573 {
574  delete old;
575  return new HistoryScrollNone();
576 }
577 
578 int HistoryTypeNone::maximumLineCount() const
579 {
580  return 0;
581 }
582 
584 
585 HistoryTypeFile::HistoryTypeFile(const QString& fileName)
586  : _fileName(fileName)
587 {
588 }
589 
590 bool HistoryTypeFile::isEnabled() const
591 {
592  return true;
593 }
594 
595 HistoryScroll* HistoryTypeFile::scroll(HistoryScroll* old) const
596 {
597  if (dynamic_cast<HistoryFile *>(old))
598  return old; // Unchanged.
599 
600  HistoryScroll* newScroll = new HistoryScrollFile(_fileName);
601 
602  Character line[LINE_SIZE];
603  int lines = (old != 0) ? old->getLines() : 0;
604  for (int i = 0; i < lines; i++) {
605  int size = old->getLineLen(i);
606  if (size > LINE_SIZE) {
607  Character* tmp_line = new Character[size];
608  old->getCells(i, 0, size, tmp_line);
609  newScroll->addCells(tmp_line, size);
610  newScroll->addLine(old->isWrappedLine(i));
611  delete [] tmp_line;
612  } else {
613  old->getCells(i, 0, size, line);
614  newScroll->addCells(line, size);
615  newScroll->addLine(old->isWrappedLine(i));
616  }
617  }
618 
619  delete old;
620  return newScroll;
621 }
622 
623 int HistoryTypeFile::maximumLineCount() const
624 {
625  return -1;
626 }
627 
629 
630 CompactHistoryType::CompactHistoryType(unsigned int nbLines)
631  : _maxLines(nbLines)
632 {
633 }
634 
635 bool CompactHistoryType::isEnabled() const
636 {
637  return true;
638 }
639 
640 int CompactHistoryType::maximumLineCount() const
641 {
642  return _maxLines;
643 }
644 
645 HistoryScroll* CompactHistoryType::scroll(HistoryScroll* old) const
646 {
647  if (old) {
648  CompactHistoryScroll* oldBuffer = dynamic_cast<CompactHistoryScroll*>(old);
649  if (oldBuffer) {
650  oldBuffer->setMaxNbLines(_maxLines);
651  return oldBuffer;
652  }
653  delete old;
654  }
655  return new CompactHistoryScroll(_maxLines);
656 }
QList::clear
void clear()
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:623
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:578
Konsole::CompactHistoryBlockList
Definition: History.h:240
Konsole::CompactHistoryScroll::getLineLen
virtual int getLineLen(int lineno)
Definition: History.cpp:511
Konsole::CompactHistoryType::CompactHistoryType
CompactHistoryType(unsigned int size)
Definition: History.cpp:630
Konsole::CompactHistoryScroll
Definition: History.h:288
Konsole::HistoryType::HistoryType
HistoryType()
Definition: History.cpp:553
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
QVector::begin
iterator begin()
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:595
Konsole::HistoryTypeFile::_fileName
QString _fileName
Definition: History.h:370
LINE_SIZE
static const int LINE_SIZE
Definition: History.cpp:38
QFile::handle
int handle() const
Konsole::CompactHistoryScroll::setMaxNbLines
void setMaxNbLines(unsigned int nbLines)
Definition: History.cpp:533
Konsole::HistoryTypeNone::HistoryTypeNone
HistoryTypeNone()
Definition: History.cpp:563
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
QList::takeAt
T takeAt(int i)
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:492
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:572
QList::size
int size() const
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:640
Konsole::CompactHistoryScroll::addCellsVector
virtual void addCellsVector(const TextLine &cells)
Definition: History.cpp:481
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
QList::append
void append(const T &value)
Konsole::CompactHistoryScroll::~CompactHistoryScroll
virtual ~CompactHistoryScroll()
Definition: History.cpp:475
Konsole::CompactHistoryLine::getCharacters
virtual void getCharacters(Character *array, int length, int startColumn)
Definition: History.cpp:456
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:466
Konsole::CharacterFormat::fgColor
CharacterColor fgColor
Definition: History.h:194
QTemporaryFile::setAutoRemove
void setAutoRemove(bool b)
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
QTemporaryFile::setFileTemplate
void setFileTemplate(const QString &name)
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:585
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:523
Konsole::Character::backgroundColor
CharacterColor backgroundColor
The color used to draw this character's background.
Definition: Character.h:117
QString
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:635
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:590
QList::end
iterator end()
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:442
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:645
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
QVector
Konsole::HistoryScroll::_historyType
HistoryType * _historyType
Definition: History.h:120
Konsole::CompactHistoryBlockList::~CompactHistoryBlockList
~CompactHistoryBlockList()
Definition: History.cpp:363
QList::last
T & last()
Konsole::HistoryScroll
Definition: History.h:86
Konsole::CompactHistoryLine::~CompactHistoryLine
virtual ~CompactHistoryLine()
Definition: History.cpp:433
Konsole::CompactHistoryLine::CompactHistoryLine
CompactHistoryLine(const TextLine &, CompactHistoryBlockList &blockList)
Definition: History.cpp:374
Konsole::CompactHistoryScroll::isWrappedLine
virtual bool isWrappedLine(int lineno)
Definition: History.cpp:543
Konsole::CharacterFormat::isRealCharacter
bool isRealCharacter
Definition: History.h:197
Konsole::HistoryType::~HistoryType
virtual ~HistoryType()
Definition: History.cpp:557
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:567
Konsole::CompactHistoryLine::_blockListRef
CompactHistoryBlockList & _blockListRef
Definition: History.h:277
Konsole::CompactHistoryScroll::addLine
virtual void addLine(bool previousWrapped=false)
Definition: History.cpp:499
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
QVector::size
int size() const
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
QTemporaryFile::open
bool open()
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
QList::begin
iterator begin()
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:506
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-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 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
  • 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