Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 23640 Details for
Bug 36004
updated xft patch for fluxbox-0.9.6.ebuild
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
new patch
fluxbox-0.9.7-AA.patch (text/plain), 3.86 KB, created by
Ken Deeter
on 2004-01-11 18:12:09 UTC
(
hide
)
Description:
new patch
Filename:
MIME Type:
Creator:
Ken Deeter
Created:
2004-01-11 18:12:09 UTC
Size:
3.86 KB
patch
obsolete
>diff -uNr fluxbox-0.9.7-orig/src/FbTk/StringUtil.cc fluxbox-0.9.7/src/FbTk/StringUtil.cc >--- fluxbox-0.9.7-orig/src/FbTk/StringUtil.cc 2003-12-17 02:06:52.000000000 +0900 >+++ fluxbox-0.9.7/src/FbTk/StringUtil.cc 2004-01-04 17:29:04.000000000 +0900 >@@ -31,6 +31,11 @@ > #include <memory> > #include <algorithm> > >+#include <langinfo.h> >+#include <iconv.h> >+#include <errno.h> >+ >+ > using namespace std; > > namespace FbTk { >@@ -199,6 +204,31 @@ > return first_pos; > } > >+char *locale_to_utf8(const char *text) >+{ >+ static iconv_t conv = (iconv_t)-1; >+ char *utf_str, *from, *to; >+ size_t from_len, to_len; >+ size_t r; >+ if (conv == (iconv_t)-1) { >+ char *loc = strdup(nl_langinfo(CODESET)); >+ conv = iconv_open("UTF-8", loc); >+ delete [] loc; >+ } >+ from = (char *)text; >+ from_len = strlen(text); >+ to_len = from_len * 6 + 1; >+ utf_str = to = new char[to_len]; >+ r = iconv (conv, &from, &from_len, &to, &to_len); >+ // success or incomplete sequence >+ if (r != (size_t)-1 || errno == EINVAL) { >+ *to = '\0'; >+ return utf_str; >+ } >+ delete [] utf_str; >+ return strdup(text); >+} >+ > }; // end namespace StringUtil > > }; // end namespace FbTk >diff -uNr fluxbox-0.9.7-orig/src/FbTk/StringUtil.hh fluxbox-0.9.7/src/FbTk/StringUtil.hh >--- fluxbox-0.9.7-orig/src/FbTk/StringUtil.hh 2003-12-17 02:06:52.000000000 +0900 >+++ fluxbox-0.9.7/src/FbTk/StringUtil.hh 2004-01-04 17:29:46.000000000 +0900 >@@ -89,6 +89,8 @@ > } > } > >+char *locale_to_utf8(const char *text); >+ > } // end namespace StringUtil > > } // end namespace FbTk >diff -uNr fluxbox-0.9.7-orig/src/FbTk/XftFontImp.cc fluxbox-0.9.7/src/FbTk/XftFontImp.cc >--- fluxbox-0.9.7-orig/src/FbTk/XftFontImp.cc 2002-12-01 22:42:15.000000000 +0900 >+++ fluxbox-0.9.7/src/FbTk/XftFontImp.cc 2004-01-04 17:29:04.000000000 +0900 >@@ -22,6 +22,7 @@ > //$Id: XftFontImp.cc,v 1.2 2002/12/01 13:42:15 rathnor Exp $ > > #include "XftFontImp.hh" >+#include "StringUtil.hh" > #include "App.hh" > > #ifdef HAVE_CONFIG_H >@@ -98,15 +99,23 @@ > m_xftfont, > x, y, > (XftChar8 *)(text), len); >- } else >+ } else { >+ char *utf8_text = StringUtil::locale_to_utf8(text); >+ int utf8_len = strlen(utf8_text); >+ XftDrawStringUtf8(draw, >+ &xftcolor, >+ m_xftfont, >+ x, y, >+ (XftChar8 *)(utf8_text), utf8_len); >+ delete [] utf8_text; >+ } >+#else >+ XftDrawString8(draw, >+ &xftcolor, >+ m_xftfont, >+ x, y, >+ (XftChar8 *)(text), len); > #endif // HAVE_XFT_UTF8_STRING >- { >- XftDrawString8(draw, >- &xftcolor, >- m_xftfont, >- x, y, >- (XftChar8 *)(text), len); >- } > > XftColorFree(disp, DefaultVisual(disp, screen), > DefaultColormap(disp, screen), &xftcolor); >@@ -123,14 +132,21 @@ > m_xftfont, > (XftChar8 *)text, len, > &ginfo); >- } else >+ } else { >+ char *utf8_text = StringUtil::locale_to_utf8(text); >+ len = strlen(utf8_text); >+ XftTextExtentsUtf8(App::instance()->display(), >+ m_xftfont, >+ (XftChar8 *)utf8_text, len, >+ &ginfo); >+ delete [] utf8_text; >+ } >+#else >+ XftTextExtents8(App::instance()->display(), >+ m_xftfont, >+ (XftChar8 *)text, len, >+ &ginfo); > #endif //HAVE_XFT_UTF8_STRING >- { >- XftTextExtents8(App::instance()->display(), >- m_xftfont, >- (XftChar8 *)text, len, >- &ginfo); >- } > return ginfo.xOff; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 36004
:
22360
|
22362
| 23640