summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/TEWidget.cpp
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/TEWidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEWidget.cpp98
1 files changed, 51 insertions, 47 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp
index dc83998..f10bfb2 100644
--- a/core/apps/embeddedkonsole/TEWidget.cpp
+++ b/core/apps/embeddedkonsole/TEWidget.cpp
@@ -11,9 +11,8 @@
11/* ------------------------------------------------------------------------ */ 11/* ------------------------------------------------------------------------ */
12 /* */ 12/* */
13/* Ported Konsole to Qt/Embedded */ 13/* Ported Konsole to Qt/Embedded */
14 /* */ 14/* */
15/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ 15/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
16 /* */ 16/* */
17/* -------------------------------------------------------------------------- */ 17/* -------------------------------------------------------------------------- */
18
19/*! \class TEWidget 18/*! \class TEWidget
@@ -117,3 +116,3 @@ static const ColorEntry base_color_table[TABLE_COLORS] =
117 ColorEntry(QColor(0x54,0xFF,0x54), 0, 0 ), ColorEntry( QColor(0xFF,0xFF,0x54), 0, 0 ), 116 ColorEntry(QColor(0x54,0xFF,0x54), 0, 0 ), ColorEntry( QColor(0xFF,0xFF,0x54), 0, 0 ),
118 ColorEntry(QColor(0x54,0x54,0xFF), 0, 0 ), ColorEntry( QColor(0xFF,0x54,0xFF), 0, 0 ), 117 ColorEntry(QColor(0x54,0x54,0xFF), 0, 0 ), ColorEntry( QColor(0xB2,0x18,0xB2), 0, 0 ),
119 ColorEntry(QColor(0x54,0xFF,0xFF), 0, 0 ), ColorEntry( QColor(0xFF,0xFF,0xFF), 0, 0 ) 118 ColorEntry(QColor(0x54,0xFF,0xFF), 0, 0 ), ColorEntry( QColor(0xFF,0xFF,0xFF), 0, 0 )
@@ -139,2 +138,8 @@ const ColorEntry* TEWidget::getColorTable() const
139 138
139const ColorEntry* TEWidget::getdefaultColorTable() const
140{
141 return base_color_table;
142}
143
144
140const QPixmap *TEWidget::backgroundPixmap() 145const QPixmap *TEWidget::backgroundPixmap()
@@ -242,3 +247,3 @@ void TEWidget::fontChange(const QFont &)
242#if QT_VERSION < 300 247#if QT_VERSION < 300
243 strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") 248 strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646")
244 ? vt100extended 249 ? vt100extended
@@ -246,3 +251,3 @@ void TEWidget::fontChange(const QFont &)
246#endif 251#endif
247 identicalMap; 252 identicalMap;
248 propagateSize(); 253 propagateSize();
@@ -256,4 +261,3 @@ void TEWidget::setVTFont(const QFont& f)
256 261
257QFont TEWidget::getVTFont() 262QFont TEWidget::getVTFont() {
258{
259 return font(); 263 return font();
@@ -649,3 +653,3 @@ void TEWidget::mousePressEvent(QMouseEvent* ev)
649 actSel = 1; // left mouse button pressed but nothing selected yet. 653 actSel = 1; // left mouse button pressed but nothing selected yet.
650 grabMouse( /*crossCursor*/ ); // handle with care! 654 grabMouse( /*crossCursor*/ ); // handle with care!
651 } 655 }
@@ -715,5 +719,5 @@ void TEWidget::mouseMoveEvent(QMouseEvent* ev)
715 bool left_not_right = ( here.y() < iPntSel.y() || 719 bool left_not_right = ( here.y() < iPntSel.y() ||
716 here.y() == iPntSel.y() && here.x() < iPntSel.x() ); 720 here.y() == iPntSel.y() && here.x() < iPntSel.x() );
717 bool old_left_not_right = ( pntSel.y() < iPntSel.y() || 721 bool old_left_not_right = ( pntSel.y() < iPntSel.y() ||
718 pntSel.y() == iPntSel.y() && pntSel.x() < iPntSel.x() ); 722 pntSel.y() == iPntSel.y() && pntSel.x() < iPntSel.x() );
719 swapping = left_not_right != old_left_not_right; 723 swapping = left_not_right != old_left_not_right;
@@ -977,30 +981,30 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e )
977 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { 981 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) {
978 QKeyEvent* ke = (QKeyEvent*)e; 982 QKeyEvent* ke = (QKeyEvent*)e;
979 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); 983 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat();
980 switch (ke->key()) { 984 switch (ke->key()) {
981 case Key_F9: // let this be "Control" 985 case Key_F9: // let this be "Control"
982 control = keydown; 986 control = keydown;
983 e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); 987 e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state());
984 dele=TRUE; 988 dele=TRUE;
985 break; 989 break;
986 case Key_F13: // let this be "Alt" 990 case Key_F13: // let this be "Alt"
987 alt = keydown; 991 alt = keydown;
988 e = new QKeyEvent(QEvent::KeyPress, Key_Alt, 0, ke->state()); 992 e = new QKeyEvent(QEvent::KeyPress, Key_Alt, 0, ke->state());
989 dele=TRUE; 993 dele=TRUE;
990 break; 994 break;
991 default: 995 default:
992 if ( control ) { 996 if ( control ) {
993 int a = toupper(ke->ascii())-64; 997 int a = toupper(ke->ascii())-64;
994 if ( a >= 0 && a < ' ' ) { 998 if ( a >= 0 && a < ' ' ) {
995 e = new QKeyEvent(e->type(), ke->key(), 999 e = new QKeyEvent(e->type(), ke->key(),
996 a, ke->state()|ControlButton, QChar(a,0)); 1000 a, ke->state()|ControlButton, QChar(a,0));
997 dele=TRUE; 1001 dele=TRUE;
998 } 1002 }
999 } 1003 }
1000 if ( alt ) { 1004 if ( alt ) {
1001 e = new QKeyEvent(e->type(), ke->key(), 1005 e = new QKeyEvent(e->type(), ke->key(),
1002 ke->ascii(), ke->state()|AltButton, ke->text()); 1006 ke->ascii(), ke->state()|AltButton, ke->text());
1003 dele=TRUE; 1007 dele=TRUE;
1004 } 1008 }
1005 } 1009 }
1006 } 1010 }
@@ -1190,10 +1194,10 @@ void TEWidget::dropEvent(QDropEvent* event)
1190 // m_drop->popup(pos() + event->pos()); 1194 // m_drop->popup(pos() + event->pos());
1191 m_drop->popup(mapToGlobal(event->pos())); 1195 m_drop->popup(mapToGlobal(event->pos()));
1192 else 1196 else
1193 { 1197 {
1194 if (currentSession) { 1198 if (currentSession) {
1195 currentSession->getEmulation()->sendString(dropText.local8Bit()); 1199 currentSession->getEmulation()->sendString(dropText.local8Bit());
1196 } 1200 }
1197 // kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; 1201// kdDebug() << "Drop:" << dropText.local8Bit() << "\n";
1198 } 1202 }
1199 } 1203 }