-rw-r--r-- | core/apps/embeddedkonsole/TEScreen.cpp | 60 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/TEWidget.cpp | 63 |
2 files changed, 3 insertions, 120 deletions
diff --git a/core/apps/embeddedkonsole/TEScreen.cpp b/core/apps/embeddedkonsole/TEScreen.cpp index 50807d3..a6cf6a1 100644 --- a/core/apps/embeddedkonsole/TEScreen.cpp +++ b/core/apps/embeddedkonsole/TEScreen.cpp @@ -540,83 +540,25 @@ ca* TEScreen::getCookedImage() } } // evtl. inverse display if (getMode(MODE_Screen)) { int i,n = lines*columns; for (i = 0; i < n; i++) reverseRendition(&merged[i]); // for reverse display } if (getMode(MODE_Cursor) && (cuY+(hist.getLines()-histCursor) < lines)) // cursor visible reverseRendition(&merged[loc(cuX,cuY+(hist.getLines()-histCursor))]); return merged; - - /* - int x, y, z; - - ca* merged = (ca*)malloc( lines * columns * sizeof( ca)); - - ca dft(' ',DEFAULT_FORE_COLOR,DEFAULT_BACK_COLOR,DEFAULT_RENDITION); - -// qDebug("hist lines %d, historyCursor %d, minus %d ,lines %d, columns %d", -// hist.getLines(), histCursor, hist.getLines() - histCursor , lines, columns); - 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; -// qDebug("horzCursor %d, columns %d, len %d", horzCursor, columns, len); -// qDebug("lineno %d, colno %d, count %d\n", y + histCursor, (horzCursor / 2), len ); - qDebug("Y %d", y); - hist.getCells( y + histCursor, (horzCursor / 2), 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 - } - } - - if (lines >= hist.getLines() - histCursor) { - for (y = ( hist.getLines() - histCursor); y < lines ; y++) { - int z = horzCursor; - int yp = y * columns; - int yq = ( y + histCursor) * columns; - int yr = ( y - hist.getLines() + histCursor) * columns; -// qDebug("y %d, yp %d, yq %d, columns %d, z cursor %d", y, yp, yq, columns, z); - for (x = 0; x < columns; x++) { - int p = x + yp; int q = x + yq; int r = (x + (horzCursor/2) ) + yr; - merged[p] = image[r]; - if ( q >= sel_TL && q <= sel_BR ) - reverseRendition( &merged[p]); // for selection - } - } - } - - -// evtl. inverse display - if (getMode(MODE_Screen)) - { int i, n = lines * columns; - for (i = 0; i < n; i++) - reverseRendition( &merged[i]); // for reverse display - } - if (getMode(MODE_Cursor) && ( cuY + ( hist.getLines() - histCursor) < lines)) // cursor visible - - reverseRendition( &merged[ loc( cuX, cuY + ( hist.getLines() - histCursor))] ); - - return merged; - */ - + } /*! */ void TEScreen::reset() { Config cfg("Konsole"); cfg.setGroup("ScrollBar"); if( !cfg.readBoolEntry("HorzScroll",0) ) setMode(MODE_Wrap ); saveMode(MODE_Wrap ); // wrap at end of margin diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp index 60021f4..d6ee6e8 100644 --- a/core/apps/embeddedkonsole/TEWidget.cpp +++ b/core/apps/embeddedkonsole/TEWidget.cpp @@ -1046,30 +1046,30 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e ) ke->ascii(), ke->state()|AltButton, ke->text()); dele=TRUE; } } } #endif if ( e->type() == QEvent::KeyPress ) { QKeyEvent* ke = (QKeyEvent*)e; actSel=0; // Key stroke implies a screen update, so TEWidget won't // know where the current selection is. -// qDebug("key pressed is 0x%x, state %d",ke->key(), ke->state()); +// qDebug("key pressed is 0x%x, ascii is 0x%x, state %d", ke->key(), ke->ascii(), ke->state()); if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker -// qDebug("key pressed 2 is 0x%x",ke->key()); +// qDebug("key pressed 2 is 0x%x", ke->key()); emitText("\\"); // expose } else if( ke->state() == ControlButton && ke->key() == Key_V) { pasteClipboard(); } else emit keyPressedSignal(ke); // expose ke->accept(); #ifdef FAKE_CTRL_AND_ALT if ( dele ) delete e; #endif return true; // stop the event @@ -1198,83 +1198,24 @@ void TEWidget::calcGeometry() hScrollbar->setRange(0, vcolumns - dcolumns); QPoint p = contentsRect().bottomLeft(); hScrollbar->move(QPoint(p.x(), p.y() - hwidth)); hScrollbar->show(); } else hScrollbar->hide(); if(showhscrollbar == 1) { lines = lines - (hwidth / font_h) - 1; if(lines < 1) lines = 1; } - - /*//FIXME: set rimX == rimY == 0 when running in full screen mode. - Config cfg("Konsole"); - cfg.setGroup("ScrollBar"); - useHorzScroll=cfg.readBoolEntry("HorzScroll",0); - - scrollbar->resize( QApplication::style().scrollBarExtent().width(), - contentsRect().height()); - qDebug("font_w %d", font_w); - switch(scrollLoc) - { - case SCRNONE : - columns = ( contentsRect().width() - 2 * rimX ) / font_w; - blX = (contentsRect().width() - (columns*font_w) ) / 2; - brX = blX; - scrollbar->hide(); - break; - case SCRLEFT : - columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; - if(useHorzScroll) columns = columns * (font_w/2); - brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; - blX = brX + scrollbar->width(); - scrollbar->move(contentsRect().topLeft()); - scrollbar->show(); - break; - case SCRRIGHT: - columns = ( contentsRect().width() - 2 * rimX - scrollbar->width() ) / font_w; - if(useHorzScroll) columns = columns * (font_w/2); - blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; - if(useHorzScroll) { - brX = blX =2; - } else { - brX=blX; - } - scrollbar->move(contentsRect().topRight() - QPoint(scrollbar->width()-1,0) ); - scrollbar->show(); - break; - } - - if( !scrollbar->isHidden()) - hScrollbar->resize( contentsRect().width()-SCRWIDTH, QApplication::style() - .scrollBarExtent().height()); - else - hScrollbar->resize( contentsRect().width(), QApplication::style() - .scrollBarExtent().height()); - - hScrollbar->move( 0, contentsRect().height() - SCRWIDTH); - - - if(useHorzScroll) { - hScrollbar->show(); - lines = ( (contentsRect().height() - SCRWIDTH) - 2 * rimY ) / font_h; - bY = ((contentsRect().height() - SCRWIDTH) - (lines *font_h)) / 2; - } else { - hScrollbar->hide(); - lines = (contentsRect().height() - 2 * rimY ) / font_h; - bY = (contentsRect().height() - (lines *font_h)) / 2; - } - */ //FIXME: support 'rounding' styles } void TEWidget::makeImage() //FIXME: rename 'calcGeometry? { calcGeometry(); image = (ca*) malloc(lines*columns*sizeof(ca)); clearImage(); } // calculate the needed size |