summaryrefslogtreecommitdiff
path: root/noncore/comm/keypebble/krfbbuffer.h
Unidiff
Diffstat (limited to 'noncore/comm/keypebble/krfbbuffer.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/comm/keypebble/krfbbuffer.h62
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
8class QPixmap;
9class KRFBDecoder;
10class QMouseEvent;
11class 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 */
18class KRFBBuffer : public QObject
19{
20 Q_OBJECT
21
22public:
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
47signals:
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
57private:
58 KRFBDecoder *decoder;
59 QPixmap *pix;
60};
61
62#endif // KRFBBUFFER_H