summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/comm/keypebble/keypebble.pro8
-rw-r--r--noncore/comm/keypebble/krfbdecoder.cpp7
-rw-r--r--noncore/comm/keypebble/kvnc.cpp18
-rw-r--r--noncore/comm/keypebble/kvnc.h7
-rw-r--r--noncore/comm/keypebble/main.cpp11
5 files changed, 25 insertions, 26 deletions
diff --git a/noncore/comm/keypebble/keypebble.pro b/noncore/comm/keypebble/keypebble.pro
index 7af60f9..b3cb172 100644
--- a/noncore/comm/keypebble/keypebble.pro
+++ b/noncore/comm/keypebble/keypebble.pro
@@ -1,15 +1,13 @@
1TEMPLATE = app 1CONFIG += qt warn_on release quick-app
2CONFIG += qt warn_on release
3DESTDIR = $(OPIEDIR)/bin
4 HEADERS = d3des.h \ 2 HEADERS = d3des.h \
5 krfbbuffer.h \ 3 krfbbuffer.h \
6 krfbcanvas.h \ 4 krfbcanvas.h \
7 krfbconnection.h \ 5 krfbconnection.h \
8 krfbdecoder.h \ 6 krfbdecoder.h \
9 krfblogin.h \ 7 krfblogin.h \
10 krfbserver.h \ 8 krfbserver.h \
11 krfbserverinfo.h \ 9 krfbserverinfo.h \
12 kvnc.h \ 10 kvnc.h \
13 kvncconndlg.h \ 11 kvncconndlg.h \
14 kvncbookmarkdlg.h \ 12 kvncbookmarkdlg.h \
15 vncauth.h 13 vncauth.h
@@ -18,29 +16,31 @@ SOURCES = d3des.c \
18 krfbbuffer.cpp \ 16 krfbbuffer.cpp \
19 krfbcanvas.cpp \ 17 krfbcanvas.cpp \
20 krfbconnection.cpp \ 18 krfbconnection.cpp \
21 krfbdecoder.cpp \ 19 krfbdecoder.cpp \
22 krfblogin.cpp \ 20 krfblogin.cpp \
23 krfbserver.cpp \ 21 krfbserver.cpp \
24 kvnc.cpp \ 22 kvnc.cpp \
25 kvncconndlg.cpp \ 23 kvncconndlg.cpp \
26 kvncbookmarkdlg.cpp \ 24 kvncbookmarkdlg.cpp \
27 main.cpp 25 main.cpp
28 INTERFACES= kvncconndlgbase.ui \ 26 INTERFACES= kvncconndlgbase.ui \
29 kvncbookmarkdlgbase.ui 27 kvncbookmarkdlgbase.ui
30TARGET = keypebble 28
31INCLUDEPATH += $(OPIEDIR)/include 29INCLUDEPATH += $(OPIEDIR)/include
32DEPENDPATH += $(OPIEDIR)/include 30DEPENDPATH += $(OPIEDIR)/include
33LIBS += -lqpe 31LIBS += -lqpe
34 32
33 TARGET = keypebble
34
35TRANSLATIONS = ../../../i18n/de/keypebble.ts \ 35TRANSLATIONS = ../../../i18n/de/keypebble.ts \
36 ../../../i18n/nl/keypebble.ts \ 36 ../../../i18n/nl/keypebble.ts \
37 ../../../i18n/da/keypebble.ts \ 37 ../../../i18n/da/keypebble.ts \
38 ../../../i18n/xx/keypebble.ts \ 38 ../../../i18n/xx/keypebble.ts \
39 ../../../i18n/en/keypebble.ts \ 39 ../../../i18n/en/keypebble.ts \
40 ../../../i18n/es/keypebble.ts \ 40 ../../../i18n/es/keypebble.ts \
41 ../../../i18n/fr/keypebble.ts \ 41 ../../../i18n/fr/keypebble.ts \
42 ../../../i18n/hu/keypebble.ts \ 42 ../../../i18n/hu/keypebble.ts \
43 ../../../i18n/ja/keypebble.ts \ 43 ../../../i18n/ja/keypebble.ts \
44 ../../../i18n/ko/keypebble.ts \ 44 ../../../i18n/ko/keypebble.ts \
45 ../../../i18n/no/keypebble.ts \ 45 ../../../i18n/no/keypebble.ts \
46 ../../../i18n/pl/keypebble.ts \ 46 ../../../i18n/pl/keypebble.ts \
diff --git a/noncore/comm/keypebble/krfbdecoder.cpp b/noncore/comm/keypebble/krfbdecoder.cpp
index 33418ae..dc90d9c 100644
--- a/noncore/comm/keypebble/krfbdecoder.cpp
+++ b/noncore/comm/keypebble/krfbdecoder.cpp
@@ -325,25 +325,25 @@ void KRFBDecoder::sendPixelFormat()
325 con->write( &(format->redShift), 1 ); 325 con->write( &(format->redShift), 1 );
326 con->write( &(format->greenShift), 1 ); 326 con->write( &(format->greenShift), 1 );
327 con->write( &(format->blueShift), 1 ); 327 con->write( &(format->blueShift), 1 );
328 con->write( format->padding, 3 ); // Padding 328 con->write( format->padding, 3 ); // Padding
329} 329}
330 330
331void KRFBDecoder::sendAllowedEncodings() 331void KRFBDecoder::sendAllowedEncodings()
332{ 332{
333 static CARD8 padding[1]; 333 static CARD8 padding[1];
334 con->write( &SetEncodingsId, 1 ); 334 con->write( &SetEncodingsId, 1 );
335 con->write( padding, 1 ); 335 con->write( padding, 1 );
336 336
337 static CARD16 noEncodings = con->options()->encodings(); 337 CARD16 noEncodings = con->options()->encodings();
338 noEncodings = Swap16IfLE( noEncodings ); 338 noEncodings = Swap16IfLE( noEncodings );
339 con->write( &noEncodings, 2 ); 339 con->write( &noEncodings, 2 );
340 340
341 if ( con->options()->corre ) 341 if ( con->options()->corre )
342 con->write( &CorreEncoding, 4 ); 342 con->write( &CorreEncoding, 4 );
343 if ( con->options()->hexTile ) 343 if ( con->options()->hexTile )
344 con->write( &HexTileEncoding, 4 ); 344 con->write( &HexTileEncoding, 4 );
345 if ( con->options()->rre ) 345 if ( con->options()->rre )
346 con->write( &RreEncoding, 4 ); 346 con->write( &RreEncoding, 4 );
347 if ( con->options()->copyrect ) 347 if ( con->options()->copyrect )
348 con->write( &CopyRectEncoding, 4 ); 348 con->write( &CopyRectEncoding, 4 );
349 // We always support this 349 // We always support this
@@ -550,26 +550,29 @@ void KRFBDecoder::gotRawRectChunk()
550 handleRawRect(); 550 handleRawRect();
551 } 551 }
552 else { 552 else {
553 noRects--; 553 noRects--;
554 554
555 // qWarning( "There are %d rects left", noRects ); 555 // qWarning( "There are %d rects left", noRects );
556 556
557 if ( noRects ) { 557 if ( noRects ) {
558 currentState = AwaitingRectHeader; 558 currentState = AwaitingRectHeader;
559 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRectHeader() ) ); 559 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRectHeader() ) );
560 con->waitForData( RectHeaderLength ); 560 con->waitForData( RectHeaderLength );
561 } 561 }
562 else 562 else {
563 // we are now ready for the next update - no need to wait for the timer
563 currentState = Idle; 564 currentState = Idle;
565 sendUpdateRequest (1);
566 }
564 } 567 }
565} 568}
566 569
567// 570//
568// Copy Rectangle Encoding 571// Copy Rectangle Encoding
569// 572//
570 573
571void KRFBDecoder::handleCopyRect() 574void KRFBDecoder::handleCopyRect()
572{ 575{
573 currentState = AwaitingCopyRectPos; 576 currentState = AwaitingCopyRectPos;
574 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotCopyRectPos() ) ); 577 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotCopyRectPos() ) );
575 con->waitForData( CopyRectPosLength ); 578 con->waitForData( CopyRectPosLength );
diff --git a/noncore/comm/keypebble/kvnc.cpp b/noncore/comm/keypebble/kvnc.cpp
index 48a442c..c89dec5 100644
--- a/noncore/comm/keypebble/kvnc.cpp
+++ b/noncore/comm/keypebble/kvnc.cpp
@@ -18,26 +18,26 @@
18#include <qpe/qpetoolbar.h> 18#include <qpe/qpetoolbar.h>
19#include <qpe/resource.h> 19#include <qpe/resource.h>
20 20
21#include <assert.h> 21#include <assert.h>
22 22
23#include "kvnc.h" 23#include "kvnc.h"
24#include "krfbcanvas.h" 24#include "krfbcanvas.h"
25#include "krfbconnection.h" 25#include "krfbconnection.h"
26#include "kvncconndlg.h" 26#include "kvncconndlg.h"
27#include "krfbserver.h" 27#include "krfbserver.h"
28 28
29static int u_id = 1; 29static int u_id = 1;
30static int get_unique_id() 30static int get_unique_id()
31{ 31{
32 return u_id++; 32 return u_id++;
33} 33}
34 34
35 35
36/* XPM */ 36/* XPM */
37static char * menu_xpm[] = { 37static char * menu_xpm[] = {
38"12 12 5 1", 38"12 12 5 1",
39 " c None", 39 " c None",
40 ".c #000000", 40 ".c #000000",
41 "+c #FFFDAD", 41 "+c #FFFDAD",
42 "@c #FFFF00", 42 "@c #FFFF00",
43 "#c #E5E100", 43 "#c #E5E100",
@@ -47,35 +47,35 @@ static char * menu_xpm[] = {
47" .+++++++. ", 47" .+++++++. ",
48" .+@@@@#. ", 48" .+@@@@#. ",
49" .+@@@#. ", 49" .+@@@#. ",
50" .+@@#. ", 50" .+@@#. ",
51" .+@#. ", 51" .+@#. ",
52" .+#. ", 52" .+#. ",
53" .+. ", 53" .+. ",
54" .. ", 54" .. ",
55" "}; 55" "};
56 56
57const int StatusTextId = 0; 57const int StatusTextId = 0;
58 58
59KVNC::KVNC( const char *name ) : QMainWindow( 0, name ,WStyle_ContextHelp) 59KVNC::KVNC( QWidget *parent, const char *name, WFlags f) : QMainWindow( 0, name ,WStyle_ContextHelp)
60{ 60{
61 setCaption( tr("VNC Viewer") ); 61 setCaption( tr("VNC Viewer") );
62 fullscreen = false; 62 fullscreen = false;
63 63
64 stack = new QWidgetStack( this ); 64 stack = new QWidgetStack( this );
65 setCentralWidget( stack ); 65 setCentralWidget( stack );
66 66
67 bookmarkSelector=new KVNCBookmarkDlg(); 67 bookmarkSelector=new KVNCBookmarkDlg();
68 stack->addWidget(bookmarkSelector,get_unique_id()); 68 stack->addWidget(bookmarkSelector,get_unique_id());
69 stack->raiseWidget( bookmarkSelector ); 69 stack->raiseWidget( bookmarkSelector );
70 70
71 canvas = new KRFBCanvas( stack, "canvas" ); 71 canvas = new KRFBCanvas( stack, "canvas" );
72 stack->addWidget(canvas,get_unique_id()); 72 stack->addWidget(canvas,get_unique_id());
73 setCentralWidget( stack ); 73 setCentralWidget( stack );
74 74
75 75
76 connect( bookmarkSelector->bookmarkList, SIGNAL(clicked(QListBoxItem *)), 76 connect( bookmarkSelector->bookmarkList, SIGNAL(clicked(QListBoxItem *)),
77 this, SLOT(openConnection(QListBoxItem *)) ); 77 this, SLOT(openConnection(QListBoxItem *)) );
78 connect( canvas->connection(), SIGNAL(statusChanged(const QString &)), 78 connect( canvas->connection(), SIGNAL(statusChanged(const QString &)),
79 this, SLOT(statusMessage(const QString &)) ); 79 this, SLOT(statusMessage(const QString &)) );
80 connect( canvas->connection(), SIGNAL(error(const QString &)), 80 connect( canvas->connection(), SIGNAL(error(const QString &)),
81 this, SLOT(error(const QString &)) ); 81 this, SLOT(error(const QString &)) );
@@ -94,25 +94,25 @@ KVNC::KVNC( const char *name ) : QMainWindow( 0, name ,WStyle_ContextHelp)
94 94
95 95
96 bar= new QToolBar( this ); 96 bar= new QToolBar( this );
97 setToolBarsMovable( false ); 97 setToolBarsMovable( false );
98 setRightJustification(false); 98 setRightJustification(false);
99 99
100 100
101 QAction *n = new QAction( tr( "New Connection" ), Resource::loadPixmap( "new" ), 101 QAction *n = new QAction( tr( "New Connection" ), Resource::loadPixmap( "new" ),
102 QString::null, 0, this, 0 ); 102 QString::null, 0, this, 0 );
103 connect( n, SIGNAL( activated() ), 103 connect( n, SIGNAL( activated() ),
104 this, SLOT( newConnection() ) ); 104 this, SLOT( newConnection() ) );
105 n->addTo( bar ); 105 n->addTo( bar );
106 106
107 QAction *o = new QAction( tr( "Open Bookmark" ), Resource::loadPixmap( "fileopen" ), 107 QAction *o = new QAction( tr( "Open Bookmark" ), Resource::loadPixmap( "fileopen" ),
108 QString::null, 0, this, 0 ); 108 QString::null, 0, this, 0 );
109 connect( o, SIGNAL( activated() ), 109 connect( o, SIGNAL( activated() ),
110 this, SLOT( openConnection() ) ); 110 this, SLOT( openConnection() ) );
111 o->addTo( bar ); 111 o->addTo( bar );
112 112
113 QAction *d = new QAction( tr( "Delete Bookmark" ), Resource::loadPixmap( "trash" ), 113 QAction *d = new QAction( tr( "Delete Bookmark" ), Resource::loadPixmap( "trash" ),
114 QString::null, 0, this, 0 ); 114 QString::null, 0, this, 0 );
115 connect( d, SIGNAL( activated() ), 115 connect( d, SIGNAL( activated() ),
116 this, SLOT( deleteBookmark() ) ); 116 this, SLOT( deleteBookmark() ) );
117 d->addTo( bar ); 117 d->addTo( bar );
118} 118}
@@ -211,29 +211,29 @@ void KVNC::toggleFullScreen()
211 stack->show(); 211 stack->show();
212 fullScreenAction->setText( tr("Full Screen") ); 212 fullScreenAction->setText( tr("Full Screen") );
213 } else { 213 } else {
214 canvas->setFrameStyle( QFrame::NoFrame ); 214 canvas->setFrameStyle( QFrame::NoFrame );
215 stack->removeWidget(canvas); 215 stack->removeWidget(canvas);
216 canvas->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop, 216 canvas->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop,
217 QPoint(0,0),false); 217 QPoint(0,0),false);
218 canvas->resize(qApp->desktop()->width(), qApp->desktop()->height()); 218 canvas->resize(qApp->desktop()->width(), qApp->desktop()->height());
219 canvas->raise(); 219 canvas->raise();
220 canvas->setFocus(); 220 canvas->setFocus();
221 canvas->grabKeyboard(); 221 canvas->grabKeyboard();
222 canvas->show(); 222 canvas->show();
223 223
224 fullScreenAction->setText( tr("Stop Full Screen") ); 224 fullScreenAction->setText( tr("Stop Full Screen") );
225 } 225 }
226 226
227 227
228 fullscreen = !fullscreen; 228 fullscreen = !fullscreen;
229} 229}
230 230
231void KVNC::closeConnection() 231void KVNC::closeConnection()
232{ 232{
233 if ( fullscreen ) 233 if ( fullscreen )
234 toggleFullScreen(); 234 toggleFullScreen();
235 canvas->closeConnection(); 235 canvas->closeConnection();
236} 236}
237 237
238void KVNC::showMenu() 238void KVNC::showMenu()
239{ 239{
@@ -257,25 +257,25 @@ void KVNC::connected()
257 bar->hide(); 257 bar->hide();
258} 258}
259 259
260void KVNC::loggedIn() 260void KVNC::loggedIn()
261{ 261{
262 static QString msg = tr( "Logged in to remote host" ); 262 static QString msg = tr( "Logged in to remote host" );
263 statusMessage( msg ); 263 statusMessage( msg );
264} 264}
265 265
266void KVNC::disconnected() 266void KVNC::disconnected()
267{ 267{
268 268
269 if ( fullscreen ) 269 if ( fullscreen )
270 toggleFullScreen(); 270 toggleFullScreen();
271 static QString msg = tr( "Connection closed" ); 271 static QString msg = tr( "Connection closed" );
272 statusMessage( msg ); 272 statusMessage( msg );
273 ctlAltDelAction->setEnabled(false); 273 ctlAltDelAction->setEnabled(false);
274 disconnectAction->setEnabled( false ); 274 disconnectAction->setEnabled( false );
275 fullScreenAction->setEnabled( false ); 275 fullScreenAction->setEnabled( false );
276 doubleClickAction->setEnabled( false ); 276 doubleClickAction->setEnabled( false );
277 rightClickAction->setEnabled( false ); 277 rightClickAction->setEnabled( false );
278 stack->raiseWidget(bookmarkSelector); 278 stack->raiseWidget(bookmarkSelector);
279 bar->show(); 279 bar->show();
280} 280}
281 281
diff --git a/noncore/comm/keypebble/kvnc.h b/noncore/comm/keypebble/kvnc.h
index 51c7151..7b7cc91 100644
--- a/noncore/comm/keypebble/kvnc.h
+++ b/noncore/comm/keypebble/kvnc.h
@@ -13,36 +13,37 @@ class KRFBCanvas;
13class QPushButton; 13class QPushButton;
14class QToolBar; 14class QToolBar;
15 15
16/** 16/**
17 * Top level window for Keystone. 17 * Top level window for Keystone.
18 * 18 *
19 * @author Richard Moore, rich@kde.org 19 * @author Richard Moore, rich@kde.org
20 * @version $Id$ 20 * @version $Id$
21 */ 21 */
22class KVNC : public QMainWindow 22class KVNC : public QMainWindow
23{ 23{
24 Q_OBJECT 24 Q_OBJECT
25public: 25public:
26 KVNC( const char *name = 0 ); 26 KVNC( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
27 ~KVNC(); 27 ~KVNC();
28 28
29public slots: 29public slots:
30 void newConnection(); 30 void newConnection();
31 void deleteBookmark(); 31 void deleteBookmark();
32 void openConnection(QListBoxItem *); 32 void openConnection(QListBoxItem *);
33 void openConnection(QString); 33 void openConnection(QString);
34 void openConnection(void); 34 void openConnection(void);
35 void toggleFullScreen(); 35 void toggleFullScreen();
36 void closeConnection(); 36 void closeConnection();
37 static QString appName() { return QString::fromLatin1("keypebble"); }
37 38
38protected: 39protected:
39 void setupActions(); 40 void setupActions();
40 41
41protected slots: 42protected slots:
42 void showMenu(); 43 void showMenu();
43 44
44 void connected(); 45 void connected();
45 void loggedIn(); 46 void loggedIn();
46 void disconnected(); 47 void disconnected();
47 void statusMessage( const QString & ); 48 void statusMessage( const QString & );
48 void error( const QString & ); 49 void error( const QString & );
diff --git a/noncore/comm/keypebble/main.cpp b/noncore/comm/keypebble/main.cpp
index bc7782c..11f67fc 100644
--- a/noncore/comm/keypebble/main.cpp
+++ b/noncore/comm/keypebble/main.cpp
@@ -1,15 +1,10 @@
1 1
2 2
3#include <qurl.h> 3
4#include <qpe/qpeapplication.h> 4#include <qpe/qpeapplication.h>
5#include "kvnc.h" 5#include "kvnc.h"
6#include <opie/oapplicationfactory.h>
6 7
7int main( int argc, char **argv )
8{
9 QPEApplication app( argc, argv );
10 KVNC *view = new KVNC( "Keypebble" );
11 app.showMainWidget( view );
12 8
13 return app.exec();
14}
15 9
10OPIE_EXPORT_APP( OApplicationFactory<KVNC> )