X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Frendercontrol.cc;h=8f9329688c04c4f09fffdd9db6967f466999c947;hb=d2dcef46752df01312cbb3c5a89b3227c6959087;hp=90f99632426efb8db566ce2c58252ae45beeb1ae;hpb=8446eaedc7d42e54c9719ee0b2c115f5feab09ca;p=chaz%2Fopenbox diff --git a/otk/rendercontrol.cc b/otk/rendercontrol.cc index 90f99632..8f932968 100644 --- a/otk/rendercontrol.cc +++ b/otk/rendercontrol.cc @@ -13,16 +13,23 @@ #include "surface.hh" #include "font.hh" #include "ustring.hh" +#include "property.hh" extern "C" { -#ifdef HAVE_STDLIB_H -# include -#endif // HAVE_STDLIB_H +#ifdef HAVE_SYS_WAIT_H +# include +#endif // HAVE_SYS_WAIT_H + +#ifdef HAVE_UNISTD_H +# include +#endif // HAVE_UNISTD_H #include "../src/gettext.h" #define _(str) gettext(str) } +#include + namespace otk { RenderControl *RenderControl::getRenderControl(int screen) @@ -47,8 +54,10 @@ RenderControl *RenderControl::getRenderControl(int screen) RenderControl::RenderControl(int screen) : _screen(screen) + { printf("Initializing RenderControl\n"); + } RenderControl::~RenderControl() @@ -56,13 +65,6 @@ RenderControl::~RenderControl() printf("Destroying RenderControl\n"); } -void RenderControl::drawRoot(const RenderColor &color) const -{ - Window root = display->screenInfo(_screen)->rootWindow(); - XSetWindowBackground(**display, root, color.pixel()); - XClearWindow(**display, root); -} - void RenderControl::drawString(Surface& sf, const Font &font, int x, int y, const RenderColor &color, const ustring &string) const @@ -285,12 +287,7 @@ void RenderControl::drawGradientBackground( } reduceDepth(sf, im); - - im->data = (char*) data; - sf.setPixmap(im); - - im->data = NULL; XDestroyImage(im); } @@ -451,7 +448,7 @@ void RenderControl::drawImage(Surface &sf, int w, int h, if (x < 0) x = 0; if (y < 0) y = 0; - // XXX SCALING!@!&*(@! to make it fit on the surface + // Reduce the image size if its too big to make it fit on the surface int oldw = w, oldh = h; unsigned long *olddata = data; if (w > sfw) w = sfw; @@ -507,12 +504,7 @@ void RenderControl::drawImage(Surface &sf, int w, int h, im->byte_order = endian; reduceDepth(sf, im); - - im->data = (char*) bg; - sf.setPixmap(im); - - im->data = NULL; XDestroyImage(im); }