aboutsummaryrefslogtreecommitdiff
path: root/src/Image.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-04-04 11:28:19 (GMT)
committerfluxgen <fluxgen>2002-04-04 11:28:19 (GMT)
commit2526e4bce821eedcd4bcc13e0f27ac7b9e255350 (patch)
treef86898efe146ecb882e597955e1e94b375154b19 /src/Image.cc
parentbd05695cfa6d066e5e5368d857eef8c0b11987c1 (diff)
downloadfluxbox_pavel-2526e4bce821eedcd4bcc13e0f27ac7b9e255350.zip
fluxbox_pavel-2526e4bce821eedcd4bcc13e0f27ac7b9e255350.tar.bz2
moved nls defines to enums in namespace FBNLS
Diffstat (limited to 'src/Image.cc')
-rw-r--r--src/Image.cc108
1 files changed, 32 insertions, 76 deletions
diff --git a/src/Image.cc b/src/Image.cc
index 0831517..9d3f044 100644
--- a/src/Image.cc
+++ b/src/Image.cc
@@ -25,7 +25,7 @@
25// stupid macros needed to access some functions in version 2 of the GNU C 25// stupid macros needed to access some functions in version 2 of the GNU C
26// library 26// library
27 27
28// $Id: Image.cc,v 1.6 2002/03/19 00:04:36 fluxgen Exp $ 28// $Id: Image.cc,v 1.7 2002/04/04 11:28:19 fluxgen Exp $
29 29
30//use GNU extensions 30//use GNU extensions
31#ifndef _GNU_SOURCE 31#ifndef _GNU_SOURCE
@@ -134,11 +134,7 @@ Pixmap BImage::render_solid(BTexture *texture) {
134 if (pixmap == None) { 134 if (pixmap == None) {
135 fprintf(stderr, 135 fprintf(stderr,
136 I18n::instance()->getMessage( 136 I18n::instance()->getMessage(
137#ifdef NLS 137 FBNLS::ImageSet, FBNLS::ImageErrorCreatingSolidPixmap,
138 ImageSet, ImageErrorCreatingSolidPixmap,
139#else // !NLS
140 0, 0,
141#endif // NLS
142 "BImage::render_solid: error creating pixmap\n")); 138 "BImage::render_solid: error creating pixmap\n"));
143 return None; 139 return None;
144 } 140 }
@@ -278,19 +274,15 @@ XImage *BImage::renderXImage(void) {
278 I18n *i18n = I18n::instance(); 274 I18n *i18n = I18n::instance();
279 XImage *image = 275 XImage *image =
280 XCreateImage(control->getBaseDisplay()->getXDisplay(), 276 XCreateImage(control->getBaseDisplay()->getXDisplay(),
281 control->getVisual(), control->getDepth(), ZPixmap, 0, 0, 277 control->getVisual(), control->getDepth(), ZPixmap, 0, 0,
282 width, height, 32, 0); 278 width, height, 32, 0);
283 279
284 if (! image) { 280 if (! image) {
285 fprintf(stderr, 281 fprintf(stderr,
286 i18n-> 282 i18n->
287 getMessage( 283 getMessage(
288#ifdef NLS 284 FBNLS::ImageSet, FBNLS::ImageErrorCreatingXImage,
289 ImageSet, ImageErrorCreatingXImage, 285 "BImage::renderXImage: error creating XImage\n"));
290#else // !NLS
291 0, 0,
292#endif // NLS
293 "BImage::renderXImage: error creating XImage\n"));
294 return (XImage *) 0; 286 return (XImage *) 0;
295 } 287 }
296 288
@@ -565,12 +557,8 @@ XImage *BImage::renderXImage(void) {
565 fprintf(stderr, 557 fprintf(stderr,
566 i18n-> 558 i18n->
567 getMessage( 559 getMessage(
568#ifdef NLS 560 FBNLS::ImageSet, FBNLS::ImageUnsupVisual,
569 ImageSet, ImageUnsupVisual, 561 "BImage::renderXImage: unsupported visual\n"));
570#else // !NLS
571 0, 0,
572#endif // NLS
573 "BImage::renderXImage: unsupported visual\n"));
574 delete [] d; 562 delete [] d;
575 XDestroyImage(image); 563 XDestroyImage(image);
576 return (XImage *) 0; 564 return (XImage *) 0;
@@ -672,7 +660,7 @@ XImage *BImage::renderXImage(void) {
672 fprintf(stderr, 660 fprintf(stderr,
673 i18n-> 661 i18n->
674 getMessage( 662 getMessage(
675 ImageSet, ImageUnsupVisual, 663 FBNLS::ImageSet, FBNLS::ImageUnsupVisual,
676 "BImage::renderXImage: unsupported visual\n")); 664 "BImage::renderXImage: unsupported visual\n"));
677 delete [] d; 665 delete [] d;
678 XDestroyImage(image); 666 XDestroyImage(image);
@@ -689,17 +677,13 @@ Pixmap BImage::renderPixmap(void) {
689 I18n *i18n = I18n::instance(); 677 I18n *i18n = I18n::instance();
690 Pixmap pixmap = 678 Pixmap pixmap =
691 XCreatePixmap(control->getBaseDisplay()->getXDisplay(), 679 XCreatePixmap(control->getBaseDisplay()->getXDisplay(),
692 control->getDrawable(), width, height, control->getDepth()); 680 control->getDrawable(), width, height, control->getDepth());
693 681
694 if (pixmap == None) { 682 if (pixmap == None) {
695 fprintf(stderr, 683 fprintf(stderr,
696 i18n->getMessage( 684 i18n->getMessage(
697#ifdef NLS 685 FBNLS::ImageSet, FBNLS::ImageErrorCreatingPixmap,
698 ImageSet, ImageErrorCreatingPixmap, 686 "BImage::renderPixmap: error creating pixmap\n"));
699#else // !NLS
700 0, 0,
701#endif // NLS
702 "BImage::renderPixmap: error creating pixmap\n"));
703 return None; 687 return None;
704 } 688 }
705 689
@@ -1939,15 +1923,11 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither,
1939 fprintf(stderr, 1923 fprintf(stderr,
1940 i18n-> 1924 i18n->
1941 getMessage( 1925 getMessage(
1942#ifdef NLS 1926 FBNLS::ImageSet, FBNLS::ImageInvalidColormapSize,
1943 ImageSet, ImageInvalidColormapSize, 1927 "BImageControl::BImageControl: invalid colormap size %d "
1944#else // !NLS 1928 "(%d/%d/%d) - reducing"),
1945 0, 0, 1929 ncolors, colors_per_channel, colors_per_channel,
1946#endif // NLS 1930 colors_per_channel);
1947 "BImageControl::BImageControl: invalid colormap size %d "
1948 "(%d/%d/%d) - reducing"),
1949 ncolors, colors_per_channel, colors_per_channel,
1950 colors_per_channel);
1951 1931
1952 colors_per_channel = (1 << screen_depth) / 3; 1932 colors_per_channel = (1 << screen_depth) / 3;
1953 } 1933 }
@@ -1957,13 +1937,9 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither,
1957 fprintf(stderr, 1937 fprintf(stderr,
1958 i18n-> 1938 i18n->
1959 getMessage( 1939 getMessage(
1960#ifdef NLS 1940 FBNLS::ImageSet, FBNLS::ImageErrorAllocatingColormap,
1961 ImageSet, ImageErrorAllocatingColormap, 1941 "BImageControl::BImageControl: error allocating "
1962#else // !NLS 1942 "colormap\n"));
1963 0, 0,
1964#endif // NLS
1965 "BImageControl::BImageControl: error allocating "
1966 "colormap\n"));
1967 throw static_cast<int>(1); //throw exit code 1 1943 throw static_cast<int>(1); //throw exit code 1
1968 } 1944 }
1969 1945
@@ -1996,11 +1972,7 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither,
1996 if (! XAllocColor(basedisplay->getXDisplay(), colormap, &colors[i])) { 1972 if (! XAllocColor(basedisplay->getXDisplay(), colormap, &colors[i])) {
1997 fprintf(stderr, 1973 fprintf(stderr,
1998 i18n->getMessage( 1974 i18n->getMessage(
1999#ifdef NLS 1975 FBNLS::ImageSet, FBNLS::ImageColorAllocFail,
2000 ImageSet, ImageColorAllocFail,
2001#else // !NLS
2002 0, 0,
2003#endif // NLS
2004 "couldn't alloc color %i %i %i\n"), 1976 "couldn't alloc color %i %i %i\n"),
2005 colors[i].red, colors[i].green, colors[i].blue); 1977 colors[i].red, colors[i].green, colors[i].blue);
2006 colors[i].flags = 0; 1978 colors[i].flags = 0;
@@ -2071,11 +2043,7 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither,
2071 fprintf(stderr, 2043 fprintf(stderr,
2072 i18n-> 2044 i18n->
2073 getMessage( 2045 getMessage(
2074#ifdef NLS 2046 FBNLS::ImageSet, FBNLS::ImageInvalidColormapSize,
2075 ImageSet, ImageInvalidColormapSize,
2076#else // !NLS
2077 0, 0,
2078#endif // NLS
2079 "BImageControl::BImageControl: invalid colormap size %d " 2047 "BImageControl::BImageControl: invalid colormap size %d "
2080 "(%d/%d/%d) - reducing"), 2048 "(%d/%d/%d) - reducing"),
2081 ncolors, colors_per_channel, colors_per_channel, 2049 ncolors, colors_per_channel, colors_per_channel,
@@ -2089,11 +2057,7 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither,
2089 fprintf(stderr, 2057 fprintf(stderr,
2090 i18n-> 2058 i18n->
2091 getMessage( 2059 getMessage(
2092#ifdef NLS 2060 FBNLS::ImageSet, FBNLS::ImageErrorAllocatingColormap,
2093 ImageSet, ImageErrorAllocatingColormap,
2094#else // !NLS
2095 0, 0,
2096#endif // NLS
2097 "BImageControl::BImageControl: error allocating " 2061 "BImageControl::BImageControl: error allocating "
2098 "colormap\n")); 2062 "colormap\n"));
2099 throw static_cast<int>(1); // throw exit code 1 2063 throw static_cast<int>(1); // throw exit code 1
@@ -2118,11 +2082,7 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither,
2118 fprintf(stderr, 2082 fprintf(stderr,
2119 i18n-> 2083 i18n->
2120 getMessage( 2084 getMessage(
2121#ifdef NLS 2085 FBNLS::ImageSet, FBNLS::ImageColorAllocFail,
2122 ImageSet, ImageColorAllocFail,
2123#else // !NLS
2124 0, 0,
2125#endif // NLS
2126 "couldn't alloc color %i %i %i\n"), 2086 "couldn't alloc color %i %i %i\n"),
2127 colors[i].red, colors[i].green, colors[i].blue); 2087 colors[i].red, colors[i].green, colors[i].blue);
2128 colors[i].flags = 0; 2088 colors[i].flags = 0;
@@ -2178,12 +2138,8 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither,
2178 fprintf(stderr, 2138 fprintf(stderr,
2179 i18n-> 2139 i18n->
2180 getMessage( 2140 getMessage(
2181#ifdef NLS 2141 FBNLS::ImageSet, FBNLS::ImageUnsupVisual,
2182 ImageSet, ImageUnsupVisual, 2142 "BImageControl::BImageControl: unsupported visual %d\n"),
2183#else // !NLS
2184 0, 0,
2185#endif // NLS
2186 "BImageControl::BImageControl: unsupported visual %d\n"),
2187 getVisual()->c_class); 2143 getVisual()->c_class);
2188 throw static_cast<int>(1); //throw error code 1 2144 throw static_cast<int>(1); //throw error code 1
2189 2145
@@ -2219,10 +2175,10 @@ BImageControl::~BImageControl(void) {
2219 if (cache.size() > 0) { 2175 if (cache.size() > 0) {
2220 fprintf(stderr, 2176 fprintf(stderr,
2221 I18n::instance()-> 2177 I18n::instance()->
2222 getMessage( 2178 getMessage(
2223 ImageSet, ImagePixmapRelease, 2179 FBNLS::ImageSet, FBNLS::ImagePixmapRelease,
2224 "BImageContol::~BImageControl: pixmap cache - " 2180 "BImageContol::~BImageControl: pixmap cache - "
2225 "releasing %d pixmaps\n"), cache.size()); 2181 "releasing %d pixmaps\n"), cache.size());
2226 2182
2227 CacheList::iterator it = cache.begin(); 2183 CacheList::iterator it = cache.begin();
2228 CacheList::iterator it_end = cache.end(); 2184 CacheList::iterator it_end = cache.end();
@@ -2294,7 +2250,7 @@ Pixmap BImageControl::renderImage(unsigned int width, unsigned int height,
2294 fprintf(stderr, 2250 fprintf(stderr,
2295 I18n::instance()-> 2251 I18n::instance()->
2296 getMessage( 2252 getMessage(
2297 ImageSet, ImagePixmapCacheLarge, 2253 FBNLS::ImageSet, FBNLS::ImagePixmapCacheLarge,
2298 "BImageControl::renderImage: cache is large, " 2254 "BImageControl::renderImage: cache is large, "
2299 "forcing cleanout\n")); 2255 "forcing cleanout\n"));
2300#endif // DEBUG 2256#endif // DEBUG