diff -ur kdebase-3.5.4/konsole/konsole/TECommon.h kdebase-3.5.4.new/konsole/konsole/TECommon.h --- kdebase-3.5.4/konsole/konsole/TECommon.h 2006-07-22 10:15:55.000000000 +0200 +++ kdebase-3.5.4.new/konsole/konsole/TECommon.h 2006-09-07 14:43:46.000000000 +0200 @@ -27,24 +27,6 @@ typedef unsigned short UINT16; #endif -// Color Table Elements /////////////////////////////////////////////// - -/*! -*/ -struct ColorEntry -{ - ColorEntry(QColor c, bool tr, bool b) : color(c), transparent(tr), bold(b) {} - ColorEntry() : transparent(false), bold(false) {} // default constructors - void operator=(const ColorEntry& rhs) { - color = rhs.color; - transparent = rhs.transparent; - bold = rhs.bold; - } - QColor color; - bool transparent; // if used on bg - bool bold; // if used on fg -}; - // Attributed Character Representations /////////////////////////////// // Colors @@ -64,115 +46,6 @@ #define RE_INTENSIVE (1 << 3) // Widget only #define RE_CURSOR (1 << 4) - -/* cacol is a union of the various color spaces. - - Assignment is as follows: - - Type - Space - Values - - 0 - Undefined - u: 0, v:0 w:0 - 1 - Default - u: 0..1 v:intense w:0 - 2 - System - u: 0..7 v:intense w:0 - 3 - Index(256) - u: 16..255 v:0 w:0 - 4 - RGB - u: 0..255 v:0..256 w:0..256 - - Default colour space has two separate colours, namely - default foreground and default background colour. -*/ - -#define CO_UND 0 -#define CO_DFT 1 -#define CO_SYS 2 -#define CO_256 3 -#define CO_RGB 4 - -class cacol -{ -public: - cacol(); - cacol(UINT8 space, int color); - UINT8 t; // color space indicator - UINT8 u; // various bytes representing the data in the respective ... - UINT8 v; // ... color space. C++ does not do unions, so we cannot ... - UINT8 w; // ... express ourselfs here, properly. - void toggleIntensive(); // Hack or helper? - QColor color(const ColorEntry* base) const; - friend bool operator == (cacol a, cacol b); - friend bool operator != (cacol a, cacol b); -}; - -#if 0 -inline cacol::cacol(UINT8 _t, UINT8 _u, UINT8 _v, UINT8 _w) -: t(_t), u(_u), v(_v), w(_w) -{ -} -#else -inline cacol::cacol(UINT8 ty, int co) -: t(ty), u(0), v(0), w(0) -{ - switch (t) - { - case CO_UND: break; - case CO_DFT: u = co& 1; break; - case CO_SYS: u = co& 7; v = (co>>3)&1; break; - case CO_256: u = co&255; break; - case CO_RGB: u = co>>16; v = co>>8; w = co; break; - default : t = 0; break; - } -} -#endif - -inline cacol::cacol() // undefined, really -: t(CO_UND), u(0), v(0), w(0) -{ -} - -inline bool operator == (cacol a, cacol b) -{ - return a.t == b.t && a.u == b.u && a.v == b.v && a.w == b.w; -} - -inline bool operator != (cacol a, cacol b) -{ - return a.t != b.t || a.u != b.u || a.v != b.v || a.w != b.w; -} - -inline const QColor color256(UINT8 u, const ColorEntry* base) -{ - // 0.. 16: system colors - if (u < 8) return base[u+2 ].color; u -= 8; - if (u < 8) return base[u+2+BASE_COLORS].color; u -= 8; - - // 16..231: 6x6x6 rgb color cube - if (u < 216) return QColor(255*((u/36)%6)/6, - 255*((u/ 6)%6)/6, - 255*((u/ 1)%6)/6); u -= 216; - - // 232..255: gray, leaving out black and white - int gray = u*10+8; return QColor(gray,gray,gray); -} - -inline QColor cacol::color(const ColorEntry* base) const -{ - switch (t) - { - case CO_DFT: return base[u+0+(v?BASE_COLORS:0)].color; - case CO_SYS: return base[u+2+(v?BASE_COLORS:0)].color; - case CO_256: return color256(u,base); - case CO_RGB: return QColor(u,v,w); - default : return QColor(255,0,0); // diagnostic catch all - } -} - -inline void cacol::toggleIntensive() -{ - if (t == CO_SYS || t == CO_DFT) - { - v = !v; - } -} - /*! \class ca * \brief a character with rendition attributes. */ @@ -181,28 +54,22 @@ { public: inline ca(UINT16 _c = ' ', - cacol _f = cacol(CO_DFT,DEFAULT_FORE_COLOR), - cacol _b = cacol(CO_DFT,DEFAULT_BACK_COLOR), - UINT8 _r = DEFAULT_RENDITION) - : c(_c), r(_r), f(_f), b(_b) {} + UINT8 _f = DEFAULT_FORE_COLOR, + UINT8 _b = DEFAULT_BACK_COLOR, + UINT8 _r = DEFAULT_RENDITION) + : c(_c), f(_f), b(_b), r(_r) {} public: UINT16 c; // character + UINT8 f; // foreground color + UINT8 b; // background color UINT8 r; // rendition - cacol f; // foreground color - cacol b; // background color -public: - //FIXME: following a hack to cope with various color spaces - // it brings the rendition pipeline further out of balance, - // which it was anyway as the result of various additions. - bool isTransparent(const ColorEntry* base) const; - bool isBold(const ColorEntry* base) const; public: friend bool operator == (ca a, ca b); friend bool operator != (ca a, ca b); }; inline bool operator == (ca a, ca b) -{ +{ return a.c == b.c && a.f == b.f && a.b == b.b && a.r == b.r; } @@ -211,16 +78,20 @@ return a.c != b.c || a.f != b.f || a.b != b.b || a.r != b.r; } -inline bool ca::isTransparent(const ColorEntry* base) const -{ - return (b.t == CO_DFT) && base[b.u+0+(b.v?BASE_COLORS:0)].transparent - || (b.t == CO_SYS) && base[b.u+2+(b.v?BASE_COLORS:0)].transparent; -} - -inline bool ca::isBold(const ColorEntry* base) const +/*! +*/ +struct ColorEntry { - return (b.t == CO_DFT) && base[b.u+0+(b.v?BASE_COLORS:0)].bold - || (b.t == CO_SYS) && base[b.u+2+(b.v?BASE_COLORS:0)].bold; -} + ColorEntry(QColor c, bool tr, bool b) : color(c), transparent(tr), bold(b) {} + ColorEntry() : transparent(false), bold(false) {} // default constructors + void operator=(const ColorEntry& rhs) { + color = rhs.color; + transparent = rhs.transparent; + bold = rhs.bold; + } + QColor color; + bool transparent; // if used on bg + bool bold; // if used on fg +}; #endif // TECOMMON_H diff -ur kdebase-3.5.4/konsole/konsole/TEScreen.cpp kdebase-3.5.4.new/konsole/konsole/TEScreen.cpp --- kdebase-3.5.4/konsole/konsole/TEScreen.cpp 2006-07-22 10:15:55.000000000 +0200 +++ kdebase-3.5.4.new/konsole/konsole/TEScreen.cpp 2006-09-07 14:43:46.000000000 +0200 @@ -67,15 +67,15 @@ histCursor(0), hist(new HistoryScrollNone()), cuX(0), cuY(0), - cu_fg(cacol()), cu_bg(cacol()), cu_re(0), + cu_fg(0), cu_bg(0), cu_re(0), tmargin(0), bmargin(0), tabstops(0), sel_begin(0), sel_TL(0), sel_BR(0), sel_busy(false), columnmode(false), - ef_fg(cacol()), ef_bg(cacol()), ef_re(0), + ef_fg(0), ef_bg(0), ef_re(0), sa_cuX(0), sa_cuY(0), - sa_cu_re(0), sa_cu_fg(cacol()), sa_cu_bg(cacol()), + sa_cu_re(0), sa_cu_fg(0), sa_cu_bg(0), lastPos(-1) { /* @@ -425,8 +425,8 @@ for (int x = 0; x < new_columns; x++) { newimg[y*new_columns+x].c = ' '; - newimg[y*new_columns+x].f = cacol(CO_DFT,DEFAULT_FORE_COLOR); - newimg[y*new_columns+x].b = cacol(CO_DFT,DEFAULT_BACK_COLOR); + newimg[y*new_columns+x].f = DEFAULT_FORE_COLOR; + newimg[y*new_columns+x].b = DEFAULT_BACK_COLOR; newimg[y*new_columns+x].r = DEFAULT_RENDITION; } newwrapped[y]=false; @@ -494,7 +494,7 @@ */ void TEScreen::reverseRendition(ca* p) -{ cacol f = p->f; cacol b = p->b; +{ UINT8 f = p->f; UINT8 b = p->b; p->f = b; p->b = f; //p->r &= ~RE_TRANSPARENT; } @@ -513,7 +513,12 @@ ef_bg = cu_bg; } if (cu_re & RE_BOLD) - ef_fg.toggleIntensive(); + { + if (ef_fg < BASE_COLORS) + ef_fg += BASE_COLORS; + else + ef_fg -= BASE_COLORS; + } } /*! @@ -535,7 +540,7 @@ int x,y; ca* merged = (ca*)malloc((lines*columns+1)*sizeof(ca)); - ca dft(' ',cacol(CO_DFT,DEFAULT_FORE_COLOR),cacol(CO_DFT,DEFAULT_BACK_COLOR),DEFAULT_RENDITION); + ca dft(' ',DEFAULT_FORE_COLOR,DEFAULT_BACK_COLOR,DEFAULT_RENDITION); merged[lines*columns] = dft; // kdDebug(1211) << "InGetCookedImage" << endl; @@ -1077,25 +1082,45 @@ void TEScreen::setDefaultRendition() { - setForeColor(CO_DFT,DEFAULT_FORE_COLOR); - setBackColor(CO_DFT,DEFAULT_BACK_COLOR); + setForeColorToDefault(); + setBackColorToDefault(); cu_re = DEFAULT_RENDITION; effectiveRendition(); } /*! */ -void TEScreen::setForeColor(int space, int color) + +void TEScreen::setForeColor(int fgcolor) { - cu_fg = cacol(space, color); + cu_fg = (fgcolor&7)+((fgcolor&8) ? 4+8 : 2); effectiveRendition(); } /*! */ -void TEScreen::setBackColor(int space, int color) + +void TEScreen::setBackColor(int bgcolor) +{ + cu_bg = (bgcolor&7)+((bgcolor&8) ? 4+8 : 2); + effectiveRendition(); +} + +/*! +*/ + +void TEScreen::setBackColorToDefault() +{ + cu_bg = DEFAULT_BACK_COLOR; + effectiveRendition(); +} + +/*! +*/ + +void TEScreen::setForeColorToDefault() { - cu_bg = cacol(space, color); + cu_fg = DEFAULT_FORE_COLOR; effectiveRendition(); } diff -ur kdebase-3.5.4/konsole/konsole/TEScreen.h kdebase-3.5.4.new/konsole/konsole/TEScreen.h --- kdebase-3.5.4/konsole/konsole/TEScreen.h 2006-07-22 10:15:55.000000000 +0200 +++ kdebase-3.5.4.new/konsole/konsole/TEScreen.h 2006-09-07 14:43:46.000000000 +0200 @@ -110,11 +110,12 @@ // void setRendition (int rendition); void resetRendition(int rendition); - // - void setForeColor (int space, int color); - void setBackColor (int space, int color); + void setForeColor (int fgcolor); + void setBackColor (int bgcolor); // void setDefaultRendition(); + void setForeColorToDefault(); + void setBackColorToDefault(); // // ------------------------------------- // @@ -217,8 +218,8 @@ // cursor color and rendition info - cacol cu_fg; // foreground - cacol cu_bg; // background + UINT8 cu_fg; // foreground + UINT8 cu_bg; // background UINT8 cu_re; // rendition // margins ---------------- @@ -244,8 +245,8 @@ // effective colors and rendition ------------ - cacol ef_fg; // These are derived from - cacol ef_bg; // the cu_* variables above + UINT8 ef_fg; // These are derived from + UINT8 ef_bg; // the cu_* variables above UINT8 ef_re; // to speed up operation // @@ -260,8 +261,8 @@ // rendition info UINT8 sa_cu_re; - cacol sa_cu_fg; - cacol sa_cu_bg; + UINT8 sa_cu_fg; + UINT8 sa_cu_bg; // last position where we added a character int lastPos; diff -ur kdebase-3.5.4/konsole/konsole/TEWidget.cpp kdebase-3.5.4.new/konsole/konsole/TEWidget.cpp --- kdebase-3.5.4/konsole/konsole/TEWidget.cpp 2006-07-22 10:15:55.000000000 +0200 +++ kdebase-3.5.4.new/konsole/konsole/TEWidget.cpp 2006-09-07 14:43:46.000000000 +0200 @@ -316,7 +316,7 @@ /* ------------------------------------------------------------------------- */ TEWidget::TEWidget(QWidget *parent, const char *name) -:QFrame(parent,name,WNoAutoErase) +:QFrame(parent,name) ,font_h(1) ,font_w(1) ,font_a(1) @@ -586,8 +586,7 @@ QString& str, const ca *attr, bool pm, bool clear) { int a = font_a + m_lineSpacing / 2; - QColor fColor = printerFriendly ? Qt::black : attr->f.color(color_table); - QColor bColor = attr->b.color(color_table); + QColor fColor = printerFriendly ? Qt::black : color_table[attr->f].color; QString drawstr; if ((attr->r & RE_CURSOR) && !isPrinting) @@ -596,7 +595,7 @@ // Paint background if (!printerFriendly) { - if (attr->isTransparent(color_table)) + if (color_table[attr->b].transparent) { if (pm) paint.setBackgroundMode( TransparentMode ); @@ -605,12 +604,12 @@ } else { - if (pm || clear || (blinking && (attr->r & RE_BLINK)) || - attr->b == cacol(CO_DFT, colorsSwapped ? DEFAULT_FORE_COLOR : DEFAULT_BACK_COLOR) ) + if (pm || color_table[attr->b].color != color_table[ colorsSwapped ? DEFAULT_FORE_COLOR : DEFAULT_BACK_COLOR ].color + || clear || (blinking && (attr->r & RE_BLINK))) // draw background colors with 75% opacity if ( argb_visual && qAlpha(blend_color) < 0xff ) { - QRgb col = bColor.rgb(); + QRgb col = color_table[attr->b].color.rgb(); Q_UINT8 salpha = 192; Q_UINT8 dalpha = 255 - salpha; @@ -626,7 +625,7 @@ paint.fillRect(rect, QColor(col, pixel)); } else - paint.fillRect(rect, bColor); + paint.fillRect(rect, color_table[attr->b].color); } QString tmpStr = str.simplifyWhiteSpace(); @@ -665,8 +664,8 @@ { if (!cursorBlinking) { - paint.fillRect(r, fColor); - fColor = bColor; + paint.fillRect(r, color_table[attr->f].color); + fColor = color_table[attr->b].color; } } else @@ -686,7 +685,7 @@ bool shadow = false; paint.setPen(fColor); int x = rect.x(); - if (attr->isBold(color_table) && printerBold) + if (color_table[attr->f].bold && printerBold) { // When printing we use a bold font for bold paint.save(); @@ -722,13 +721,13 @@ paint.drawText(x,y, str, -1, bidiEnabled ? QPainter::Auto : QPainter::LTR ); } - if (attr->isBold(color_table) && isPrinting) + if (color_table[attr->f].bold && isPrinting) { // When printing we use a bold font for bold paint.restore(); } - if (attr->isBold(color_table) && !printerBold) + if (color_table[attr->f].bold && !printerBold) { paint.setClipRect(rect); // On screen we use overstrike for bold @@ -797,9 +796,9 @@ int tLy = tL.y(); hasBlinker = false; - cacol cf; // undefined - cacol cb; // undefined - int cr = -1; // undefined + int cf = -1; // undefined + int cb = -1; // undefined + int cr = -1; // undefined int lins = QMIN(this->lines, QMAX(0,lines )); int cols = QMIN(this->columns,QMAX(0,columns)); @@ -983,48 +982,6 @@ paintContents(paint, rect, pm != 0); drawFrame( &paint ); - - // Since we're using WNoAutoErase, we have to make sure that - // every single pixel is painted by the paint event. - // To do this, we must figure out which pixels are left in the - // area between the terminal image and the frame border. - - // Calculate the contents rect excluding scroll bar. - QRect innerRect = contentsRect(); - if( scrollLoc != SCRNONE ) - innerRect.setWidth( innerRect.width() - scrollbar->width() ); - - innerRect.setWidth( innerRect.width() + 3 ); - innerRect.setHeight( innerRect.height() ); - - // Calculate the emulation rect (area needed for actual terminal contents) - QRect emurect( contentsRect().topLeft(), QSize( columns * font_w + 2 * rimX, lines * font_h + 2 * rimY )); - - // Now erase() the remaining pixels on all sides of the emulation - - // Top - QRect er( innerRect ); - er.setBottom( emurect.top() ); - erase( er ); - - // Bottom - er.setBottom( innerRect.bottom() ); - er.setTop( emurect.bottom() ); - erase( er ); - - // Left - er.setTop( emurect.top() ); - er.setBottom( emurect.bottom() - 1 ); - er.setRight( emurect.left() ); - erase( er ); - - // Right - er.setRight( innerRect.right() ); - er.setTop( emurect.top() ); - er.setBottom( emurect.bottom() - 1 ); - er.setLeft( emurect.right() ); - erase( er ); - paint.end(); setUpdatesEnabled(true); } @@ -1092,9 +1049,9 @@ disstrU[p++] = c; //fontMap(c); bool lineDraw = isLineChar(c); bool doubleWidth = (image[loc(x,y)+1].c == 0); - cacol cf = image[loc(x,y)].f; - cacol cb = image[loc(x,y)].b; - int cr = image[loc(x,y)].r; + int cf = image[loc(x,y)].f; + int cb = image[loc(x,y)].b; + int cr = image[loc(x,y)].r; while (x+len <= rlx && image[loc(x+len,y)].f == cf && image[loc(x+len,y)].b == cb && @@ -2052,10 +2009,10 @@ // We initialize image[image_size] too. See makeImage() for (int i = 0; i <= image_size; i++) { - image[i].c = ' '; - image[i].f = cacol(CO_DFT,DEFAULT_FORE_COLOR); - image[i].b = cacol(CO_DFT,DEFAULT_BACK_COLOR); - image[i].r = DEFAULT_RENDITION; + image[i].c = 0xff; //' '; + image[i].f = 0xff; //DEFAULT_FORE_COLOR; + image[i].b = 0xff; //DEFAULT_BACK_COLOR; + image[i].r = 0xff; //DEFAULT_RENDITION; } } diff -ur kdebase-3.5.4/konsole/konsole/TEmuVt102.cpp kdebase-3.5.4.new/konsole/konsole/TEmuVt102.cpp --- kdebase-3.5.4/konsole/konsole/TEmuVt102.cpp 2006-07-22 10:15:55.000000000 +0200 +++ kdebase-3.5.4.new/konsole/konsole/TEmuVt102.cpp 2006-09-07 14:43:46.000000000 +0200 @@ -344,17 +344,6 @@ for (i=0;i<=argc;i++) if ( epp( )) { tau( TY_CSI_PR(cc,argv[i]), 0, 0); } else if(egt( )) { tau( TY_CSI_PG(cc ), 0, 0); } // spec. case for ESC]>0c or ESC]>c - else if (cc == 'm' && argc - i >= 4 && (argv[i] == 38 || argv[i] == 48) && argv[i+1] == 2) - { // ESC[ ... 48;2;;; ... m -or- ESC[ ... 38;2;;; ... m - i += 2; - tau( TY_CSI_PS(cc, argv[i-2]), CO_RGB, (argv[i] << 16) | (argv[i+1] << 8) | argv[i+2]); - i += 2; - } - else if (cc == 'm' && argc - i >= 2 && (argv[i] == 38 || argv[i] == 48) && argv[i+1] == 5) - { // ESC[ ... 48;5; ... m -or- ESC[ ... 38;5; ... m - i += 2; - tau( TY_CSI_PS(cc, argv[i-2]), CO_256, argv[i]); - } else { tau( TY_CSI_PS(cc,argv[i]), 0, 0); } resetToken(); } @@ -554,49 +543,43 @@ case TY_CSI_PS('m', 25) : scr->resetRendition (RE_BLINK ); break; case TY_CSI_PS('m', 27) : scr->resetRendition (RE_REVERSE ); break; - case TY_CSI_PS('m', 30) : scr->setForeColor (CO_SYS, 0); break; - case TY_CSI_PS('m', 31) : scr->setForeColor (CO_SYS, 1); break; - case TY_CSI_PS('m', 32) : scr->setForeColor (CO_SYS, 2); break; - case TY_CSI_PS('m', 33) : scr->setForeColor (CO_SYS, 3); break; - case TY_CSI_PS('m', 34) : scr->setForeColor (CO_SYS, 4); break; - case TY_CSI_PS('m', 35) : scr->setForeColor (CO_SYS, 5); break; - case TY_CSI_PS('m', 36) : scr->setForeColor (CO_SYS, 6); break; - case TY_CSI_PS('m', 37) : scr->setForeColor (CO_SYS, 7); break; - - case TY_CSI_PS('m', 38) : scr->setForeColor (p, q); break; - - case TY_CSI_PS('m', 39) : scr->setForeColor (CO_DFT, 0); break; - - case TY_CSI_PS('m', 40) : scr->setBackColor (CO_SYS, 0); break; - case TY_CSI_PS('m', 41) : scr->setBackColor (CO_SYS, 1); break; - case TY_CSI_PS('m', 42) : scr->setBackColor (CO_SYS, 2); break; - case TY_CSI_PS('m', 43) : scr->setBackColor (CO_SYS, 3); break; - case TY_CSI_PS('m', 44) : scr->setBackColor (CO_SYS, 4); break; - case TY_CSI_PS('m', 45) : scr->setBackColor (CO_SYS, 5); break; - case TY_CSI_PS('m', 46) : scr->setBackColor (CO_SYS, 6); break; - case TY_CSI_PS('m', 47) : scr->setBackColor (CO_SYS, 7); break; - - case TY_CSI_PS('m', 48) : scr->setBackColor (p, q); break; - - case TY_CSI_PS('m', 49) : scr->setBackColor (CO_DFT, 1); break; - - case TY_CSI_PS('m', 90) : scr->setForeColor (CO_SYS, 8); break; - case TY_CSI_PS('m', 91) : scr->setForeColor (CO_SYS, 9); break; - case TY_CSI_PS('m', 92) : scr->setForeColor (CO_SYS, 10); break; - case TY_CSI_PS('m', 93) : scr->setForeColor (CO_SYS, 11); break; - case TY_CSI_PS('m', 94) : scr->setForeColor (CO_SYS, 12); break; - case TY_CSI_PS('m', 95) : scr->setForeColor (CO_SYS, 13); break; - case TY_CSI_PS('m', 96) : scr->setForeColor (CO_SYS, 14); break; - case TY_CSI_PS('m', 97) : scr->setForeColor (CO_SYS, 15); break; - - case TY_CSI_PS('m', 100) : scr->setBackColor (CO_SYS, 8); break; - case TY_CSI_PS('m', 101) : scr->setBackColor (CO_SYS, 9); break; - case TY_CSI_PS('m', 102) : scr->setBackColor (CO_SYS, 10); break; - case TY_CSI_PS('m', 103) : scr->setBackColor (CO_SYS, 11); break; - case TY_CSI_PS('m', 104) : scr->setBackColor (CO_SYS, 12); break; - case TY_CSI_PS('m', 105) : scr->setBackColor (CO_SYS, 13); break; - case TY_CSI_PS('m', 106) : scr->setBackColor (CO_SYS, 14); break; - case TY_CSI_PS('m', 107) : scr->setBackColor (CO_SYS, 15); break; + case TY_CSI_PS('m', 30) : scr->setForeColor ( 0); break; + case TY_CSI_PS('m', 31) : scr->setForeColor ( 1); break; + case TY_CSI_PS('m', 32) : scr->setForeColor ( 2); break; + case TY_CSI_PS('m', 33) : scr->setForeColor ( 3); break; + case TY_CSI_PS('m', 34) : scr->setForeColor ( 4); break; + case TY_CSI_PS('m', 35) : scr->setForeColor ( 5); break; + case TY_CSI_PS('m', 36) : scr->setForeColor ( 6); break; + case TY_CSI_PS('m', 37) : scr->setForeColor ( 7); break; + case TY_CSI_PS('m', 39) : scr->setForeColorToDefault( ); break; + + case TY_CSI_PS('m', 40) : scr->setBackColor ( 0); break; + case TY_CSI_PS('m', 41) : scr->setBackColor ( 1); break; + case TY_CSI_PS('m', 42) : scr->setBackColor ( 2); break; + case TY_CSI_PS('m', 43) : scr->setBackColor ( 3); break; + case TY_CSI_PS('m', 44) : scr->setBackColor ( 4); break; + case TY_CSI_PS('m', 45) : scr->setBackColor ( 5); break; + case TY_CSI_PS('m', 46) : scr->setBackColor ( 6); break; + case TY_CSI_PS('m', 47) : scr->setBackColor ( 7); break; + case TY_CSI_PS('m', 49) : scr->setBackColorToDefault( ); break; + + case TY_CSI_PS('m', 90) : scr->setForeColor ( 8); break; + case TY_CSI_PS('m', 91) : scr->setForeColor ( 9); break; + case TY_CSI_PS('m', 92) : scr->setForeColor ( 10); break; + case TY_CSI_PS('m', 93) : scr->setForeColor ( 11); break; + case TY_CSI_PS('m', 94) : scr->setForeColor ( 12); break; + case TY_CSI_PS('m', 95) : scr->setForeColor ( 13); break; + case TY_CSI_PS('m', 96) : scr->setForeColor ( 14); break; + case TY_CSI_PS('m', 97) : scr->setForeColor ( 15); break; + + case TY_CSI_PS('m', 100) : scr->setBackColor ( 8); break; + case TY_CSI_PS('m', 101) : scr->setBackColor ( 9); break; + case TY_CSI_PS('m', 102) : scr->setBackColor ( 10); break; + case TY_CSI_PS('m', 103) : scr->setBackColor ( 11); break; + case TY_CSI_PS('m', 104) : scr->setBackColor ( 12); break; + case TY_CSI_PS('m', 105) : scr->setBackColor ( 13); break; + case TY_CSI_PS('m', 106) : scr->setBackColor ( 14); break; + case TY_CSI_PS('m', 107) : scr->setBackColor ( 15); break; case TY_CSI_PS('n', 5) : reportStatus ( ); break; case TY_CSI_PS('n', 6) : reportCursorPosition ( ); break; diff -ur kdebase-3.5.4/konsole/konsole/konsole.cpp kdebase-3.5.4.new/konsole/konsole/konsole.cpp --- kdebase-3.5.4/konsole/konsole/konsole.cpp 2006-07-22 10:15:55.000000000 +0200 +++ kdebase-3.5.4.new/konsole/konsole/konsole.cpp 2006-09-07 14:43:46.000000000 +0200 @@ -1109,7 +1109,7 @@ // "Configure Shortcuts"). m_closeSession = new KAction(i18n("C&lose Session"), "fileclose", 0, this, - SLOT(confirmCloseCurrentSession()), m_shortcuts, "close_session"); + SLOT(closeCurrentSession()), m_shortcuts, "close_session"); m_print = new KAction(i18n("&Print Screen..."), "fileprint", 0, this, SLOT( slotPrint() ), m_shortcuts, "file_print"); m_quit = new KAction(i18n("&Quit"), "exit", 0, this, SLOT( close() ), m_shortcuts, "file_quit"); @@ -1340,7 +1340,7 @@ void Konsole::slotTabCloseSession() { - confirmCloseCurrentSession(m_contextMenuSession); + m_contextMenuSession->closeSession(); } void Konsole::slotTabbarContextMenu(const QPoint & pos) @@ -2975,15 +2975,13 @@ */ } -void Konsole::confirmCloseCurrentSession( TESession* _se ) +void Konsole::confirmCloseCurrentSession() { - if ( !_se ) - _se = se; if (KMessageBox::warningContinueCancel(this, i18n("Are you sure that you want to close the current session?"), i18n("Close Confirmation"), KGuiItem(i18n("C&lose Session"),"tab_remove"), "ConfirmCloseSession")==KMessageBox::Continue) - _se->closeSession(); + closeCurrentSession(); } void Konsole::closeCurrentSession() diff -ur kdebase-3.5.4/konsole/konsole/konsole.h kdebase-3.5.4.new/konsole/konsole/konsole.h --- kdebase-3.5.4/konsole/konsole/konsole.h 2006-07-22 10:15:55.000000000 +0200 +++ kdebase-3.5.4.new/konsole/konsole/konsole.h 2006-09-07 14:43:46.000000000 +0200 @@ -139,7 +139,7 @@ void activateSession(); void activateSession(TESession*); void closeCurrentSession(); - void confirmCloseCurrentSession(TESession* _se=0); + void confirmCloseCurrentSession(); void doneSession(TESession*); void slotCouldNotClose(); void toggleFullScreen(); diff -ur kdebase-3.5.4/konsole/konsole/konsole_part.cpp kdebase-3.5.4.new/konsole/konsole/konsole_part.cpp --- kdebase-3.5.4/konsole/konsole/konsole_part.cpp 2006-07-22 10:15:55.000000000 +0200 +++ kdebase-3.5.4.new/konsole/konsole/konsole_part.cpp 2006-09-07 14:43:46.000000000 +0200 @@ -1049,7 +1049,7 @@ void konsolePart::startProgram( const QString& program, const QStrList& args ) { -// kdDebug(1211) << "konsolePart::startProgram for " << program << endl; + kdDebug(1211) << "konsolePart::startProgram for " << program << endl; if ( !se ) newSession(); se->setProgram( program, args ); @@ -1090,6 +1090,7 @@ connect( se, SIGNAL( destroyed() ), this, SLOT( sessionDestroyed() ) ); // setFont( n_font ); // we do this here, to make TEWidget recalculate // its geometry.. + te->emitText( QString::fromLatin1( "\014" ) ); } void konsolePart::showShellInDir( const QString& dir ) diff -ur kdebase-3.5.4/konsole/konsole/kwrited.h kdebase-3.5.4.new/konsole/konsole/kwrited.h --- kdebase-3.5.4/konsole/konsole/kwrited.h 2006-07-22 10:15:55.000000000 +0200 +++ kdebase-3.5.4.new/konsole/konsole/kwrited.h 2006-09-07 14:43:46.000000000 +0200 @@ -19,6 +19,7 @@ void block_in(int fd); void clearText(void); private: + QTextEdit* wid; KPty* pty; }; diff -ur kdebase-3.5.4/konsole/konsole/session.cpp kdebase-3.5.4.new/konsole/konsole/session.cpp --- kdebase-3.5.4/konsole/konsole/session.cpp 2006-07-22 10:15:55.000000000 +0200 +++ kdebase-3.5.4.new/konsole/konsole/session.cpp 2006-09-07 14:43:46.000000000 +0200 @@ -764,20 +764,6 @@ emit setSessionSchema(this, schema); } -QString TESession::font() -{ - return te->getVTFont().toString(); -} - -void TESession::setFont(const QString &font) -{ - QFont tmp; - if (tmp.fromString(font)) - te->setVTFont(tmp); - else - kdWarning()<<"unknown font: "<codec()->name(); diff -ur kdebase-3.5.4/konsole/konsole/session.h kdebase-3.5.4.new/konsole/konsole/session.h --- kdebase-3.5.4/konsole/konsole/session.h 2006-07-22 10:15:55.000000000 +0200 +++ kdebase-3.5.4.new/konsole/konsole/session.h 2006-09-07 14:43:46.000000000 +0200 @@ -113,8 +113,6 @@ void setKeytab(const QString &keytab); QSize size(); void setSize(QSize size); - void setFont(const QString &font); - QString font(); public slots: diff -ur kdebase-3.5.4/konsole/konsole/sessioniface.h kdebase-3.5.4.new/konsole/konsole/sessioniface.h --- kdebase-3.5.4/konsole/konsole/sessioniface.h 2006-07-22 10:15:55.000000000 +0200 +++ kdebase-3.5.4.new/konsole/konsole/sessioniface.h 2006-09-07 14:43:46.000000000 +0200 @@ -24,8 +24,6 @@ virtual void setKeytab(const QString &keyboard) =0; virtual QSize size() =0; virtual void setSize(QSize size) =0; - virtual QString font() =0; - virtual void setFont(const QString &font) =0; }; #endif // SESSIONIFACE_H