author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /noncore/comm/keypebble/krfbbuffer.h | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
Diffstat (limited to 'noncore/comm/keypebble/krfbbuffer.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/comm/keypebble/krfbbuffer.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/noncore/comm/keypebble/krfbbuffer.h b/noncore/comm/keypebble/krfbbuffer.h new file mode 100644 index 0000000..1116d00 --- a/dev/null +++ b/noncore/comm/keypebble/krfbbuffer.h | |||
@@ -0,0 +1,62 @@ | |||
1 | // -*- c++ -*- | ||
2 | |||
3 | #ifndef KRFBBUFFER_H | ||
4 | #define KRFBBUFFER_H | ||
5 | |||
6 | #include <qobject.h> | ||
7 | |||
8 | class QPixmap; | ||
9 | class KRFBDecoder; | ||
10 | class QMouseEvent; | ||
11 | class QKeyEvent; | ||
12 | |||
13 | /** | ||
14 | * A wrapper around QPixmap that knows how to implement the RFB | ||
15 | * drawing primitives. If possible it makes use of the MIT XSHM | ||
16 | * extension to optimise the drawing operations. | ||
17 | */ | ||
18 | class KRFBBuffer : public QObject | ||
19 | { | ||
20 | Q_OBJECT | ||
21 | |||
22 | public: | ||
23 | KRFBBuffer( KRFBDecoder *decoder, QObject *parent, const char *name=0 ); | ||
24 | ~KRFBBuffer(); | ||
25 | |||
26 | QPixmap *pixmap() const { return pix; }; | ||
27 | |||
28 | /** | ||
29 | * Draw a chunk of a raw encoded rectangle. | ||
30 | */ | ||
31 | void drawRawRectChunk( void *data, int x, int y, int w, int h ); | ||
32 | |||
33 | void copyRect( int srcX, int srcY, | ||
34 | int destX, int destY, int w, int h ); | ||
35 | |||
36 | void fillRect( int ,int , int , int , unsigned long ) {}; | ||
37 | |||
38 | void resize( int w, int h ); | ||
39 | |||
40 | void mouseEvent( QMouseEvent *e ); | ||
41 | |||
42 | void keyPressEvent( QKeyEvent *e ); | ||
43 | void keyReleaseEvent( QKeyEvent *e ); | ||
44 | |||
45 | void soundBell(); | ||
46 | |||
47 | signals: | ||
48 | /** | ||
49 | * Emitted when the size of the buffer changes. | ||
50 | */ | ||
51 | void sizeChanged( int w, int h ); | ||
52 | |||
53 | void updated( int x, int y, int w, int h ); | ||
54 | |||
55 | void bell(); | ||
56 | |||
57 | private: | ||
58 | KRFBDecoder *decoder; | ||
59 | QPixmap *pix; | ||
60 | }; | ||
61 | |||
62 | #endif // KRFBBUFFER_H | ||