diff options
Diffstat (limited to 'plugingui/painter.h')
-rw-r--r-- | plugingui/painter.h | 87 |
1 files changed, 39 insertions, 48 deletions
diff --git a/plugingui/painter.h b/plugingui/painter.h index 0a93f50..78f1560 100644 --- a/plugingui/painter.h +++ b/plugingui/painter.h @@ -24,8 +24,7 @@ * along with DrumGizmo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifndef __DRUMGIZMO_PAINTER_H__ -#define __DRUMGIZMO_PAINTER_H__ +#pragma once #include <string> @@ -39,59 +38,51 @@ namespace GUI { class Painter { public: - Painter(Widget *widget); - ~Painter(); + Painter(Widget& widget); + ~Painter(); - void flush(); + void flush(); - void setColour(Colour colour); + void setColour(const Colour& colour); - void drawLine(int x1, int y1, int x2, int y2); - void drawText(int x, int y, Font &font, std::string text, - bool nocolour = false); - 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, double r); - void drawFilledCircle(int x, int y, int r); - void drawImage(int x, int y, Image *image); - void drawImageStretched(int x0, int y0, GUI::Image *image, - int width, int height); + void drawLine(int x1, int y1, int x2, int y2); + void drawText(int x, int y, const Font& font, const std::string& text, + bool nocolour = false); + 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, double r); + void drawFilledCircle(int x, int y, int r); + void drawImage(int x, int y, const Image& image); + void drawImageStretched(int x, int y, const Image& image, + int width, int height); - typedef struct { - Image *topLeft; - Image *top; - Image *topRight; - Image *left; - Image *right; - Image *bottomLeft; - Image *bottom; - Image *bottomRight; - Image *center; - } Box; - void drawBox(int x, int y, Box *box, int width, int height); + typedef struct { + Image* topLeft; + Image* top; + Image* topRight; + Image* left; + Image* right; + Image* bottomLeft; + Image* bottom; + Image* bottomRight; + Image* center; + } Box; + void drawBox(int x, int y, const Box& box, int width, int height); - typedef struct { - Image *left; - Image *right; - Image *center; - } Bar; - void drawBar(int x, int y, Bar *bar, int width, int height); + typedef struct { + Image* left; + Image* right; + Image* center; + } Bar; + void drawBar(int x, int y, const Bar& bar, int width, int height); - void clear(); + void clear(); private: - void plot(int x, int y, double c); - double ipart(double x); - double round(double x); - double fpart(double x); - double rfpart(double x); - - Widget *widget; - PixelBufferAlpha *pixbuf; - Colour colour; -}; - + Widget& widget; + PixelBufferAlpha* pixbuf; + Colour colour; }; -#endif/*__DRUMGIZMO_PAINTER_H__*/ +} // GUI:: |