X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fimagecontrol.cc;h=a7d85e2aed9b2dbe3c748f8f0c707943292e4ad3;hb=7bf96a9123a9f6b29a4c6168f7391db72f374f8a;hp=159e02fd6328aea1b352645ebfd17c9fd831e6b8;hpb=0caf2ba9315336aa5206d8f5f28facf14f3ff34d;p=chaz%2Fopenbox diff --git a/src/imagecontrol.cc b/src/imagecontrol.cc index 159e02fd..a7d85e2a 100644 --- a/src/imagecontrol.cc +++ b/src/imagecontrol.cc @@ -73,7 +73,6 @@ BImageControl::BImageControl(BaseDisplay *dpy, const ScreenInfo *scrn, setColorsPerChannel(_cpc); cache_max = cmax; -#ifdef TIMEDCACHE if (cache_timeout) { timer = new BTimer(basedisplay, this); timer->setTimeout(cache_timeout); @@ -81,7 +80,6 @@ BImageControl::BImageControl(BaseDisplay *dpy, const ScreenInfo *scrn, } else { timer = (BTimer *) 0; } -#endif // TIMEDCACHE colors = (XColor *) 0; ncolors = 0; @@ -151,9 +149,8 @@ BImageControl::BImageControl(BaseDisplay *dpy, const ScreenInfo *scrn, if (colors_per_channel < 2 || ncolors > (1 << screen_depth)) { fprintf(stderr, - i18n(ImageSet, ImageInvalidColormapSize, - "BImageControl::BImageControl: invalid colormap size %d " - "(%d/%d/%d) - reducing"), + "BImageControl::BImageControl: invalid colormap size %d " + "(%d/%d/%d) - reducing", ncolors, colors_per_channel, colors_per_channel, colors_per_channel); @@ -162,9 +159,8 @@ BImageControl::BImageControl(BaseDisplay *dpy, const ScreenInfo *scrn, colors = new XColor[ncolors]; if (! colors) { - fprintf(stderr, i18n(ImageSet, ImageErrorAllocatingColormap, - "BImageControl::BImageControl: error allocating " - "colormap\n")); + fprintf(stderr, "BImageControl::BImageControl: error allocating " + "colormap\n"); exit(1); } @@ -193,8 +189,7 @@ BImageControl::BImageControl(BaseDisplay *dpy, const ScreenInfo *scrn, for (i = 0; i < ncolors; i++) { if (! XAllocColor(basedisplay->getXDisplay(), colormap, &colors[i])) { - fprintf(stderr, i18n(ImageSet, ImageColorAllocFail, - "couldn't alloc color %i %i %i\n"), + fprintf(stderr, "couldn't alloc color %i %i %i\n", colors[i].red, colors[i].green, colors[i].blue); colors[i].flags = 0; } else { @@ -259,9 +254,8 @@ BImageControl::BImageControl(BaseDisplay *dpy, const ScreenInfo *scrn, if (colors_per_channel < 2 || ncolors > (1 << screen_depth)) { fprintf(stderr, - i18n(ImageSet, ImageInvalidColormapSize, - "BImageControl::BImageControl: invalid colormap size %d " - "(%d/%d/%d) - reducing"), + "BImageControl::BImageControl: invalid colormap size %d " + "(%d/%d/%d) - reducing", ncolors, colors_per_channel, colors_per_channel, colors_per_channel); @@ -271,8 +265,7 @@ BImageControl::BImageControl(BaseDisplay *dpy, const ScreenInfo *scrn, colors = new XColor[ncolors]; if (! colors) { fprintf(stderr, - i18n(ImageSet, ImageErrorAllocatingColormap, - "BImageControl::BImageControl: error allocating colormap\n")); + "BImageControl::BImageControl: error allocating colormap\n"); exit(1); } @@ -291,8 +284,7 @@ BImageControl::BImageControl(BaseDisplay *dpy, const ScreenInfo *scrn, if (! XAllocColor(basedisplay->getXDisplay(), colormap, &colors[i])) { - fprintf(stderr, i18n(ImageSet, ImageColorAllocFail, - "couldn't alloc color %i %i %i\n"), + fprintf(stderr, "couldn't alloc color %i %i %i\n", colors[i].red, colors[i].green, colors[i].blue); colors[i].flags = 0; } else { @@ -343,9 +335,7 @@ BImageControl::BImageControl(BaseDisplay *dpy, const ScreenInfo *scrn, } default: - fprintf(stderr, - i18n(ImageSet, ImageUnsupVisual, - "BImageControl::BImageControl: unsupported visual %d\n"), + fprintf(stderr, "BImageControl::BImageControl: unsupported visual %d\n", getVisual()->c_class); exit(1); } @@ -372,21 +362,18 @@ BImageControl::~BImageControl(void) { if (! cache.empty()) { //#ifdef DEBUG - fprintf(stderr, i18n(ImageSet, ImagePixmapRelease, - "BImageContol::~BImageControl: pixmap cache - " - "releasing %d pixmaps\n"), cache.size()); + fprintf(stderr, "BImageContol::~BImageControl: pixmap cache - " + "releasing %d pixmaps\n", cache.size()); //#endif CacheContainer::iterator it = cache.begin(); const CacheContainer::iterator end = cache.end(); for (; it != end; ++it) XFreePixmap(basedisplay->getXDisplay(), it->pixmap); } -#ifdef TIMEDCACHE if (timer) { timer->stop(); delete timer; } -#endif // TIMEDCACHE } @@ -449,9 +436,8 @@ Pixmap BImageControl::renderImage(unsigned int width, unsigned int height, if (cache.size() > cache_max) { #ifdef DEBUG - fprintf(stderr, i18n(ImageSet, ImagePixmapCacheLarge, - "BImageControl::renderImage: cache is large, " - "forcing cleanout\n")); + fprintf(stderr, "BImageControl::renderImage: cache is large, " + "forcing cleanout\n"); #endif // DEBUG timeout(); @@ -473,9 +459,7 @@ void BImageControl::removeImage(Pixmap pixmap) { tmp.count--; } -#ifdef TIMEDCACHE if (! timer) -#endif // TIMEDCACHE timeout(); }