Diffstat (limited to 'noncore/comm/keypebble/krfbbuffer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/comm/keypebble/krfbbuffer.cpp | 3 |
1 files changed, 0 insertions, 3 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 | } |