diff --git a/ChangeLog b/ChangeLog index 63dd18e7..36cdcca7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +11 Sep 2000 +- improved scrolling speed. 10 Sep 2000 - *.keytab not sending \0 fixed. 9 Sep 2000 diff --git a/Konsole2.Requierements b/Konsole2.Requierements index 72e1c1d7..90096fb3 100644 --- a/Konsole2.Requierements +++ b/Konsole2.Requierements @@ -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 diff --git a/include/TEHistory.h b/include/TEHistory.h index 2cb45efc..eda8ddb4 100644 --- a/include/TEHistory.h +++ b/include/TEHistory.h @@ -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: diff --git a/src/TEHistory.C b/src/TEHistory.C index fb74d7ee..8284552d 100644 --- a/src/TEHistory.C +++ b/src/TEHistory.C @@ -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() diff --git a/src/TEScreen.C b/src/TEScreen.C index 48cb7234..a1d60839 100644 --- a/src/TEScreen.C +++ b/src/TEScreen.C @@ -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