summaryrefslogtreecommitdiff
authorsudonix <sudonix>2004-02-14 20:48:48 (UTC)
committer sudonix <sudonix>2004-02-14 20:48:48 (UTC)
commitb922593f1261a972752c825ba4f6c158aa7cc720 (patch) (unidiff)
tree90ab16a6472d2f3e118d95def2f5decd46595578
parent9a9c6a2c813347a2a1f83333314b2fd07f34828a (diff)
downloadopie-b922593f1261a972752c825ba4f6c158aa7cc720.zip
opie-b922593f1261a972752c825ba4f6c158aa7cc720.tar.gz
opie-b922593f1261a972752c825ba4f6c158aa7cc720.tar.bz2
A small typo corrected(found while translating)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/comm/keypebble/krfbdecoder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/comm/keypebble/krfbdecoder.cpp b/noncore/comm/keypebble/krfbdecoder.cpp
index dc90d9c..c43aed5 100644
--- a/noncore/comm/keypebble/krfbdecoder.cpp
+++ b/noncore/comm/keypebble/krfbdecoder.cpp
@@ -50,193 +50,193 @@ static CARD8 UpdateRequestId = 3;
50static CARD8 KeyEventId = 4; 50static CARD8 KeyEventId = 4;
51static CARD8 PointerEventId = 5; 51static CARD8 PointerEventId = 5;
52static CARD8 ClientCutTextId = 6; 52static CARD8 ClientCutTextId = 6;
53 53
54// 54//
55// Server -> Client Message Identifiers 55// Server -> Client Message Identifiers
56// 56//
57static CARD8 UpdateId = 0; 57static CARD8 UpdateId = 0;
58static CARD8 BellId = 2; 58static CARD8 BellId = 2;
59static CARD8 ServerCutId = 3; 59static CARD8 ServerCutId = 3;
60 60
61// 61//
62// Encoding identifiers 62// Encoding identifiers
63// 63//
64static CARD32 RawEncoding = Swap32IfLE( 0 ); 64static CARD32 RawEncoding = Swap32IfLE( 0 );
65static CARD32 CopyRectEncoding = Swap32IfLE(1 ); 65static CARD32 CopyRectEncoding = Swap32IfLE(1 );
66static CARD32 RreEncoding = Swap32IfLE( 2 ); 66static CARD32 RreEncoding = Swap32IfLE( 2 );
67static CARD32 CorreEncoding = Swap32IfLE( 4 ); 67static CARD32 CorreEncoding = Swap32IfLE( 4 );
68static CARD32 HexTileEncoding = Swap32IfLE( 5 ); 68static CARD32 HexTileEncoding = Swap32IfLE( 5 );
69 69
70static struct { 70static struct {
71 int keysym; 71 int keysym;
72 int keycode; 72 int keycode;
73} keyMap[] = { 73} keyMap[] = {
74 { 0xff08, Qt::Key_Backspace }, 74 { 0xff08, Qt::Key_Backspace },
75 { 0xff09, Qt::Key_Tab }, 75 { 0xff09, Qt::Key_Tab },
76 { 0xff0d, Qt::Key_Return }, 76 { 0xff0d, Qt::Key_Return },
77 { 0xff1b, Qt::Key_Escape }, 77 { 0xff1b, Qt::Key_Escape },
78 { 0xff63, Qt::Key_Insert }, 78 { 0xff63, Qt::Key_Insert },
79 { 0xffff, Qt::Key_Delete }, 79 { 0xffff, Qt::Key_Delete },
80 { 0xff50, Qt::Key_Home }, 80 { 0xff50, Qt::Key_Home },
81 { 0xff57, Qt::Key_End }, 81 { 0xff57, Qt::Key_End },
82 { 0xff55, Qt::Key_Prior }, 82 { 0xff55, Qt::Key_Prior },
83 { 0xff56, Qt::Key_Next }, 83 { 0xff56, Qt::Key_Next },
84 { 0xff51, Qt::Key_Left }, 84 { 0xff51, Qt::Key_Left },
85 { 0xff52, Qt::Key_Up }, 85 { 0xff52, Qt::Key_Up },
86 { 0xff53, Qt::Key_Right }, 86 { 0xff53, Qt::Key_Right },
87 { 0xff54, Qt::Key_Down }, 87 { 0xff54, Qt::Key_Down },
88 { 0xffbe, Qt::Key_F1 }, 88 { 0xffbe, Qt::Key_F1 },
89 { 0xffbf, Qt::Key_F2 }, 89 { 0xffbf, Qt::Key_F2 },
90 { 0xffc0, Qt::Key_F3 }, 90 { 0xffc0, Qt::Key_F3 },
91 { 0xffc1, Qt::Key_F4 }, 91 { 0xffc1, Qt::Key_F4 },
92 { 0xffc2, Qt::Key_F5 }, 92 { 0xffc2, Qt::Key_F5 },
93 { 0xffc3, Qt::Key_F6 }, 93 { 0xffc3, Qt::Key_F6 },
94 { 0xffc4, Qt::Key_F7 }, 94 { 0xffc4, Qt::Key_F7 },
95 { 0xffc5, Qt::Key_F8 }, 95 { 0xffc5, Qt::Key_F8 },
96 { 0xffc6, Qt::Key_F9 }, 96 { 0xffc6, Qt::Key_F9 },
97 { 0xffc7, Qt::Key_F10 }, 97 { 0xffc7, Qt::Key_F10 },
98 { 0xffc8, Qt::Key_F11 }, 98 { 0xffc8, Qt::Key_F11 },
99 { 0xffc9, Qt::Key_F12 }, 99 { 0xffc9, Qt::Key_F12 },
100 { 0xffe1, Qt::Key_Shift }, 100 { 0xffe1, Qt::Key_Shift },
101 { 0xffe2, Qt::Key_Shift }, 101 { 0xffe2, Qt::Key_Shift },
102 { 0xffe3, Qt::Key_Control }, 102 { 0xffe3, Qt::Key_Control },
103 { 0xffe4, Qt::Key_Control }, 103 { 0xffe4, Qt::Key_Control },
104 { 0xffe7, Qt::Key_Meta }, 104 { 0xffe7, Qt::Key_Meta },
105 { 0xffe8, Qt::Key_Meta }, 105 { 0xffe8, Qt::Key_Meta },
106 { 0xffe9, Qt::Key_Alt }, 106 { 0xffe9, Qt::Key_Alt },
107 { 0xffea, Qt::Key_Alt }, 107 { 0xffea, Qt::Key_Alt },
108 { 0, 0 } 108 { 0, 0 }
109}; 109};
110 110
111 111
112KRFBDecoder::KRFBDecoder( KRFBConnection *con ) 112KRFBDecoder::KRFBDecoder( KRFBConnection *con )
113 : QObject( con, "RFB Decoder" ) 113 : QObject( con, "RFB Decoder" )
114{ 114{
115 assert( con ); 115 assert( con );
116 assert( con->state() == KRFBConnection::Connected ); 116 assert( con->state() == KRFBConnection::Connected );
117 117
118 this->con = con; 118 this->con = con;
119 this->buf = 0; 119 this->buf = 0;
120 this->info = 0; 120 this->info = 0;
121 this->format = 0; 121 this->format = 0;
122 this->buttonMask = 0; 122 this->buttonMask = 0;
123 currentState = Idle; 123 currentState = Idle;
124} 124}
125 125
126KRFBDecoder::~KRFBDecoder() 126KRFBDecoder::~KRFBDecoder()
127{ 127{
128 if ( info ) 128 if ( info )
129 delete info; 129 delete info;
130 if ( format ) 130 if ( format )
131 delete format; 131 delete format;
132} 132}
133 133
134void KRFBDecoder::start() 134void KRFBDecoder::start()
135{ 135{
136 sendClientInit(); 136 sendClientInit();
137} 137}
138 138
139void KRFBDecoder::sendClientInit() 139void KRFBDecoder::sendClientInit()
140{ 140{
141 con->write( &( con->options()->shared ), 1 ); 141 con->write( &( con->options()->shared ), 1 );
142 142
143 // Wait for server init 143 // Wait for server init
144 qWarning( "Waiting for server init" ); 144 qWarning( "Waiting for server init" );
145 145
146 static QString statusMsg = tr( "Waiting for server initialisation..." ); 146 static QString statusMsg = tr( "Waiting for server initialization..." );
147 emit status( statusMsg ); 147 emit status( statusMsg );
148 148
149 currentState = AwaitingServerInit; 149 currentState = AwaitingServerInit;
150 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerInit() ) ); 150 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerInit() ) );
151 con->waitForData( ServerInitLength ); 151 con->waitForData( ServerInitLength );
152} 152}
153 153
154void KRFBDecoder::gotServerInit() 154void KRFBDecoder::gotServerInit()
155{ 155{
156 qWarning( "Got server init" ); 156 qWarning( "Got server init" );
157 disconnect( con, SIGNAL( gotEnoughData() ), this, SLOT( gotServerInit() ) ); 157 disconnect( con, SIGNAL( gotEnoughData() ), this, SLOT( gotServerInit() ) );
158 158
159 if ( info ) 159 if ( info )
160 delete info; 160 delete info;
161 info = new KRFBServerInfo; 161 info = new KRFBServerInfo;
162 CHECK_PTR( info ); 162 CHECK_PTR( info );
163 163
164 con->read( &(info->width), 2 ); 164 con->read( &(info->width), 2 );
165 info->width = Swap16IfLE( info->width ); 165 info->width = Swap16IfLE( info->width );
166 con->read( &info->height, 2 ); 166 con->read( &info->height, 2 );
167 info->height = Swap16IfLE( info->height ); 167 info->height = Swap16IfLE( info->height );
168 168
169 con->read( &(info->bpp), 1 ); 169 con->read( &(info->bpp), 1 );
170 con->read( &(info->depth), 1 ); 170 con->read( &(info->depth), 1 );
171 con->read( &(info->bigEndian), 1 ); 171 con->read( &(info->bigEndian), 1 );
172 con->read( &(info->trueColor), 1 ); 172 con->read( &(info->trueColor), 1 );
173 173
174 con->read( &(info->redMax), 2 ); 174 con->read( &(info->redMax), 2 );
175 info->redMax = Swap16IfLE( info->redMax ); 175 info->redMax = Swap16IfLE( info->redMax );
176 con->read( &(info->greenMax), 2 ); 176 con->read( &(info->greenMax), 2 );
177 info->greenMax = Swap16IfLE( info->greenMax ); 177 info->greenMax = Swap16IfLE( info->greenMax );
178 con->read( &(info->blueMax), 2 ); 178 con->read( &(info->blueMax), 2 );
179 info->blueMax = Swap16IfLE( info->blueMax ); 179 info->blueMax = Swap16IfLE( info->blueMax );
180 180
181 con->read( &(info->redShift), 1 ); 181 con->read( &(info->redShift), 1 );
182 con->read( &(info->greenShift), 1 ); 182 con->read( &(info->greenShift), 1 );
183 con->read( &(info->blueShift), 1 ); 183 con->read( &(info->blueShift), 1 );
184 184
185 con->read( info->padding, 3 ); 185 con->read( info->padding, 3 );
186 186
187 con->read( &(info->nameLength), 4 ); 187 con->read( &(info->nameLength), 4 );
188 info->nameLength = Swap32IfLE( info->nameLength ); 188 info->nameLength = Swap32IfLE( info->nameLength );
189 189
190 qWarning( "Width = %d, Height = %d", info->width, info->height ); 190 qWarning( "Width = %d, Height = %d", info->width, info->height );
191 qWarning( "Bpp = %d, Depth = %d, Big = %d, True = %d", 191 qWarning( "Bpp = %d, Depth = %d, Big = %d, True = %d",
192 info->bpp, info->depth, info->bigEndian, info->trueColor ); 192 info->bpp, info->depth, info->bigEndian, info->trueColor );
193 qWarning( "RedMax = %d, GreenMax = %d, BlueMax = %d", 193 qWarning( "RedMax = %d, GreenMax = %d, BlueMax = %d",
194 info->redMax, info->greenMax, info->blueMax ); 194 info->redMax, info->greenMax, info->blueMax );
195 qWarning( "RedShift = %d, GreenShift = %d, BlueShift = %d", 195 qWarning( "RedShift = %d, GreenShift = %d, BlueShift = %d",
196 info->redShift, info->greenShift,info-> blueShift ); 196 info->redShift, info->greenShift,info-> blueShift );
197 197
198 buf->resize( info->width/con->options()->scaleFactor, info->height /con->options()->scaleFactor); 198 buf->resize( info->width/con->options()->scaleFactor, info->height /con->options()->scaleFactor);
199 199
200 // Wait for desktop name 200 // Wait for desktop name
201 qWarning( "Waiting for desktop name" ); 201 qWarning( "Waiting for desktop name" );
202 202
203 static QString statusMsg = tr( "Waiting for desktop name..." ); 203 static QString statusMsg = tr( "Waiting for desktop name..." );
204 emit status( statusMsg ); 204 emit status( statusMsg );
205 205
206 currentState = AwaitingDesktopName; 206 currentState = AwaitingDesktopName;
207 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotDesktopName() ) ); 207 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotDesktopName() ) );
208 con->waitForData( info->nameLength ); 208 con->waitForData( info->nameLength );
209} 209}
210 210
211void KRFBDecoder::gotDesktopName() 211void KRFBDecoder::gotDesktopName()
212{ 212{
213 assert( info ); 213 assert( info );
214 assert( currentState == AwaitingDesktopName ); 214 assert( currentState == AwaitingDesktopName );
215 215
216 qWarning( "Got desktop name" ); 216 qWarning( "Got desktop name" );
217 217
218 disconnect( con, SIGNAL( gotEnoughData() ), 218 disconnect( con, SIGNAL( gotEnoughData() ),
219 this, SLOT( gotDesktopName() ) ); 219 this, SLOT( gotDesktopName() ) );
220 220
221 char *buf = new char[ info->nameLength + 1 ]; 221 char *buf = new char[ info->nameLength + 1 ];
222 CHECK_PTR( buf ); 222 CHECK_PTR( buf );
223 223
224 con->read( buf, info->nameLength ); 224 con->read( buf, info->nameLength );
225 buf[ info->nameLength ] = '\0'; 225 buf[ info->nameLength ] = '\0';
226 info->name = buf; 226 info->name = buf;
227 227
228 qWarning( "Desktop: %s", info->name.latin1() ); 228 qWarning( "Desktop: %s", info->name.latin1() );
229 229
230 delete buf; 230 delete buf;
231 231
232 // Get the format we'll really use and tell the server 232 // Get the format we'll really use and tell the server
233 decidePixelFormat(); 233 decidePixelFormat();
234 sendPixelFormat(); 234 sendPixelFormat();
235 sendAllowedEncodings(); 235 sendAllowedEncodings();
236 currentState = Idle; 236 currentState = Idle;
237 237
238 QString msg; 238 QString msg;
239 msg = tr( "Connected to %1" ); 239 msg = tr( "Connected to %1" );
240 msg = msg.arg( info->name ); 240 msg = msg.arg( info->name );
241 emit status( msg ); 241 emit status( msg );
242 242