Add helper class for a rendered cursor
Add a magical cursor framebuffer class for handling when you
want to render the cursor on the server side. Keeps the cursor
specific magic in one contained place.
diff --git a/common/rfb/Cursor.h b/common/rfb/Cursor.h
index 7d94d70..5d4623d 100644
--- a/common/rfb/Cursor.h
+++ b/common/rfb/Cursor.h
@@ -1,4 +1,5 @@
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
+ * Copyright 2014 Pierre Ossman for Cendio AB
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -52,5 +53,20 @@
void crop();
};
+ class RenderedCursor : public PixelBuffer {
+ public:
+ RenderedCursor();
+
+ Rect getEffectiveRect() const { return buffer.getRect(offset); }
+
+ virtual const rdr::U8* getBuffer(const Rect& r, int* stride);
+
+ void update(PixelBuffer* framebuffer, Cursor* cursor, const Point& pos);
+
+ protected:
+ ManagedPixelBuffer buffer;
+ Point offset;
+ };
+
}
#endif