summaryrefslogtreecommitdiff
path: root/plugingui/widget.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2012-01-23 20:08:12 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2012-01-23 20:08:12 +0100
commitaf9c9091ed69394171485aa4c4814504f86f2004 (patch)
tree070b911dc8faed486c8e8829f0f41aec7d5b4350 /plugingui/widget.h
parent5e4cb10f72ef69d73fbd2c1bc42465c9111a4c41 (diff)
Simple image blit. New slider class. New filenamelineedit. New pixelbuffer used for drawing everything but the root window - with alpha blending...
Diffstat (limited to 'plugingui/widget.h')
-rw-r--r--plugingui/widget.h58
1 files changed, 38 insertions, 20 deletions
diff --git a/plugingui/widget.h b/plugingui/widget.h
index 9a3baa6..6f09533 100644
--- a/plugingui/widget.h
+++ b/plugingui/widget.h
@@ -29,40 +29,58 @@
#include <vector>
-class GlobalContext;
-class WidgetContext;
+#include "guievent.h"
+#include "pixelbuffer.h"
+#include <vector>
+
+namespace GUI {
-#include "event.h"
+class Window;
class Widget {
public:
- Widget(GlobalContext *gctx, Widget *parent);
- ~Widget();
+ Widget(Widget *parent);
+ virtual ~Widget();
+
+ virtual void show();
+ virtual void hide();
- void show();
- void hide();
+ virtual void resize(size_t width, size_t height);
+ virtual void move(size_t x, size_t y);
- void setSize(size_t width, size_t height);
- void move(size_t x, size_t y);
+ virtual size_t x();
+ virtual size_t y();
+ virtual size_t width();
+ virtual size_t height();
- size_t x();
- size_t y();
- size_t width();
- size_t height();
+ virtual bool isFocusable() { return false; }
+ virtual bool catchMouse() { return false; }
void addChild(Widget *widget);
- virtual void repaint(RepaintEvent *e) {}
- virtual void mouseMove(MouseMoveEvent *e) {}
- virtual void button(ButtonEvent *e) {}
- virtual void key(KeyEvent *e) {}
-
+ virtual void repaintEvent(RepaintEvent *e) {}
+ virtual void mouseMoveEvent(MouseMoveEvent *e) {}
+ virtual void buttonEvent(ButtonEvent *e) {}
+ virtual void keyEvent(KeyEvent *e) {}
+
+ Widget *find(size_t x, size_t y);
+
+ virtual Window *window();
+
+ void repaint_r(RepaintEvent *e);
+
+ PixelBufferAlpha pixbuf;
+ std::vector<PixelBufferAlpha *> getPixelBuffers();
+
+ bool hasKeyboardFocus();
+
protected:
- GlobalContext *gctx;
- WidgetContext *wctx;
std::vector<Widget*> children;
Widget *parent;
+ Window *_window;
size_t _x, _y, _width, _height;
};
+};
+
#endif/*__DRUMGIZMO_WIDGET_H__*/