aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Transparent.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/Transparent.cc
parent073065ac56b388db1169108d44f37d32f1d19c67 (diff)
downloadfluxbox-fff4456dee29e675d7f2ed3490db39bcb7e10e53.zip
fluxbox-fff4456dee29e675d7f2ed3490db39bcb7e10e53.tar.bz2
update NLS string handling...
Diffstat (limited to 'src/FbTk/Transparent.cc')
-rw-r--r--src/FbTk/Transparent.cc27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/FbTk/Transparent.cc b/src/FbTk/Transparent.cc
index ed50e9e..ab6b4d9 100644
--- a/src/FbTk/Transparent.cc
+++ b/src/FbTk/Transparent.cc
@@ -19,10 +19,11 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Transparent.cc,v 1.5 2003/05/13 20:50:56 fluxgen Exp $ 22// $Id: Transparent.cc,v 1.6 2004/06/07 11:46:05 rathnor Exp $
23 23
24#include "Transparent.hh" 24#include "Transparent.hh"
25#include "App.hh" 25#include "App.hh"
26#include "I18n.hh"
26 27
27#ifdef HAVE_CONFIG_H 28#ifdef HAVE_CONFIG_H
28#include "config.h" 29#include "config.h"
@@ -33,12 +34,14 @@
33#endif // HAVE_XRENDER 34#endif // HAVE_XRENDER
34 35
35#include <iostream> 36#include <iostream>
37#include <stdio.h>
36using namespace std; 38using namespace std;
37 39
38namespace { 40namespace {
39#ifdef HAVE_XRENDER 41#ifdef HAVE_XRENDER
40Picture createAlphaPic(Window drawable, unsigned char alpha) { 42Picture createAlphaPic(Window drawable, unsigned char alpha) {
41 Display *disp = FbTk::App::instance()->display(); 43 Display *disp = FbTk::App::instance()->display();
44 _FB_USES_NLS;
42 45
43 // try to find a specific render format 46 // try to find a specific render format
44 XRenderPictFormat pic_format; 47 XRenderPictFormat pic_format;
@@ -49,7 +52,7 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) {
49 PictFormatDepth | PictFormatAlphaMask, 52 PictFormatDepth | PictFormatAlphaMask,
50 &pic_format, 0); 53 &pic_format, 0);
51 if (format == 0) { 54 if (format == 0) {
52 cerr<<"Warning! FbTk::Transparent: Failed to find valid format for alpha."<<endl; 55 cerr<<"FbTk::Transparent: "<<_FBTKTEXT(Error, NoRenderFormat, "Warning: Failed to find valid format for alpha.", "transparency requires a pict format, can't get one...")<<endl;
53 return 0; 56 return 0;
54 } 57 }
55 58
@@ -57,7 +60,7 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) {
57 Pixmap alpha_pm = XCreatePixmap(disp, drawable, 60 Pixmap alpha_pm = XCreatePixmap(disp, drawable,
58 1, 1, 8); 61 1, 1, 8);
59 if (alpha_pm == 0) { 62 if (alpha_pm == 0) {
60 cerr<<"Warning! FbTk::Transparent: Failed to create alpha pixmap."<<endl; 63 cerr<<"FbTk::Transparent: "<<_FBTKTEXT(Error, NoRenderPixmap, "Warning: Failed to create alpha pixmap.", "XCreatePixmap files for our transparency pixmap")<<endl;
61 return 0; 64 return 0;
62 } 65 }
63 66
@@ -68,7 +71,7 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) {
68 format, CPRepeat, &attr); 71 format, CPRepeat, &attr);
69 if (alpha_pic == 0) { 72 if (alpha_pic == 0) {
70 XFreePixmap(disp, alpha_pm); 73 XFreePixmap(disp, alpha_pm);
71 cerr<<"Warning! FbTk::Transparent: Failed to create alpha picture."<<endl; 74 cerr<<"FbTk::Transparent: "<<_FBTKTEXT(Error, NoRenderPicture, "Warning: Failed to create alpha picture.", "XRenderCreatePicture failed")<<endl;
72 return 0; 75 return 0;
73 } 76 }
74 77
@@ -181,8 +184,12 @@ void Transparent::setDest(Drawable dest, int screen_num) {
181 XRenderPictFormat *format = 184 XRenderPictFormat *format =
182 XRenderFindVisualFormat(disp, 185 XRenderFindVisualFormat(disp,
183 DefaultVisual(disp, screen_num)); 186 DefaultVisual(disp, screen_num));
184 if (format == 0) 187 if (format == 0) {
185 cerr<<"Warning! FbTk::Transparent: Failed to find format for screen("<<screen_num<<")"<<endl; 188 _FB_USES_NLS;
189 cerr<<"FbTk::Transparent: ";
190 fprintf(stderr, _FBTKTEXT(Error, NoRenderVisualFormat, "Failed to find format for screen(%d)", "XRenderFindVisualFormat failed... include %d for screen number"), screen_num);
191 cerr<<endl;
192 }
186 m_dest_pic = XRenderCreatePicture(disp, dest, format, 0, 0); 193 m_dest_pic = XRenderCreatePicture(disp, dest, format, 0, 0);
187 194
188 195
@@ -216,8 +223,12 @@ void Transparent::setSource(Drawable source, int screen_num) {
216 XRenderPictFormat *format = 223 XRenderPictFormat *format =
217 XRenderFindVisualFormat(disp, 224 XRenderFindVisualFormat(disp,
218 DefaultVisual(disp, screen_num)); 225 DefaultVisual(disp, screen_num));
219 if (format == 0) 226 if (format == 0) {
220 cerr<<"Warning! FbTk::Transparent: Failed to find format for screen("<<screen_num<<")"<<endl; 227 _FB_USES_NLS;
228 cerr<<"FbTk::Transparent: ";
229 fprintf(stderr, _FBTKTEXT(Error, NoRenderVisualFormat, "Failed to find format for screen(%d)", "XRenderFindVisualFormat failed... include %d for screen number"), screen_num);
230 cerr<<endl;
231 }
221 m_src_pic = XRenderCreatePicture(disp, m_source, format, 232 m_src_pic = XRenderCreatePicture(disp, m_source, format,
222 0, 0); 233 0, 0);
223 } 234 }