summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/TEWidget.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/TEWidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/TEWidget.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/TEWidget.cpp b/noncore/apps/opie-console/TEWidget.cpp
index f3f462f..e4415dc 100644
--- a/noncore/apps/opie-console/TEWidget.cpp
+++ b/noncore/apps/opie-console/TEWidget.cpp
@@ -74,48 +74,73 @@
74 74
75 75
76 76
77// #include "TEWidget.moc" 77// #include "TEWidget.moc"
78//#include <kapp.h> 78//#include <kapp.h>
79//#include <kcursor.h> 79//#include <kcursor.h>
80//#include <kurl.h> 80//#include <kurl.h>
81//#include <kdebug.h> 81//#include <kdebug.h>
82//#include <klocale.h> 82//#include <klocale.h>
83 83
84#define HERE printf("%s(%d): %s\n",__FILE__,__LINE__,__FUNCTION__) 84#define HERE printf("%s(%d): %s\n",__FILE__,__LINE__,__FUNCTION__)
85#define HCNT(Name) // { static int cnt = 1; printf("%s(%d): %s %d\n",__FILE__,__LINE__,Name,cnt++); } 85#define HCNT(Name) // { static int cnt = 1; printf("%s(%d): %s %d\n",__FILE__,__LINE__,Name,cnt++); }
86 86
87#define loc(X,Y) ((Y)*columns+(X)) 87#define loc(X,Y) ((Y)*columns+(X))
88 88
89//FIXME: the rim should normally be 1, 0 only when running in full screen mode. 89//FIXME: the rim should normally be 1, 0 only when running in full screen mode.
90#define rimX 0 // left/right rim width 90#define rimX 0 // left/right rim width
91#define rimY 0 // top/bottom rim high 91#define rimY 0 // top/bottom rim high
92 92
93#define SCRWIDTH 16 // width of the scrollbar 93#define SCRWIDTH 16 // width of the scrollbar
94 94
95#define yMouseScroll 1 95#define yMouseScroll 1
96// scroll increment used when dragging selection at top/bottom of window. 96// scroll increment used when dragging selection at top/bottom of window.
97 97
98/* Button XPM */
99namespace {
100static char * menu_xpm[] = {
101"12 12 5 1",
102 " c None",
103 ".c #000000",
104 "+c #FFFDAD",
105 "@c #FFFF00",
106 "#c #E5E100",
107" ",
108" ",
109" ......... ",
110" .+++++++. ",
111" .+@@@@#. ",
112" .+@@@#. ",
113" .+@@#. ",
114" .+@#. ",
115" .+#. ",
116" .+. ",
117" .. ",
118" "};
119
120}
121
122
98/* ------------------------------------------------------------------------- */ 123/* ------------------------------------------------------------------------- */
99/* */ 124/* */
100/* Colors */ 125/* Colors */
101/* */ 126/* */
102/* ------------------------------------------------------------------------- */ 127/* ------------------------------------------------------------------------- */
103 128
104//FIXME: the default color table is in session.C now. 129//FIXME: the default color table is in session.C now.
105// We need a way to get rid of this one, here. 130// We need a way to get rid of this one, here.
106static const ColorEntry base_color_table[TABLE_COLORS] = 131static const ColorEntry base_color_table[TABLE_COLORS] =
107// The following are almost IBM standard color codes, with some slight 132// The following are almost IBM standard color codes, with some slight
108// gamma correction for the dim colors to compensate for bright X screens. 133// gamma correction for the dim colors to compensate for bright X screens.
109// It contains the 8 ansiterm/xterm colors in 2 intensities. 134// It contains the 8 ansiterm/xterm colors in 2 intensities.
110{ 135{
111 // Fixme: could add faint colors here, also. 136 // Fixme: could add faint colors here, also.
112 // normal 137 // normal
113 ColorEntry(QColor(0x00,0x00,0x00), 0, 0 ), ColorEntry( QColor(0xB2,0xB2,0xB2), 1, 0 ), // Dfore, Dback 138 ColorEntry(QColor(0x00,0x00,0x00), 0, 0 ), ColorEntry( QColor(0xB2,0xB2,0xB2), 1, 0 ), // Dfore, Dback
114 ColorEntry(QColor(0x00,0x00,0x00), 0, 0 ), ColorEntry( QColor(0xB2,0x18,0x18), 0, 0 ), // Black, Red 139 ColorEntry(QColor(0x00,0x00,0x00), 0, 0 ), ColorEntry( QColor(0xB2,0x18,0x18), 0, 0 ), // Black, Red
115 ColorEntry(QColor(0x18,0xB2,0x18), 0, 0 ), ColorEntry( QColor(0xB2,0x68,0x18), 0, 0 ), // Green, Yellow 140 ColorEntry(QColor(0x18,0xB2,0x18), 0, 0 ), ColorEntry( QColor(0xB2,0x68,0x18), 0, 0 ), // Green, Yellow
116 ColorEntry(QColor(0x18,0x18,0xB2), 0, 0 ), ColorEntry( QColor(0xB2,0x18,0xB2), 0, 0 ), // Blue, Magenta 141 ColorEntry(QColor(0x18,0x18,0xB2), 0, 0 ), ColorEntry( QColor(0xB2,0x18,0xB2), 0, 0 ), // Blue, Magenta
117 ColorEntry(QColor(0x18,0xB2,0xB2), 0, 0 ), ColorEntry( QColor(0xB2,0xB2,0xB2), 0, 0 ), // Cyan, White 142 ColorEntry(QColor(0x18,0xB2,0xB2), 0, 0 ), ColorEntry( QColor(0xB2,0xB2,0xB2), 0, 0 ), // Cyan, White
118 // intensiv 143 // intensiv
119 ColorEntry(QColor(0x00,0x00,0x00), 0, 1 ), ColorEntry( QColor(0xFF,0xFF,0xFF), 1, 0 ), 144 ColorEntry(QColor(0x00,0x00,0x00), 0, 1 ), ColorEntry( QColor(0xFF,0xFF,0xFF), 1, 0 ),
120 ColorEntry(QColor(0x68,0x68,0x68), 0, 0 ), ColorEntry( QColor(0xFF,0x54,0x54), 0, 0 ), 145 ColorEntry(QColor(0x68,0x68,0x68), 0, 0 ), ColorEntry( QColor(0xFF,0x54,0x54), 0, 0 ),
121 ColorEntry(QColor(0x54,0xFF,0x54), 0, 0 ), ColorEntry( QColor(0xFF,0xFF,0x54), 0, 0 ), 146 ColorEntry(QColor(0x54,0xFF,0x54), 0, 0 ), ColorEntry( QColor(0xFF,0xFF,0x54), 0, 0 ),
@@ -1220,49 +1245,49 @@ void TEWidget::dropEvent(QDropEvent* event)
1220 1245
1221 if (bPopup) 1246 if (bPopup)
1222 // m_drop->popup(pos() + event->pos()); 1247 // m_drop->popup(pos() + event->pos());
1223 m_drop->popup(mapToGlobal(event->pos())); 1248 m_drop->popup(mapToGlobal(event->pos()));
1224 else 1249 else
1225 { 1250 {
1226 if (currentSession) { 1251 if (currentSession) {
1227 currentSession->getEmulation()->sendString(dropText.local8Bit()); 1252 currentSession->getEmulation()->sendString(dropText.local8Bit());
1228 } 1253 }
1229// kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; 1254// kdDebug() << "Drop:" << dropText.local8Bit() << "\n";
1230 } 1255 }
1231 } 1256 }
1232 } 1257 }
1233 else if(QTextDrag::decode(event, dropText)) { 1258 else if(QTextDrag::decode(event, dropText)) {
1234// kdDebug() << "Drop:" << dropText.local8Bit() << "\n"; 1259// kdDebug() << "Drop:" << dropText.local8Bit() << "\n";
1235 if (currentSession) { 1260 if (currentSession) {
1236 currentSession->getEmulation()->sendString(dropText.local8Bit()); 1261 currentSession->getEmulation()->sendString(dropText.local8Bit());
1237 } 1262 }
1238 // Paste it 1263 // Paste it
1239 } 1264 }
1240} 1265}
1241#endif 1266#endif
1242 1267
1243 1268
1244void TEWidget::drop_menu_activated(int item) 1269void TEWidget::drop_menu_activated(int)
1245{ 1270{
1246#ifndef QT_NO_DRAGANDDROP 1271#ifndef QT_NO_DRAGANDDROP
1247 switch (item) 1272 switch (item)
1248 { 1273 {
1249 case 0: // paste 1274 case 0: // paste
1250 currentSession->getEmulation()->sendString(dropText.local8Bit()); 1275 currentSession->getEmulation()->sendString(dropText.local8Bit());
1251// KWM::activate((Window)this->winId()); 1276// KWM::activate((Window)this->winId());
1252 break; 1277 break;
1253 case 1: // cd ... 1278 case 1: // cd ...
1254 currentSession->getEmulation()->sendString("cd "); 1279 currentSession->getEmulation()->sendString("cd ");
1255 struct stat statbuf; 1280 struct stat statbuf;
1256 if ( ::stat( QFile::encodeName( dropText ), &statbuf ) == 0 ) 1281 if ( ::stat( QFile::encodeName( dropText ), &statbuf ) == 0 )
1257 { 1282 {
1258 if ( !S_ISDIR(statbuf.st_mode) ) 1283 if ( !S_ISDIR(statbuf.st_mode) )
1259 { 1284 {
1260/* 1285/*
1261 KURL url; 1286 KURL url;
1262 url.setPath( dropText ); 1287 url.setPath( dropText );
1263 dropText = url.directory( true, false ); // remove filename 1288 dropText = url.directory( true, false ); // remove filename
1264*/ 1289*/
1265 } 1290 }
1266 } 1291 }
1267 dropText.replace(QRegExp(" "), "\\ "); // escape spaces 1292 dropText.replace(QRegExp(" "), "\\ "); // escape spaces
1268 currentSession->getEmulation()->sendString(dropText.local8Bit()); 1293 currentSession->getEmulation()->sendString(dropText.local8Bit());