aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Texture.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/Texture.cc')
-rw-r--r--src/FbTk/Texture.cc19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/FbTk/Texture.cc b/src/FbTk/Texture.cc
index 51ca2db..408ff5b 100644
--- a/src/FbTk/Texture.cc
+++ b/src/FbTk/Texture.cc
@@ -22,33 +22,24 @@
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#include "App.hh"
26#include "Texture.hh" 25#include "Texture.hh"
27 26#include "App.hh"
27#include "StringUtil.hh"
28#include <X11/Xlib.h> 28#include <X11/Xlib.h>
29#ifdef HAVE_CSTRING 29#ifdef HAVE_CSTRING
30 #include <cstring> 30 #include <cstring>
31#else 31#else
32 #include <string.h> 32 #include <string.h>
33#endif 33#endif
34#ifdef HAVE_CCTYPE
35 #include <cctype>
36#else
37 #include <ctype.h>
38#endif
39 34
40namespace FbTk { 35namespace FbTk {
41 36
42void Texture::setFromString(const char * const texture_str) { 37void Texture::setFromString(const char * const texture_str) {
43 if (texture_str == 0) 38 if (texture_str == 0)
44 return; 39 return;
45 int t_len = strlen(texture_str) + 1;
46 char *ts = new char[t_len];
47 strcpy(ts, texture_str);
48 40
49 // to lower 41 const std::string t = FbTk::StringUtil::toLower(texture_str);
50 for (size_t byte_pos = 0; byte_pos < strlen(ts); ++byte_pos) 42 const char* ts = t.c_str();
51 ts[byte_pos] = tolower(ts[byte_pos]);
52 43
53 if (strstr(ts, "parentrelative")) { 44 if (strstr(ts, "parentrelative")) {
54 setType(Texture::PARENTRELATIVE); 45 setType(Texture::PARENTRELATIVE);
@@ -105,8 +96,6 @@ void Texture::setFromString(const char * const texture_str) {
105 if (strstr(ts, "tiled")) 96 if (strstr(ts, "tiled"))
106 addType(Texture::TILED); 97 addType(Texture::TILED);
107 } 98 }
108
109 delete [] ts;
110} 99}
111 100
112void Texture::calcHiLoColors(int screen_num) { 101void Texture::calcHiLoColors(int screen_num) {