improved scrolling speed.

svn path=/trunk/kdebase/konsole/; revision=63468
wilder-portage
Lars Doelle 26 years ago
parent 7466232e8f
commit ae8782dae1
  1. 2
      ChangeLog
  2. 2
      Konsole2.Requierements
  3. 7
      include/TEHistory.h
  4. 16
      src/TEHistory.C
  5. 27
      src/TEScreen.C

@ -1,3 +1,5 @@
11 Sep 2000
- improved scrolling speed.
10 Sep 2000
- *.keytab not sending \0 fixed.
9 Sep 2000

@ -1,6 +1,6 @@
[Konsole2.Requierements]
The current state of konsole asks for redesign.
The current state of konsole asks for a redesign.
While lower level material, especially the emulation
comes out to be very stable over the years, the upper

@ -51,10 +51,13 @@ public:
public: // access to history
int getLines();
int getLineLen(int lineno);
ca getCell(int lineno, int colno);
void getCells(int lineno, int colno, int count, ca res[]);
public: // backward compatibility (obsolete)
ca getCell(int lineno, int colno) { ca res; getCells(lineno,colno,1,&res); return res; }
public: // adding lines.
void addCell(ca a);
void addCells(ca a[], int count);
void addLine();
private:

@ -164,17 +164,20 @@ bool HistoryScroll::hasScroll()
int HistoryScroll::getLines()
{
if (!hasScroll()) return 0;
return index.len() / sizeof(int);
}
int HistoryScroll::getLineLen(int lineno)
{
if (!hasScroll()) return 0;
return (startOfLine(lineno+1) - startOfLine(lineno)) / sizeof(ca);
}
int HistoryScroll::startOfLine(int lineno)
{
if (lineno <= 0) return 0;
if (!hasScroll()) return 0;
if (lineno <= getLines())
{ int res;
index.get((unsigned char*)&res,sizeof(int),(lineno-1)*sizeof(int));
@ -183,17 +186,16 @@ int HistoryScroll::startOfLine(int lineno)
return cells.len();
}
ca HistoryScroll::getCell(int lineno, int colno)
{ ca res;
if (hasScroll())
cells.get((unsigned char*)&res,sizeof(ca),startOfLine(lineno)+colno*sizeof(ca));
return res;
void HistoryScroll::getCells(int lineno, int colno, int count, ca res[])
{
assert(hasScroll());
cells.get((unsigned char*)res,count*sizeof(ca),startOfLine(lineno)+colno*sizeof(ca));
}
void HistoryScroll::addCell(ca text)
void HistoryScroll::addCells(ca text[], int count)
{
if (!hasScroll()) return;
cells.add((unsigned char*)&text,sizeof(ca));
cells.add((unsigned char*)text,count*sizeof(ca));
}
void HistoryScroll::addLine()

@ -497,18 +497,13 @@ ca* TEScreen::getCookedImage()
for (y = 0; (y < lines) && (y < (hist.getLines()-histCursor)); y++)
{
int len = QMIN(columns,hist.getLineLen(y+histCursor));
int yp = y*columns;
int yq = (y+histCursor)*columns;
for (x = 0; x < len; x++)
{ int p=x + y*columns;
int q=x + (y+histCursor)*columns;
merged[p] = hist.getCell(y+histCursor,x);
if ( ( q >= sel_TL ) && ( q <= sel_BR ) )
reverseRendition(&merged[p]); // for selection
}
for (; x < columns; x++)
{ int p=x + y*columns;
int q=x + (y+histCursor)*columns;
merged[p] = dft;
hist.getCells(y+histCursor,0,len,merged+yp);
for (x = len; x < columns; x++) merged[yp+x] = dft;
for (x = 0; x < columns; x++)
{ int p=x + yp; int q=x + yq;
if ( ( q >= sel_TL ) && ( q <= sel_BR ) )
reverseRendition(&merged[p]); // for selection
}
@ -517,10 +512,11 @@ ca* TEScreen::getCookedImage()
{
for (y = (hist.getLines()-histCursor); y < lines ; y++)
{
int yp = y*columns;
int yq = (y+histCursor)*columns;
int yr = (y-hist.getLines()+histCursor)*columns;
for (x = 0; x < columns; x++)
{ int p = x + y * columns;
int q = x + (y+histCursor)*columns;
int r = x + (y-hist.getLines()+histCursor)*columns;
{ int p = x + yp; int q = x + yq; int r = x + yr;
merged[p] = image[r];
if ( q >= sel_TL && q <= sel_BR )
reverseRendition(&merged[p]); // for selection
@ -1155,8 +1151,7 @@ void TEScreen::addHistLine()
while (end >= 0 && image[end] == dft)
end -= 1;
for (int i = 0; i <= end; i++)
hist.addCell(image[i]);
hist.addCells(image,end+1);
hist.addLine();
// adjust history cursor

Loading…
Cancel
Save