From af9c9091ed69394171485aa4c4814504f86f2004 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 23 Jan 2012 20:08:12 +0100 Subject: Simple image blit. New slider class. New filenamelineedit. New pixelbuffer used for drawing everything but the root window - with alpha blending... --- plugingui/widget.h | 58 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 20 deletions(-) (limited to 'plugingui/widget.h') 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 -class GlobalContext; -class WidgetContext; +#include "guievent.h" +#include "pixelbuffer.h" +#include + +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 getPixelBuffers(); + + bool hasKeyboardFocus(); + protected: - GlobalContext *gctx; - WidgetContext *wctx; std::vector children; Widget *parent; + Window *_window; size_t _x, _y, _width, _height; }; +}; + #endif/*__DRUMGIZMO_WIDGET_H__*/ -- cgit v1.2.3