diff options
author | fluxgen <fluxgen> | 2004-08-31 20:27:08 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-08-31 20:27:08 (GMT) |
commit | 9121ec43af44863c96aaedbb8cdc72047f72656a (patch) | |
tree | 8b47c297b7352a043c3be9358c3a63c35b79ff71 /src/FbTk | |
parent | c37b8ec735c0f9f4782e354fec1be2f8ab053509 (diff) | |
download | fluxbox-9121ec43af44863c96aaedbb8cdc72047f72656a.zip fluxbox-9121ec43af44863c96aaedbb8cdc72047f72656a.tar.bz2 |
checking for have iconv
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/Font.cc | 11 | ||||
-rw-r--r-- | src/FbTk/Font.hh | 10 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/FbTk/Font.cc b/src/FbTk/Font.cc index 774e92a..8ba5a0a 100644 --- a/src/FbTk/Font.cc +++ b/src/FbTk/Font.cc | |||
@@ -19,7 +19,7 @@ | |||
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: Font.cc,v 1.14 2004/08/31 15:26:39 rathnor Exp $ | 22 | //$Id: Font.cc,v 1.15 2004/08/31 20:27:08 fluxgen Exp $ |
23 | 23 | ||
24 | 24 | ||
25 | #include "StringUtil.hh" | 25 | #include "StringUtil.hh" |
@@ -94,6 +94,7 @@ namespace { | |||
94 | #include <locale.h> | 94 | #include <locale.h> |
95 | #endif //HAVE_SETLOCALE | 95 | #endif //HAVE_SETLOCALE |
96 | 96 | ||
97 | #ifdef HAVE_ICONV | ||
97 | /** | 98 | /** |
98 | Recodes the text from one encoding to another | 99 | Recodes the text from one encoding to another |
99 | assuming cd is correct | 100 | assuming cd is correct |
@@ -103,7 +104,7 @@ namespace { | |||
103 | @return the recoded string, or 0 on failure | 104 | @return the recoded string, or 0 on failure |
104 | */ | 105 | */ |
105 | char* recode(iconv_t cd, | 106 | char* recode(iconv_t cd, |
106 | const char *msg, size_t size) { | 107 | const char *msg, size_t size) { |
107 | 108 | ||
108 | // If empty message, yes this can happen, return | 109 | // If empty message, yes this can happen, return |
109 | if(strlen(msg) == 0 || size == 0) | 110 | if(strlen(msg) == 0 || size == 0) |
@@ -140,7 +141,13 @@ char* recode(iconv_t cd, | |||
140 | 141 | ||
141 | return new_msg_ptr; | 142 | return new_msg_ptr; |
142 | } | 143 | } |
144 | #else | ||
143 | 145 | ||
146 | char *recode(iconv_t cd, | ||
147 | const char *msg, size_t size) { | ||
148 | return 0; | ||
149 | } | ||
150 | #endif // HAVE_ICONV | ||
144 | 151 | ||
145 | int extract_halo_options(const std::string& opts, std::string& color) { | 152 | int extract_halo_options(const std::string& opts, std::string& color) { |
146 | std::list< std::string > tokens; | 153 | std::list< std::string > tokens; |
diff --git a/src/FbTk/Font.hh b/src/FbTk/Font.hh index d994acf..71d560c 100644 --- a/src/FbTk/Font.hh +++ b/src/FbTk/Font.hh | |||
@@ -19,7 +19,7 @@ | |||
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: Font.hh,v 1.10 2004/08/18 16:30:33 rathnor Exp $ | 22 | //$Id: Font.hh,v 1.11 2004/08/31 20:27:08 fluxgen Exp $ |
23 | 23 | ||
24 | #ifndef FBTK_FONT_HH | 24 | #ifndef FBTK_FONT_HH |
25 | #define FBTK_FONT_HH | 25 | #define FBTK_FONT_HH |
@@ -30,7 +30,13 @@ | |||
30 | #include <string> | 30 | #include <string> |
31 | #include <memory> | 31 | #include <memory> |
32 | 32 | ||
33 | #ifdef HAVE_CONFIG_H | ||
34 | #include "config.h" | ||
35 | #endif // HAVE_CONFIG_H | ||
36 | |||
37 | #ifdef HAVE_ICONV | ||
33 | #include <iconv.h> | 38 | #include <iconv.h> |
39 | #endif // HAVE_ICONV | ||
34 | 40 | ||
35 | namespace FbTk { | 41 | namespace FbTk { |
36 | 42 | ||
@@ -111,7 +117,9 @@ private: | |||
111 | int m_shadow_offy; ///< offset x for shadow | 117 | int m_shadow_offy; ///< offset x for shadow |
112 | bool m_halo; ///< halo text | 118 | bool m_halo; ///< halo text |
113 | std::string m_halo_color; ///< halo color | 119 | std::string m_halo_color; ///< halo color |
120 | #ifdef HAVE_ICONV | ||
114 | iconv_t m_iconv; | 121 | iconv_t m_iconv; |
122 | #endif // HAVE_ICONV | ||
115 | }; | 123 | }; |
116 | 124 | ||
117 | } //end namespace FbTk | 125 | } //end namespace FbTk |