aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/TextureRender.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-06-07 11:46:05 (GMT)
committerrathnor <rathnor>2004-06-07 11:46:05 (GMT)
commitfff4456dee29e675d7f2ed3490db39bcb7e10e53 (patch)
tree2d2dbf386551773cbdc8231b2a93b493187bd733 /src/FbTk/TextureRender.cc
parent073065ac56b388db1169108d44f37d32f1d19c67 (diff)
downloadfluxbox_pavel-fff4456dee29e675d7f2ed3490db39bcb7e10e53.zip
fluxbox_pavel-fff4456dee29e675d7f2ed3490db39bcb7e10e53.tar.bz2
update NLS string handling...
Diffstat (limited to 'src/FbTk/TextureRender.cc')
-rw-r--r--src/FbTk/TextureRender.cc31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/FbTk/TextureRender.cc b/src/FbTk/TextureRender.cc
index 3e56e88..6f496d7 100644
--- a/src/FbTk/TextureRender.cc
+++ b/src/FbTk/TextureRender.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: TextureRender.cc,v 1.8 2004/01/21 20:19:50 fluxgen Exp $ 25// $Id: TextureRender.cc,v 1.9 2004/06/07 11:46:05 rathnor Exp $
26 26
27#include "TextureRender.hh" 27#include "TextureRender.hh"
28 28
@@ -30,6 +30,7 @@
30#include "App.hh" 30#include "App.hh"
31#include "FbPixmap.hh" 31#include "FbPixmap.hh"
32#include "GContext.hh" 32#include "GContext.hh"
33#include "I18n.hh"
33 34
34#include <iostream> 35#include <iostream>
35#include <string> 36#include <string>
@@ -46,16 +47,17 @@ TextureRender::TextureRender(ImageControl &imgctrl,
46 ncolors(ncolors), 47 ncolors(ncolors),
47 xtable(0), ytable(0) { 48 xtable(0), ytable(0) {
48 49
50 _FB_USES_NLS;
49 width = ((signed) w > 0) ? w : 1; 51 width = ((signed) w > 0) ? w : 1;
50 height = ((signed) h > 0) ? h : 1; 52 height = ((signed) h > 0) ? h : 1;
51 // clamp to "normal" size 53 // clamp to "normal" size
52 if (width > 3200) { 54 if (width > 3200) {
53 cerr<<"TextureRender: Warning! Width > 3200 setting Width = 3200"<<endl; 55 cerr<<"TextureRender: "<<_FBTKTEXT(Error, BigWidth, "Warning! Width > 3200 setting Width = 3200", "Image width seems too big, clamping")<<endl;
54 width = 3200; 56 width = 3200;
55 } 57 }
56 58
57 if (height > 3200) { 59 if (height > 3200) {
58 cerr<<"TextureRender: Warning! Height > 3200 setting Height = 3200"<<endl; 60 cerr<<"TextureRender: "<<_FBTKTEXT(Error, BigHeight, "Warning! Height > 3200 setting Height = 3200", "Image height seems too big, clamping")<<endl;
59 height = 3200; 61 height = 3200;
60 } 62 }
61 63
@@ -63,7 +65,7 @@ TextureRender::TextureRender(ImageControl &imgctrl,
63 if (red == 0) { 65 if (red == 0) {
64 char sbuf[128]; 66 char sbuf[128];
65 sprintf(sbuf, "%d", width*height); 67 sprintf(sbuf, "%d", width*height);
66 throw string("TextureRender::TextureRender(): Out of memory while allocating red buffer."+ string(sbuf)); 68 throw string("TextureRender::TextureRender(): " + string(_FBTKTEXT(Error, OutOfMemoryRed, "Out of memory while allocating red buffer.", "")) + string(sbuf));
67 } 69 }
68 70
69 71
@@ -71,14 +73,14 @@ TextureRender::TextureRender(ImageControl &imgctrl,
71 if (green == 0) { 73 if (green == 0) {
72 char sbuf[128]; 74 char sbuf[128];
73 sprintf(sbuf, "%d", width*height); 75 sprintf(sbuf, "%d", width*height);
74 throw string("TextureRender::TextureRender(): Out of memory while allocating green buffer. size " + string(sbuf)); 76 throw string("TextureRender::TextureRender(): " +string(_FBTKTEXT(Error, OutOfMemoryGreen, "Out of memory while allocating green buffer.", ""))+ string(sbuf));
75 } 77 }
76 78
77 blue = new(nothrow) unsigned char[width * height]; 79 blue = new(nothrow) unsigned char[width * height];
78 if (blue == 0) { 80 if (blue == 0) {
79 char sbuf[128]; 81 char sbuf[128];
80 sprintf(sbuf, "%d", width*height); 82 sprintf(sbuf, "%d", width*height);
81 throw string("TextureRender::TextureRender(): Out of memory while allocating blue buffer. size " + string(sbuf)); 83 throw string("TextureRender::TextureRender(): " +string(_FBTKTEXT(Error, OutOfMemoryBlue, "Out of memory while allocating blue buffer.", ""))+ string(sbuf));
82 } 84 }
83 85
84 cpc = imgctrl.colorsPerChannel(); 86 cpc = imgctrl.colorsPerChannel();
@@ -120,7 +122,8 @@ Pixmap TextureRender::renderSolid(const FbTk::Texture &texture) {
120 control.depth()); 122 control.depth());
121 123
122 if (pixmap.drawable() == None) { 124 if (pixmap.drawable() == None) {
123 cerr<<"FbTk::TextureRender::render_solid(): error creating pixmap"<<endl; 125 _FB_USES_NLS;
126 cerr<<"FbTk::TextureRender::render_solid(): "<<_FBTKTEXT(Error, CreatePixmap, "Error creating pixmap", "Couldn't create a pixmap - image - for some reason")<<endl;
124 return None; 127 return None;
125 } 128 }
126 129
@@ -274,7 +277,8 @@ XImage *TextureRender::renderXImage() {
274 width, height, 32, 0); 277 width, height, 32, 0);
275 278
276 if (! image) { 279 if (! image) {
277 cerr<<"FbTk::TextureRender::renderXImage(): error creating XImage"<<endl; 280 _FB_USES_NLS;
281 cerr<<"FbTk::TextureRender::renderXImage(): "<<_FBTKTEXT(Error, CreateXImage, "Error creating XImage", "Couldn't create an XImage")<<endl;
278 return 0; 282 return 0;
279 } 283 }
280 284
@@ -545,7 +549,9 @@ XImage *TextureRender::renderXImage() {
545 */ 549 */
546 550
547 default: 551 default:
548 cerr<<"TextureRender::renderXImage(): unsupported visual"<<endl; 552 _FB_USES_NLS;
553 cerr<<"TextureRender::renderXImage(): "<<
554 _FBTKTEXT(Error, UnsupportedVisual, "unsupported visual", "A visual is a technical term in X")<<endl;
549 delete [] d; 555 delete [] d;
550 XDestroyImage(image); 556 XDestroyImage(image);
551 return (XImage *) 0; 557 return (XImage *) 0;
@@ -644,7 +650,9 @@ XImage *TextureRender::renderXImage() {
644 break; 650 break;
645 651
646 default: 652 default:
647 cerr<<"TextureRender::renderXImage(): unsupported visual"<<endl; 653 _FB_USES_NLS;
654 cerr<<"TextureRender::renderXImage(): "<<
655 _FBTKTEXT(Error, UnsupportedVisual, "unsupported visual", "A visual is a technical term in X")<<endl;
648 delete [] d; 656 delete [] d;
649 XDestroyImage(image); 657 XDestroyImage(image);
650 return (XImage *) 0; 658 return (XImage *) 0;
@@ -662,7 +670,8 @@ Pixmap TextureRender::renderPixmap() {
662 width, height, control.depth()); 670 width, height, control.depth());
663 671
664 if (pixmap.drawable() == None) { 672 if (pixmap.drawable() == None) {
665 cerr<<"TextureRender::renderPixmap(): error creating pixmap"<<endl; 673 _FB_USES_NLS;
674 cerr<<"FbTk::TextureRender::renderPixmap(): "<<_FBTKTEXT(Error, CreatePixmap, "Error creating pixmap", "Couldn't create a pixmap - image - for some reason")<<endl;
666 return None; 675 return None;
667 } 676 }
668 677