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/painter.h | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'plugingui/painter.h') diff --git a/plugingui/painter.h b/plugingui/painter.h index f114c21..c9fd60d 100644 --- a/plugingui/painter.h +++ b/plugingui/painter.h @@ -29,14 +29,30 @@ #include +#include "widget.h" #include "colour.h" +#include "pixelbuffer.h" +#include "font.h" -class GlobalContext; -class WidgetContext; +namespace GUI { +struct __img__ { + size_t width; + size_t height; + unsigned int pixels[128000]; + unsigned int order; +}; +/* +struct __img__ { + size_t width; + size_t height; + unsigned int *pixels; + unsigned int order; +}; +*/ class Painter { public: - Painter(GlobalContext *gctx, WidgetContext *wctx); + Painter(Widget *widget); ~Painter(); void flush(); @@ -44,18 +60,20 @@ public: void setColour(Colour colour); void drawLine(int x1, int y1, int x2, int y2); - void drawText(int x, int y, std::string text); + void drawText(int x, int y, Font &font, std::string text); void drawRectangle(int x1, int y1, int x2, int y2); void drawFilledRectangle(int x1, int y1, int x2, int y2); void drawPoint(int x, int y); void drawCircle(int x, int y, int r); void drawFilledCircle(int x, int y, int r); + void drawImage(int x, int y, struct __img__ * img); private: - GlobalContext *gctx; - WidgetContext *wctx; + Widget *widget; + PixelBufferAlpha *pixbuf; Colour colour; }; +}; #endif/*__DRUMGIZMO_PAINTER_H__*/ -- cgit v1.2.3