summaryrefslogtreecommitdiff
path: root/plugingui/widget.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-09-04 21:15:39 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-09-04 21:15:39 +0200
commit6cd45908c3d62f845f1847009a0c38504f0d0082 (patch)
tree230b4cca4e7c84a7b16a5ab4c7aeca8597f0b167 /plugingui/widget.h
parent107102992a25781d0fef5c4d38b799f5fe38dd24 (diff)
Add Canvas base class for the Painter to draw on. This is done in preparation for a new Painter unittest.
Diffstat (limited to 'plugingui/widget.h')
-rw-r--r--plugingui/widget.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugingui/widget.h b/plugingui/widget.h
index bbe85d0..26070c5 100644
--- a/plugingui/widget.h
+++ b/plugingui/widget.h
@@ -30,15 +30,21 @@
#include "pixelbuffer.h"
#include "notifier.h"
#include "layout.h"
+#include "canvas.h"
#include <vector>
-namespace GUI {
+namespace GUI
+{
class ImageCache;
class Window;
-class Widget : public Listener, public LayoutItem {
+class Widget
+ : public Listener
+ , public LayoutItem
+ , public Canvas
+{
friend class Painter;
public:
Widget(Widget* parent);
@@ -55,6 +61,11 @@ public:
virtual size_t width() override;
virtual size_t height() override;
+ // From Canvas
+ PixelBufferAlpha& GetPixelBuffer() override;
+ void beginPaint() override;
+ void endPaint() override;
+
virtual size_t windowX();
virtual size_t windowY();