summaryrefslogtreecommitdiff
path: root/noncore/comm/keypebble/krfbbuffer.h
authorkergoth <kergoth>2002-01-25 22:14:26 (UTC)
committer kergoth <kergoth>2002-01-25 22:14:26 (UTC)
commit15318cad33835e4e2dc620d033e43cd930676cdd (patch) (side-by-side diff)
treec2fa0399a2c47fda8e2cd0092c73a809d17f68eb /noncore/comm/keypebble/krfbbuffer.h
downloadopie-15318cad33835e4e2dc620d033e43cd930676cdd.zip
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2
Initial revision
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 @@
+// -*- c++ -*-
+
+#ifndef KRFBBUFFER_H
+#define KRFBBUFFER_H
+
+#include <qobject.h>
+
+class QPixmap;
+class KRFBDecoder;
+class QMouseEvent;
+class QKeyEvent;
+
+/**
+ * A wrapper around QPixmap that knows how to implement the RFB
+ * drawing primitives. If possible it makes use of the MIT XSHM
+ * extension to optimise the drawing operations.
+ */
+class KRFBBuffer : public QObject
+{
+ Q_OBJECT
+
+public:
+ KRFBBuffer( KRFBDecoder *decoder, QObject *parent, const char *name=0 );
+ ~KRFBBuffer();
+
+ QPixmap *pixmap() const { return pix; };
+
+ /**
+ * Draw a chunk of a raw encoded rectangle.
+ */
+ void drawRawRectChunk( void *data, int x, int y, int w, int h );
+
+ void copyRect( int srcX, int srcY,
+ int destX, int destY, int w, int h );
+
+ void fillRect( int ,int , int , int , unsigned long ) {};
+
+ void resize( int w, int h );
+
+ void mouseEvent( QMouseEvent *e );
+
+ void keyPressEvent( QKeyEvent *e );
+ void keyReleaseEvent( QKeyEvent *e );
+
+ void soundBell();
+
+signals:
+ /**
+ * Emitted when the size of the buffer changes.
+ */
+ void sizeChanged( int w, int h );
+
+ void updated( int x, int y, int w, int h );
+
+ void bell();
+
+private:
+ KRFBDecoder *decoder;
+ QPixmap *pix;
+};
+
+#endif // KRFBBUFFER_H