author | chicken <chicken> | 2004-03-01 20:00:34 (UTC) |
---|---|---|
committer | chicken <chicken> | 2004-03-01 20:00:34 (UTC) |
commit | 6bab4a28785c4ab5b0f0707c8c8db953e399cac8 (patch) (unidiff) | |
tree | 126dd6c09cc82b3d41ea70410803daac5cde5b60 /noncore/comm/keypebble | |
parent | 4ffae5ecb25f6d640c69f53f02755b6ec58d4c98 (diff) | |
download | opie-6bab4a28785c4ab5b0f0707c8c8db953e399cac8.zip opie-6bab4a28785c4ab5b0f0707c8c8db953e399cac8.tar.gz opie-6bab4a28785c4ab5b0f0707c8c8db953e399cac8.tar.bz2 |
fix includes
-rw-r--r-- | noncore/comm/keypebble/krfbbuffer.cpp | 3 | ||||
-rw-r--r-- | noncore/comm/keypebble/krfbcanvas.cpp | 9 | ||||
-rw-r--r-- | noncore/comm/keypebble/krfbconnection.cpp | 1 | ||||
-rw-r--r-- | noncore/comm/keypebble/krfbdecoder.cpp | 6 | ||||
-rw-r--r-- | noncore/comm/keypebble/krfblogin.cpp | 1 | ||||
-rw-r--r-- | noncore/comm/keypebble/krfbserver.cpp | 1 | ||||
-rw-r--r-- | noncore/comm/keypebble/kvnc.cpp | 13 | ||||
-rw-r--r-- | noncore/comm/keypebble/kvncbookmarkdlg.cpp | 14 | ||||
-rw-r--r-- | noncore/comm/keypebble/kvncconndlg.cpp | 8 | ||||
-rw-r--r-- | noncore/comm/keypebble/main.cpp | 1 |
10 files changed, 0 insertions, 57 deletions
diff --git a/noncore/comm/keypebble/krfbbuffer.cpp b/noncore/comm/keypebble/krfbbuffer.cpp index f1cb929..92918d4 100644 --- a/noncore/comm/keypebble/krfbbuffer.cpp +++ b/noncore/comm/keypebble/krfbbuffer.cpp | |||
@@ -1,58 +1,55 @@ | |||
1 | #include <assert.h> | 1 | #include <assert.h> |
2 | #include <qpixmap.h> | ||
3 | #include <qbrush.h> | ||
4 | #include <qimage.h> | 2 | #include <qimage.h> |
5 | #include <qpainter.h> | 3 | #include <qpainter.h> |
6 | #include <qapplication.h> | 4 | #include <qapplication.h> |
7 | #include "krfbdecoder.h" | 5 | #include "krfbdecoder.h" |
8 | #include "krfbbuffer.h" | 6 | #include "krfbbuffer.h" |
9 | #include "krfbconnection.h" | 7 | #include "krfbconnection.h" |
10 | #include "krfbserver.h" | ||
11 | #include "krfbserverinfo.h" | 8 | #include "krfbserverinfo.h" |
12 | 9 | ||
13 | // | 10 | // |
14 | // Endian stuff | 11 | // Endian stuff |
15 | // | 12 | // |
16 | #ifndef KDE_USE_FINAL | 13 | #ifndef KDE_USE_FINAL |
17 | const int endianTest = 1; | 14 | const int endianTest = 1; |
18 | #endif | 15 | #endif |
19 | 16 | ||
20 | #define Swap16IfLE(s) \ | 17 | #define Swap16IfLE(s) \ |
21 | (*(char *)&endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s)) | 18 | (*(char *)&endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s)) |
22 | 19 | ||
23 | #define Swap32IfLE(l) \ | 20 | #define Swap32IfLE(l) \ |
24 | (*(char *)&endianTest ? ((((l) & 0xff000000) >> 24) | \ | 21 | (*(char *)&endianTest ? ((((l) & 0xff000000) >> 24) | \ |
25 | (((l) & 0x00ff0000) >> 8) | \ | 22 | (((l) & 0x00ff0000) >> 8) | \ |
26 | (((l) & 0x0000ff00) << 8) | \ | 23 | (((l) & 0x0000ff00) << 8) | \ |
27 | (((l) & 0x000000ff) << 24)) : (l)) | 24 | (((l) & 0x000000ff) << 24)) : (l)) |
28 | 25 | ||
29 | KRFBBuffer::KRFBBuffer( KRFBDecoder *decoder, | 26 | KRFBBuffer::KRFBBuffer( KRFBDecoder *decoder, |
30 | QObject *parent, const char *name ) | 27 | QObject *parent, const char *name ) |
31 | : QObject( parent, name ) | 28 | : QObject( parent, name ) |
32 | { | 29 | { |
33 | assert( decoder ); | 30 | assert( decoder ); |
34 | this->decoder = decoder; | 31 | this->decoder = decoder; |
35 | pix = new QPixmap(); | 32 | pix = new QPixmap(); |
36 | } | 33 | } |
37 | 34 | ||
38 | KRFBBuffer::~KRFBBuffer() | 35 | KRFBBuffer::~KRFBBuffer() |
39 | { | 36 | { |
40 | delete pix; | 37 | delete pix; |
41 | } | 38 | } |
42 | 39 | ||
43 | void KRFBBuffer::resize( int w, int h ) | 40 | void KRFBBuffer::resize( int w, int h ) |
44 | { | 41 | { |
45 | qWarning( "Resizing buffer" ); | 42 | qWarning( "Resizing buffer" ); |
46 | 43 | ||
47 | pix->resize( w, h ); | 44 | pix->resize( w, h ); |
48 | 45 | ||
49 | QPalette pal = qApp->palette(); | 46 | QPalette pal = qApp->palette(); |
50 | pix->fill( pal.active().base() ); | 47 | pix->fill( pal.active().base() ); |
51 | 48 | ||
52 | emit sizeChanged( w, h ); | 49 | emit sizeChanged( w, h ); |
53 | } | 50 | } |
54 | 51 | ||
55 | void KRFBBuffer::soundBell() | 52 | void KRFBBuffer::soundBell() |
56 | { | 53 | { |
57 | emit bell(); | 54 | emit bell(); |
58 | } | 55 | } |
diff --git a/noncore/comm/keypebble/krfbcanvas.cpp b/noncore/comm/keypebble/krfbcanvas.cpp index bc71c90..75cba68 100644 --- a/noncore/comm/keypebble/krfbcanvas.cpp +++ b/noncore/comm/keypebble/krfbcanvas.cpp | |||
@@ -1,64 +1,55 @@ | |||
1 | #include "krfbconnection.h" | 1 | #include "krfbconnection.h" |
2 | #include "krfbcanvas.h" | 2 | #include "krfbcanvas.h" |
3 | #include "krfbserver.h" | ||
4 | #include "krfbbuffer.h" | 3 | #include "krfbbuffer.h" |
5 | 4 | ||
6 | #include <qpe/config.h> | ||
7 | #include <qpe/qpeapplication.h> | 5 | #include <qpe/qpeapplication.h> |
8 | 6 | ||
9 | #include <qapplication.h> | ||
10 | #include <qclipboard.h> | 7 | #include <qclipboard.h> |
11 | #include <qaction.h> | ||
12 | #include <qpixmap.h> | ||
13 | #include <qpoint.h> | ||
14 | #include <qapplication.h> | ||
15 | #include <qmainwindow.h> | ||
16 | #include <qiconset.h> | ||
17 | 8 | ||
18 | KRFBCanvas::KRFBCanvas( QWidget *parent, const char *name ) | 9 | KRFBCanvas::KRFBCanvas( QWidget *parent, const char *name ) |
19 | : QScrollView( parent, name ) | 10 | : QScrollView( parent, name ) |
20 | { | 11 | { |
21 | connection_ = new KRFBConnection(); | 12 | connection_ = new KRFBConnection(); |
22 | connect( connection_, SIGNAL( loggedIn() ), | 13 | connect( connection_, SIGNAL( loggedIn() ), |
23 | this, SLOT( loggedIn() ) ); | 14 | this, SLOT( loggedIn() ) ); |
24 | 15 | ||
25 | loggedIn_ = false; | 16 | loggedIn_ = false; |
26 | 17 | ||
27 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold); | 18 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold); |
28 | 19 | ||
29 | viewport()->setFocusPolicy( QWidget::StrongFocus ); | 20 | viewport()->setFocusPolicy( QWidget::StrongFocus ); |
30 | viewport()->setFocus(); | 21 | viewport()->setFocus(); |
31 | 22 | ||
32 | nextRightClick=0; | 23 | nextRightClick=0; |
33 | nextDoubleClick=0; | 24 | nextDoubleClick=0; |
34 | } | 25 | } |
35 | 26 | ||
36 | KRFBCanvas::~KRFBCanvas() | 27 | KRFBCanvas::~KRFBCanvas() |
37 | { | 28 | { |
38 | } | 29 | } |
39 | 30 | ||
40 | 31 | ||
41 | void KRFBCanvas::openConnection(KRFBServer server) | 32 | void KRFBCanvas::openConnection(KRFBServer server) |
42 | { | 33 | { |
43 | 34 | ||
44 | 35 | ||
45 | QCString host = server.hostname.latin1(); | 36 | QCString host = server.hostname.latin1(); |
46 | password=server.password; | 37 | password=server.password; |
47 | connection_->connectTo( server); | 38 | connection_->connectTo( server); |
48 | } | 39 | } |
49 | 40 | ||
50 | 41 | ||
51 | void KRFBCanvas::openURL( const QUrl &url ) | 42 | void KRFBCanvas::openURL( const QUrl &url ) |
52 | { | 43 | { |
53 | if ( loggedIn_ ) { | 44 | if ( loggedIn_ ) { |
54 | qWarning( "openURL invoked when logged in\n" ); | 45 | qWarning( "openURL invoked when logged in\n" ); |
55 | return; | 46 | return; |
56 | } | 47 | } |
57 | 48 | ||
58 | QCString host = url.host().latin1(); | 49 | QCString host = url.host().latin1(); |
59 | int display = url.port(); | 50 | int display = url.port(); |
60 | 51 | ||
61 | // connection_->connectTo( host, display ); | 52 | // connection_->connectTo( host, display ); |
62 | } | 53 | } |
63 | 54 | ||
64 | void KRFBCanvas::closeConnection() | 55 | void KRFBCanvas::closeConnection() |
diff --git a/noncore/comm/keypebble/krfbconnection.cpp b/noncore/comm/keypebble/krfbconnection.cpp index 389c836..e6c33c6 100644 --- a/noncore/comm/keypebble/krfbconnection.cpp +++ b/noncore/comm/keypebble/krfbconnection.cpp | |||
@@ -1,56 +1,55 @@ | |||
1 | #include <assert.h> | 1 | #include <assert.h> |
2 | #include <qsocket.h> | 2 | #include <qsocket.h> |
3 | #include <qtimer.h> | 3 | #include <qtimer.h> |
4 | #include <string.h> | 4 | #include <string.h> |
5 | 5 | ||
6 | #include "krfbconnection.h" | 6 | #include "krfbconnection.h" |
7 | #include "krfblogin.h" | 7 | #include "krfblogin.h" |
8 | #include "krfbserver.h" | ||
9 | #include "krfbdecoder.h" | 8 | #include "krfbdecoder.h" |
10 | #include "krfbbuffer.h" | 9 | #include "krfbbuffer.h" |
11 | 10 | ||
12 | KRFBConnection::KRFBConnection( QObject *parent ) | 11 | KRFBConnection::KRFBConnection( QObject *parent ) |
13 | : QObject( parent, "KRFBConnection" ) | 12 | : QObject( parent, "KRFBConnection" ) |
14 | { | 13 | { |
15 | portBase_ = 5900; | 14 | portBase_ = 5900; |
16 | currentState_ = Disconnected; | 15 | currentState_ = Disconnected; |
17 | sock = 0; | 16 | sock = 0; |
18 | minData_ = 0; | 17 | minData_ = 0; |
19 | options_ = new KRFBServer(); | 18 | options_ = new KRFBServer(); |
20 | updater = 0; | 19 | updater = 0; |
21 | decoder_ = 0; | 20 | decoder_ = 0; |
22 | buffer_ = 0; | 21 | buffer_ = 0; |
23 | } | 22 | } |
24 | 23 | ||
25 | KRFBConnection::~KRFBConnection() | 24 | KRFBConnection::~KRFBConnection() |
26 | { | 25 | { |
27 | if ( ( currentState_ != Disconnected ) && ( currentState_ != Disconnecting ) && sock ) { | 26 | if ( ( currentState_ != Disconnected ) && ( currentState_ != Disconnecting ) && sock ) { |
28 | disconnectDone(); | 27 | disconnectDone(); |
29 | } | 28 | } |
30 | delete options_; | 29 | delete options_; |
31 | } | 30 | } |
32 | 31 | ||
33 | void KRFBConnection::connectTo( KRFBServer server) | 32 | void KRFBConnection::connectTo( KRFBServer server) |
34 | { | 33 | { |
35 | if ( currentState_ != Disconnected ) | 34 | if ( currentState_ != Disconnected ) |
36 | disconnect(); | 35 | disconnect(); |
37 | 36 | ||
38 | (*options_)=server; | 37 | (*options_)=server; |
39 | 38 | ||
40 | sock = new QSocket( this, "rfbSocket" ); | 39 | sock = new QSocket( this, "rfbSocket" ); |
41 | CHECK_PTR( sock ); | 40 | CHECK_PTR( sock ); |
42 | 41 | ||
43 | // Connect to something to notice connection or error | 42 | // Connect to something to notice connection or error |
44 | connect( sock, SIGNAL( error( int ) ), SLOT( gotSocketError( int ) ) ); | 43 | connect( sock, SIGNAL( error( int ) ), SLOT( gotSocketError( int ) ) ); |
45 | connect( sock, SIGNAL( connected() ), SLOT( gotSocketConnection() ) ); | 44 | connect( sock, SIGNAL( connected() ), SLOT( gotSocketConnection() ) ); |
46 | 45 | ||
47 | qWarning( "Connecting..." ); | 46 | qWarning( "Connecting..." ); |
48 | 47 | ||
49 | currentState_ = Connecting; | 48 | currentState_ = Connecting; |
50 | sock->connectToHost( options_->hostname.latin1(), portBase_ + options_->display ); | 49 | sock->connectToHost( options_->hostname.latin1(), portBase_ + options_->display ); |
51 | } | 50 | } |
52 | 51 | ||
53 | void KRFBConnection::disconnect() | 52 | void KRFBConnection::disconnect() |
54 | { | 53 | { |
55 | qWarning( "Disconnecting from server" ); | 54 | qWarning( "Disconnecting from server" ); |
56 | 55 | ||
diff --git a/noncore/comm/keypebble/krfbdecoder.cpp b/noncore/comm/keypebble/krfbdecoder.cpp index c43aed5..2c9ad71 100644 --- a/noncore/comm/keypebble/krfbdecoder.cpp +++ b/noncore/comm/keypebble/krfbdecoder.cpp | |||
@@ -1,61 +1,55 @@ | |||
1 | #include "krfbconnection.h" | 1 | #include "krfbconnection.h" |
2 | #include "krfbserver.h" | ||
3 | #include "krfbserverinfo.h" | 2 | #include "krfbserverinfo.h" |
4 | #include "krfbdecoder.h" | 3 | #include "krfbdecoder.h" |
5 | #include "krfbbuffer.h" | 4 | #include "krfbbuffer.h" |
6 | 5 | ||
7 | #include <qpe/qpeapplication.h> | ||
8 | 6 | ||
9 | #include <qpixmap.h> | 7 | #include <qpixmap.h> |
10 | #include <qsocket.h> | ||
11 | #include <qevent.h> | ||
12 | #include <qstring.h> | ||
13 | #include <qclipboard.h> | ||
14 | 8 | ||
15 | #include <assert.h> | 9 | #include <assert.h> |
16 | 10 | ||
17 | // | 11 | // |
18 | // Endian stuff | 12 | // Endian stuff |
19 | // | 13 | // |
20 | #ifndef KDE_USE_FINAL | 14 | #ifndef KDE_USE_FINAL |
21 | const int endianTest = 1; | 15 | const int endianTest = 1; |
22 | #endif | 16 | #endif |
23 | 17 | ||
24 | #define Swap16IfLE(s) \ | 18 | #define Swap16IfLE(s) \ |
25 | (*(char *)&endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s)) | 19 | (*(char *)&endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s)) |
26 | 20 | ||
27 | #define Swap32IfLE(l) \ | 21 | #define Swap32IfLE(l) \ |
28 | (*(char *)&endianTest ? ((((l) & 0xff000000) >> 24) | \ | 22 | (*(char *)&endianTest ? ((((l) & 0xff000000) >> 24) | \ |
29 | (((l) & 0x00ff0000) >> 8) | \ | 23 | (((l) & 0x00ff0000) >> 8) | \ |
30 | (((l) & 0x0000ff00) << 8) | \ | 24 | (((l) & 0x0000ff00) << 8) | \ |
31 | (((l) & 0x000000ff) << 24)) : (l)) | 25 | (((l) & 0x000000ff) << 24)) : (l)) |
32 | 26 | ||
33 | // | 27 | // |
34 | // The lengths of the messages we need to wait for | 28 | // The lengths of the messages we need to wait for |
35 | // | 29 | // |
36 | const int ServerInitLength = 24; | 30 | const int ServerInitLength = 24; |
37 | const int UpdateHeaderLength = 4; | 31 | const int UpdateHeaderLength = 4; |
38 | const int RectHeaderLength = 12; | 32 | const int RectHeaderLength = 12; |
39 | const int RectChunkSize = 4; | 33 | const int RectChunkSize = 4; |
40 | const int CopyRectPosLength = 4; | 34 | const int CopyRectPosLength = 4; |
41 | const int ServerCutLenLength = 7; | 35 | const int ServerCutLenLength = 7; |
42 | 36 | ||
43 | // | 37 | // |
44 | // Client -> Server Message Identifiers | 38 | // Client -> Server Message Identifiers |
45 | // | 39 | // |
46 | static CARD8 SetPixelFormatId = 0; | 40 | static CARD8 SetPixelFormatId = 0; |
47 | //static CARD8 FixColourMapEntriesId = 1; // Not used | 41 | //static CARD8 FixColourMapEntriesId = 1; // Not used |
48 | static CARD8 SetEncodingsId = 2; | 42 | static CARD8 SetEncodingsId = 2; |
49 | static CARD8 UpdateRequestId = 3; | 43 | static CARD8 UpdateRequestId = 3; |
50 | static CARD8 KeyEventId = 4; | 44 | static CARD8 KeyEventId = 4; |
51 | static CARD8 PointerEventId = 5; | 45 | static CARD8 PointerEventId = 5; |
52 | static CARD8 ClientCutTextId = 6; | 46 | static CARD8 ClientCutTextId = 6; |
53 | 47 | ||
54 | // | 48 | // |
55 | // Server -> Client Message Identifiers | 49 | // Server -> Client Message Identifiers |
56 | // | 50 | // |
57 | static CARD8 UpdateId = 0; | 51 | static CARD8 UpdateId = 0; |
58 | static CARD8 BellId = 2; | 52 | static CARD8 BellId = 2; |
59 | static CARD8 ServerCutId = 3; | 53 | static CARD8 ServerCutId = 3; |
60 | 54 | ||
61 | // | 55 | // |
diff --git a/noncore/comm/keypebble/krfblogin.cpp b/noncore/comm/keypebble/krfblogin.cpp index 0d2a205..0b4a757 100644 --- a/noncore/comm/keypebble/krfblogin.cpp +++ b/noncore/comm/keypebble/krfblogin.cpp | |||
@@ -1,59 +1,58 @@ | |||
1 | #include <assert.h> | 1 | #include <assert.h> |
2 | 2 | ||
3 | 3 | ||
4 | extern "C" { | 4 | extern "C" { |
5 | #include "vncauth.h" | 5 | #include "vncauth.h" |
6 | } | 6 | } |
7 | 7 | ||
8 | #include "krfblogin.h" | 8 | #include "krfblogin.h" |
9 | #include "krfbconnection.h" | 9 | #include "krfbconnection.h" |
10 | #include <qtimer.h> | 10 | #include <qtimer.h> |
11 | #include <qregexp.h> | ||
12 | 11 | ||
13 | // The length of the various messages (used to decide how many bytes to | 12 | // The length of the various messages (used to decide how many bytes to |
14 | // wait for). | 13 | // wait for). |
15 | const int ServerVersionLength = 12; | 14 | const int ServerVersionLength = 12; |
16 | const int ClientVersionLength = 12; | 15 | const int ClientVersionLength = 12; |
17 | const int AuthSchemeLength = 4; | 16 | const int AuthSchemeLength = 4; |
18 | const int FailureReasonSizeLength = 4; | 17 | const int FailureReasonSizeLength = 4; |
19 | const int ChallengeLength = 16; | 18 | const int ChallengeLength = 16; |
20 | const int AuthResultLength = 4; | 19 | const int AuthResultLength = 4; |
21 | 20 | ||
22 | // Authentication results | 21 | // Authentication results |
23 | enum AuthResult { | 22 | enum AuthResult { |
24 | AuthOk, | 23 | AuthOk, |
25 | AuthFailed, | 24 | AuthFailed, |
26 | AuthTooMany | 25 | AuthTooMany |
27 | }; | 26 | }; |
28 | 27 | ||
29 | typedef unsigned char CARD8; | 28 | typedef unsigned char CARD8; |
30 | typedef unsigned short CARD16; | 29 | typedef unsigned short CARD16; |
31 | typedef unsigned long CARD32; | 30 | typedef unsigned long CARD32; |
32 | 31 | ||
33 | const int endianTest = 1; | 32 | const int endianTest = 1; |
34 | 33 | ||
35 | // Endian stuff | 34 | // Endian stuff |
36 | #define Swap16IfLE(s) \ | 35 | #define Swap16IfLE(s) \ |
37 | (*(char *)&endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s)) | 36 | (*(char *)&endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s)) |
38 | 37 | ||
39 | #define Swap32IfLE(l) \ | 38 | #define Swap32IfLE(l) \ |
40 | (*(char *)&endianTest ? ((((l) & 0xff000000) >> 24) | \ | 39 | (*(char *)&endianTest ? ((((l) & 0xff000000) >> 24) | \ |
41 | (((l) & 0x00ff0000) >> 8) | \ | 40 | (((l) & 0x00ff0000) >> 8) | \ |
42 | (((l) & 0x0000ff00) << 8) | \ | 41 | (((l) & 0x0000ff00) << 8) | \ |
43 | (((l) & 0x000000ff) << 24)) : (l)) | 42 | (((l) & 0x000000ff) << 24)) : (l)) |
44 | 43 | ||
45 | KRFBLogin::KRFBLogin( KRFBConnection *con ) | 44 | KRFBLogin::KRFBLogin( KRFBConnection *con ) |
46 | : QObject( con, "RFB login manager" ) | 45 | : QObject( con, "RFB login manager" ) |
47 | { | 46 | { |
48 | assert( con ); | 47 | assert( con ); |
49 | this->con = con; | 48 | this->con = con; |
50 | currentState = AwaitingServerVersion; | 49 | currentState = AwaitingServerVersion; |
51 | 50 | ||
52 | connect( this, SIGNAL( error( const QString & ) ), | 51 | connect( this, SIGNAL( error( const QString & ) ), |
53 | con, SIGNAL( error( const QString & ) ) ); | 52 | con, SIGNAL( error( const QString & ) ) ); |
54 | 53 | ||
55 | 54 | ||
56 | qWarning( "Waiting for server version..." ); | 55 | qWarning( "Waiting for server version..." ); |
57 | 56 | ||
58 | static QString statusMsg = tr( "Waiting for server version..." ); | 57 | static QString statusMsg = tr( "Waiting for server version..." ); |
59 | emit status( statusMsg ); | 58 | emit status( statusMsg ); |
diff --git a/noncore/comm/keypebble/krfbserver.cpp b/noncore/comm/keypebble/krfbserver.cpp index b47534e..fda81a1 100644 --- a/noncore/comm/keypebble/krfbserver.cpp +++ b/noncore/comm/keypebble/krfbserver.cpp | |||
@@ -1,41 +1,40 @@ | |||
1 | #include <qpe/config.h> | ||
2 | #include <qpe/qpeapplication.h> | 1 | #include <qpe/qpeapplication.h> |
3 | #include "krfbserver.h" | 2 | #include "krfbserver.h" |
4 | 3 | ||
5 | KRFBServer::KRFBServer() | 4 | KRFBServer::KRFBServer() |
6 | { | 5 | { |
7 | QString name; | 6 | QString name; |
8 | QString hostname; | 7 | QString hostname; |
9 | QString password; | 8 | QString password; |
10 | display=0; | 9 | display=0; |
11 | 10 | ||
12 | scaleFactor=1; | 11 | scaleFactor=1; |
13 | 12 | ||
14 | hexTile=0; | 13 | hexTile=0; |
15 | corre=0; | 14 | corre=0; |
16 | rre=0; | 15 | rre=0; |
17 | copyrect=1; | 16 | copyrect=1; |
18 | 17 | ||
19 | colors256=1; | 18 | colors256=1; |
20 | shared=0; | 19 | shared=0; |
21 | readOnly=0; | 20 | readOnly=0; |
22 | deIconify=0; | 21 | deIconify=0; |
23 | 22 | ||
24 | updateRate=0; | 23 | updateRate=0; |
25 | } | 24 | } |
26 | KRFBServer::~KRFBServer() | 25 | KRFBServer::~KRFBServer() |
27 | { | 26 | { |
28 | } | 27 | } |
29 | 28 | ||
30 | int KRFBServer::encodings() | 29 | int KRFBServer::encodings() |
31 | { | 30 | { |
32 | // Initially one because we always support raw encoding | 31 | // Initially one because we always support raw encoding |
33 | int count = 1; | 32 | int count = 1; |
34 | 33 | ||
35 | count += hexTile ? 1 : 0; | 34 | count += hexTile ? 1 : 0; |
36 | count += corre ? 1 : 0; | 35 | count += corre ? 1 : 0; |
37 | count += rre ? 1 : 0; | 36 | count += rre ? 1 : 0; |
38 | count += copyrect ? 1 : 0; | 37 | count += copyrect ? 1 : 0; |
39 | 38 | ||
40 | return count; | 39 | return count; |
41 | } | 40 | } |
diff --git a/noncore/comm/keypebble/kvnc.cpp b/noncore/comm/keypebble/kvnc.cpp index 2fa8d1f..c678edf 100644 --- a/noncore/comm/keypebble/kvnc.cpp +++ b/noncore/comm/keypebble/kvnc.cpp | |||
@@ -1,75 +1,62 @@ | |||
1 | #include <qiconset.h> | ||
2 | #include <qdialog.h> | ||
3 | #include <qpixmap.h> | ||
4 | #include <qdom.h> | ||
5 | #include <qaction.h> | 1 | #include <qaction.h> |
6 | #include <qmenubar.h> | ||
7 | #include <qstatusbar.h> | ||
8 | #include <qpopupmenu.h> | 2 | #include <qpopupmenu.h> |
9 | #include <qpushbutton.h> | 3 | #include <qpushbutton.h> |
10 | #include <qpe/qpetoolbar.h> | ||
11 | #include <qtimer.h> | ||
12 | #include <qmessagebox.h> | 4 | #include <qmessagebox.h> |
13 | #include <qspinbox.h> | ||
14 | #include <qlistbox.h> | 5 | #include <qlistbox.h> |
15 | #include <qlineedit.h> | ||
16 | #include <qpe/qpeapplication.h> | 6 | #include <qpe/qpeapplication.h> |
17 | #include <qpe/global.h> | ||
18 | #include <qpe/qpetoolbar.h> | ||
19 | #include <qpe/resource.h> | 7 | #include <qpe/resource.h> |
20 | 8 | ||
21 | #include <assert.h> | 9 | #include <assert.h> |
22 | 10 | ||
23 | #include "kvnc.h" | 11 | #include "kvnc.h" |
24 | #include "krfbcanvas.h" | 12 | #include "krfbcanvas.h" |
25 | #include "krfbconnection.h" | 13 | #include "krfbconnection.h" |
26 | #include "kvncconndlg.h" | 14 | #include "kvncconndlg.h" |
27 | #include "krfbserver.h" | ||
28 | 15 | ||
29 | static int u_id = 1; | 16 | static int u_id = 1; |
30 | static int get_unique_id() | 17 | static int get_unique_id() |
31 | { | 18 | { |
32 | return u_id++; | 19 | return u_id++; |
33 | } | 20 | } |
34 | 21 | ||
35 | 22 | ||
36 | /* XPM */ | 23 | /* XPM */ |
37 | static char * menu_xpm[] = { | 24 | static char * menu_xpm[] = { |
38 | "12 12 5 1", | 25 | "12 12 5 1", |
39 | " c None", | 26 | " c None", |
40 | ".c #000000", | 27 | ".c #000000", |
41 | "+c #FFFDAD", | 28 | "+c #FFFDAD", |
42 | "@c #FFFF00", | 29 | "@c #FFFF00", |
43 | "#c #E5E100", | 30 | "#c #E5E100", |
44 | " ", | 31 | " ", |
45 | " ", | 32 | " ", |
46 | " ......... ", | 33 | " ......... ", |
47 | " .+++++++. ", | 34 | " .+++++++. ", |
48 | " .+@@@@#. ", | 35 | " .+@@@@#. ", |
49 | " .+@@@#. ", | 36 | " .+@@@#. ", |
50 | " .+@@#. ", | 37 | " .+@@#. ", |
51 | " .+@#. ", | 38 | " .+@#. ", |
52 | " .+#. ", | 39 | " .+#. ", |
53 | " .+. ", | 40 | " .+. ", |
54 | " .. ", | 41 | " .. ", |
55 | " "}; | 42 | " "}; |
56 | 43 | ||
57 | const int StatusTextId = 0; | 44 | const int StatusTextId = 0; |
58 | 45 | ||
59 | KVNC::KVNC( QWidget *parent, const char *name, WFlags f) : QMainWindow( 0, name ,WStyle_ContextHelp) | 46 | KVNC::KVNC( QWidget *parent, const char *name, WFlags f) : QMainWindow( 0, name ,WStyle_ContextHelp) |
60 | { | 47 | { |
61 | setCaption( tr("VNC Viewer") ); | 48 | setCaption( tr("VNC Viewer") ); |
62 | fullscreen = false; | 49 | fullscreen = false; |
63 | 50 | ||
64 | stack = new QWidgetStack( this ); | 51 | stack = new QWidgetStack( this ); |
65 | setCentralWidget( stack ); | 52 | setCentralWidget( stack ); |
66 | 53 | ||
67 | bookmarkSelector=new KVNCBookmarkDlg(); | 54 | bookmarkSelector=new KVNCBookmarkDlg(); |
68 | stack->addWidget(bookmarkSelector,get_unique_id()); | 55 | stack->addWidget(bookmarkSelector,get_unique_id()); |
69 | stack->raiseWidget( bookmarkSelector ); | 56 | stack->raiseWidget( bookmarkSelector ); |
70 | 57 | ||
71 | canvas = new KRFBCanvas( stack, "canvas" ); | 58 | canvas = new KRFBCanvas( stack, "canvas" ); |
72 | stack->addWidget(canvas,get_unique_id()); | 59 | stack->addWidget(canvas,get_unique_id()); |
73 | setCentralWidget( stack ); | 60 | setCentralWidget( stack ); |
74 | 61 | ||
75 | 62 | ||
diff --git a/noncore/comm/keypebble/kvncbookmarkdlg.cpp b/noncore/comm/keypebble/kvncbookmarkdlg.cpp index 8556d49..ef2fa12 100644 --- a/noncore/comm/keypebble/kvncbookmarkdlg.cpp +++ b/noncore/comm/keypebble/kvncbookmarkdlg.cpp | |||
@@ -1,66 +1,52 @@ | |||
1 | #include <qframe.h> | ||
2 | #include <qvbox.h> | ||
3 | #include <qcheckbox.h> | ||
4 | #include <qspinbox.h> | ||
5 | #include <qlabel.h> | ||
6 | #include <qlayout.h> | ||
7 | #include <qwhatsthis.h> | ||
8 | #include <qfile.h> | ||
9 | #include <qdir.h> | 1 | #include <qdir.h> |
10 | #include <qstring.h> | ||
11 | #include <qapplication.h> | ||
12 | #include <qlineedit.h> | ||
13 | #include <qtextstream.h> | 2 | #include <qtextstream.h> |
14 | #include <qpushbutton.h> | ||
15 | #include <qlistbox.h> | 3 | #include <qlistbox.h> |
16 | #include <qpe/config.h> | ||
17 | #include <qpe/global.h> | 4 | #include <qpe/global.h> |
18 | #include "krfbserver.h" | ||
19 | #include "kvncbookmarkdlg.h" | 5 | #include "kvncbookmarkdlg.h" |
20 | 6 | ||
21 | KVNCBookmarkDlg::KVNCBookmarkDlg( QWidget * parent, const char * name, WFlags f ) | 7 | KVNCBookmarkDlg::KVNCBookmarkDlg( QWidget * parent, const char * name, WFlags f ) |
22 | 8 | ||
23 | : KVNCBookmarkDlgBase( parent, name,f) | 9 | : KVNCBookmarkDlgBase( parent, name,f) |
24 | { | 10 | { |
25 | readBookmarks(); | 11 | readBookmarks(); |
26 | refresh(); | 12 | refresh(); |
27 | 13 | ||
28 | } | 14 | } |
29 | 15 | ||
30 | KVNCBookmarkDlg::~KVNCBookmarkDlg() | 16 | KVNCBookmarkDlg::~KVNCBookmarkDlg() |
31 | { | 17 | { |
32 | } | 18 | } |
33 | 19 | ||
34 | void KVNCBookmarkDlg::addBookmark(KRFBServer * server) | 20 | void KVNCBookmarkDlg::addBookmark(KRFBServer * server) |
35 | { | 21 | { |
36 | if (server) { | 22 | if (server) { |
37 | servers.append(server); | 23 | servers.append(server); |
38 | bookmarkList->insertItem(server->name); | 24 | bookmarkList->insertItem(server->name); |
39 | writeBookmarks(); | 25 | writeBookmarks(); |
40 | refresh(); | 26 | refresh(); |
41 | } | 27 | } |
42 | } | 28 | } |
43 | 29 | ||
44 | void KVNCBookmarkDlg::deleteBookmark(QString name) | 30 | void KVNCBookmarkDlg::deleteBookmark(QString name) |
45 | { | 31 | { |
46 | KRFBServer * server=0; | 32 | KRFBServer * server=0; |
47 | for ( server=servers.first(); server != 0; server=servers.next() ) { | 33 | for ( server=servers.first(); server != 0; server=servers.next() ) { |
48 | if (server->name==name) { | 34 | if (server->name==name) { |
49 | servers.remove(servers.at()); | 35 | servers.remove(servers.at()); |
50 | writeBookmarks(); | 36 | writeBookmarks(); |
51 | refresh(); | 37 | refresh(); |
52 | return; | 38 | return; |
53 | } | 39 | } |
54 | } | 40 | } |
55 | } | 41 | } |
56 | KRFBServer *KVNCBookmarkDlg::getServer(QString name) | 42 | KRFBServer *KVNCBookmarkDlg::getServer(QString name) |
57 | { | 43 | { |
58 | KRFBServer * server=0; | 44 | KRFBServer * server=0; |
59 | for ( server=servers.first(); server != 0; server=servers.next() ) { | 45 | for ( server=servers.first(); server != 0; server=servers.next() ) { |
60 | if (server->name==name) | 46 | if (server->name==name) |
61 | 47 | ||
62 | return server; | 48 | return server; |
63 | } | 49 | } |
64 | return 0; | 50 | return 0; |
65 | } | 51 | } |
66 | 52 | ||
diff --git a/noncore/comm/keypebble/kvncconndlg.cpp b/noncore/comm/keypebble/kvncconndlg.cpp index cd55bb0..420c816 100644 --- a/noncore/comm/keypebble/kvncconndlg.cpp +++ b/noncore/comm/keypebble/kvncconndlg.cpp | |||
@@ -1,60 +1,52 @@ | |||
1 | #include <qframe.h> | ||
2 | #include <qvbox.h> | ||
3 | #include <qcheckbox.h> | 1 | #include <qcheckbox.h> |
4 | #include <qcombobox.h> | 2 | #include <qcombobox.h> |
5 | #include <qspinbox.h> | 3 | #include <qspinbox.h> |
6 | #include <qlabel.h> | ||
7 | #include <qlayout.h> | ||
8 | #include <qwhatsthis.h> | ||
9 | #include <qapplication.h> | ||
10 | #include <qlineedit.h> | 4 | #include <qlineedit.h> |
11 | #include <qpushbutton.h> | ||
12 | #include "krfbserver.h" | ||
13 | 5 | ||
14 | #include "kvncconndlg.h" | 6 | #include "kvncconndlg.h" |
15 | 7 | ||
16 | KVNCConnDlg::KVNCConnDlg( KRFBServer *options, | 8 | KVNCConnDlg::KVNCConnDlg( KRFBServer *options, |
17 | QWidget *parent, char *name, bool modal ) | 9 | QWidget *parent, char *name, bool modal ) |
18 | : KVNCConnDlgBase( parent, name, modal, WStyle_ContextHelp ) | 10 | : KVNCConnDlgBase( parent, name, modal, WStyle_ContextHelp ) |
19 | { | 11 | { |
20 | this->options=options; | 12 | this->options=options; |
21 | tmpOptions=*options; | 13 | tmpOptions=*options; |
22 | 14 | ||
23 | serverHostname->setText(options->hostname); | 15 | serverHostname->setText(options->hostname); |
24 | serverDisplay->setValue(options->display); | 16 | serverDisplay->setValue(options->display); |
25 | serverPassword->setText(options->password); | 17 | serverPassword->setText(options->password); |
26 | serverBookmark->setText(options->name); | 18 | serverBookmark->setText(options->name); |
27 | 19 | ||
28 | hex->setChecked( options->hexTile ); | 20 | hex->setChecked( options->hexTile ); |
29 | corre->setChecked( options->corre ); | 21 | corre->setChecked( options->corre ); |
30 | rre->setChecked( options->rre ); | 22 | rre->setChecked( options->rre ); |
31 | copyRect->setChecked( options->copyrect ); | 23 | copyRect->setChecked( options->copyrect ); |
32 | 24 | ||
33 | for (int i=0; i < scaleFactor->count(); ++i) { | 25 | for (int i=0; i < scaleFactor->count(); ++i) { |
34 | if (scaleFactor->text(i).toInt()==tmpOptions.scaleFactor) { | 26 | if (scaleFactor->text(i).toInt()==tmpOptions.scaleFactor) { |
35 | scaleFactor->setCurrentItem(i); | 27 | scaleFactor->setCurrentItem(i); |
36 | } | 28 | } |
37 | } | 29 | } |
38 | 30 | ||
39 | // TODO | 31 | // TODO |
40 | hex->setEnabled( false ); | 32 | hex->setEnabled( false ); |
41 | corre->setEnabled( false ); | 33 | corre->setEnabled( false ); |
42 | rre->setEnabled( false ); | 34 | rre->setEnabled( false ); |
43 | // /TODO | 35 | // /TODO |
44 | 36 | ||
45 | deIconify->setChecked( options->deIconify ); | 37 | deIconify->setChecked( options->deIconify ); |
46 | bit->setChecked( options->colors256 ); | 38 | bit->setChecked( options->colors256 ); |
47 | shared->setChecked( options->shared ); | 39 | shared->setChecked( options->shared ); |
48 | timeBox->setValue( options->updateRate ); | 40 | timeBox->setValue( options->updateRate ); |
49 | 41 | ||
50 | serverPassword->setEchoMode(QLineEdit::Password); | 42 | serverPassword->setEchoMode(QLineEdit::Password); |
51 | 43 | ||
52 | connect(togglePassword, SIGNAL( stateChanged(int) ), this, SLOT( showPassword(int) ) ); | 44 | connect(togglePassword, SIGNAL( stateChanged(int) ), this, SLOT( showPassword(int) ) ); |
53 | 45 | ||
54 | 46 | ||
55 | } | 47 | } |
56 | KVNCConnDlg::~KVNCConnDlg() | 48 | KVNCConnDlg::~KVNCConnDlg() |
57 | { | 49 | { |
58 | } | 50 | } |
59 | 51 | ||
60 | void KVNCConnDlg::accept() | 52 | void KVNCConnDlg::accept() |
diff --git a/noncore/comm/keypebble/main.cpp b/noncore/comm/keypebble/main.cpp index 11f67fc..fc34099 100644 --- a/noncore/comm/keypebble/main.cpp +++ b/noncore/comm/keypebble/main.cpp | |||
@@ -1,10 +1,9 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | 3 | ||
4 | #include <qpe/qpeapplication.h> | ||
5 | #include "kvnc.h" | 4 | #include "kvnc.h" |
6 | #include <opie/oapplicationfactory.h> | 5 | #include <opie/oapplicationfactory.h> |
7 | 6 | ||
8 | 7 | ||
9 | 8 | ||
10 | OPIE_EXPORT_APP( OApplicationFactory<KVNC> ) | 9 | OPIE_EXPORT_APP( OApplicationFactory<KVNC> ) |