From 3e85cc8bfccf63236e815eba64acd99fbe154daf Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 18 Oct 2011 14:49:43 +0200 Subject: New Label and LED widgets. --- plugingui/painter.cc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'plugingui/painter.cc') diff --git a/plugingui/painter.cc b/plugingui/painter.cc index 3002c99..e207811 100644 --- a/plugingui/painter.cc +++ b/plugingui/painter.cc @@ -87,6 +87,31 @@ void Painter::drawText(int x, int y, std::string text) #endif/*X11*/ } +void Painter::drawPoint(int x, int y) +{ +#ifdef X11 + XDrawPoint(gctx->display, wctx->window, wctx->gc, x, y); +#endif/*X11*/ +} + +void Painter::drawCircle(int x, int y, int r) +{ +#ifdef X11 + XDrawArc(gctx->display, wctx->window, wctx->gc, x, y, r, r, 0, 360 * 64); +#endif/*X11*/ +} + +void Painter::drawFilledCircle(int x, int y, int r) +{ +#ifdef X11 + r *= 2; + for(int s = 1; s < r; s++) + XDrawArc(gctx->display, wctx->window, wctx->gc, + x - s / 2, y - s / 2, s, s, + 0, 360 * 64); +#endif/*X11*/ +} + void Painter::flush() { #ifdef X11 -- cgit v1.2.3