summaryrefslogtreecommitdiff
path: root/src/imagecontrol.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/imagecontrol.cc')
-rw-r--r--src/imagecontrol.cc44
1 files changed, 14 insertions, 30 deletions
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();
}