aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-04-26 18:58:30 (GMT)
committerfluxgen <fluxgen>2003-04-26 18:58:30 (GMT)
commit6125c24401266effb90baf4b99d918bcdf29cad8 (patch)
treefbb7617acc7ec1775b53d907bd8e0ceba7c6b906
parenta01e77133e66e7affaff475f67d8b50975543968 (diff)
downloadfluxbox-6125c24401266effb90baf4b99d918bcdf29cad8.zip
fluxbox-6125c24401266effb90baf4b99d918bcdf29cad8.tar.bz2
moved StringUtil to FbTk
-rw-r--r--src/FbTk/Makefile.am7
-rw-r--r--src/FbTk/XmbFontImp.cc10
-rw-r--r--src/Remember.cc16
-rw-r--r--src/Workspace.cc4
4 files changed, 22 insertions, 15 deletions
diff --git a/src/FbTk/Makefile.am b/src/FbTk/Makefile.am
index 1e40bfc..18e394a 100644
--- a/src/FbTk/Makefile.am
+++ b/src/FbTk/Makefile.am
@@ -12,14 +12,17 @@ libFbTk_a_SOURCES = App.hh App.cc Color.cc Color.hh Command.hh \
12 FbWindow.hh FbWindow.cc Font.cc Font.hh FontImp.hh \ 12 FbWindow.hh FbWindow.cc Font.cc Font.hh FontImp.hh \
13 ImageControl.hh ImageControl.cc \ 13 ImageControl.hh ImageControl.cc \
14 MacroCommand.hh MacroCommand.cc \ 14 MacroCommand.hh MacroCommand.cc \
15 Menu.hh Menu.cc MenuItem.hh MenuItem.cc MenuTheme.hh MenuTheme.cc NotCopyable.hh \ 15 Menu.hh Menu.cc MenuItem.hh MenuItem.cc \
16 MenuTheme.hh MenuTheme.cc NotCopyable.hh \
16 RefCount.hh SimpleCommand.hh SignalHandler.cc SignalHandler.hh \ 17 RefCount.hh SimpleCommand.hh SignalHandler.cc SignalHandler.hh \
17 Text.hh Text.cc \ 18 Text.hh Text.cc \
18 Texture.cc Texture.hh TextureRender.hh TextureRender.cc Theme.hh Theme.cc Timer.hh Timer.cc \ 19 Texture.cc Texture.hh TextureRender.hh TextureRender.cc \
20 Theme.hh Theme.cc Timer.hh Timer.cc \
19 XFontImp.cc XFontImp.hh \ 21 XFontImp.cc XFontImp.hh \
20 Button.hh Button.cc \ 22 Button.hh Button.cc \
21 Layer.hh LayerItem.hh MultLayers.cc MultLayers.hh \ 23 Layer.hh LayerItem.hh MultLayers.cc MultLayers.hh \
22 XLayer.cc XLayer.hh XLayerItem.cc XLayerItem.hh \ 24 XLayer.cc XLayer.hh XLayerItem.cc XLayerItem.hh \
25 StringUtil.hh StringUtil.cc \
23 Subject.hh Subject.cc Observer.hh Observer.cc \ 26 Subject.hh Subject.cc Observer.hh Observer.cc \
24 Transparent.hh Transparent.cc \ 27 Transparent.hh Transparent.cc \
25 FbPixmap.hh FbPixmap.cc \ 28 FbPixmap.hh FbPixmap.cc \
diff --git a/src/FbTk/XmbFontImp.cc b/src/FbTk/XmbFontImp.cc
index 431b598..6a3ffed 100644
--- a/src/FbTk/XmbFontImp.cc
+++ b/src/FbTk/XmbFontImp.cc
@@ -1,5 +1,5 @@
1// XmbFontImp.cc for FbTk fluxbox toolkit 1// XmbFontImp.cc for FbTk fluxbox toolkit
2// Copyright (c) 2002 Henrik Kinnunen (fluxgen at linuxmail.org) 2// Copyright (c) 2002-2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
3// 3//
4// Permission is hereby granted, free of charge, to any person obtaining a 4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"), 5// copy of this software and associated documentation files (the "Software"),
@@ -19,14 +19,12 @@
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: XmbFontImp.cc,v 1.5 2003/02/17 23:36:43 fluxgen Exp $ 22// $Id: XmbFontImp.cc,v 1.6 2003/04/26 18:57:51 fluxgen Exp $
23 23
24#include "XmbFontImp.hh" 24#include "XmbFontImp.hh"
25 25
26#include "App.hh" 26#include "App.hh"
27 27#include "StringUtil.hh"
28//!! TODO: Change this
29#include "../StringUtil.hh"
30 28
31#ifdef HAVE_CONFIG_H 29#ifdef HAVE_CONFIG_H
32#include "config.h" 30#include "config.h"
@@ -104,7 +102,7 @@ const char *getFontElement(const char *pattern, char *buf, int bufsiz, ...) {
104 buf[bufsiz-1] = 0; 102 buf[bufsiz-1] = 0;
105 buf[bufsiz-2] = '*'; 103 buf[bufsiz-2] = '*';
106 while((v = va_arg(va, char *)) != 0) { 104 while((v = va_arg(va, char *)) != 0) {
107 p = StringUtil::strcasestr(pattern, v); 105 p = FbTk::StringUtil::strcasestr(pattern, v);
108 if (p) { 106 if (p) {
109 std::strncpy(buf, p+1, bufsiz-2); 107 std::strncpy(buf, p+1, bufsiz-2);
110 p2 = strchr(buf, '-'); 108 p2 = strchr(buf, '-');
diff --git a/src/Remember.cc b/src/Remember.cc
index 9783c17..d92b4ec 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: Remember.cc,v 1.7 2003/04/26 14:36:21 rathnor Exp $ 23// $Id: Remember.cc,v 1.8 2003/04/26 18:56:39 fluxgen Exp $
24 24
25#include "Remember.hh" 25#include "Remember.hh"
26#include "StringUtil.hh" 26#include "StringUtil.hh"
@@ -207,10 +207,12 @@ int Remember::parseApp(ifstream &file, Application *a) {
207 if (line[0] != '#') { //the line is commented 207 if (line[0] != '#') { //the line is commented
208 int parse_pos = 0, err = 0; 208 int parse_pos = 0, err = 0;
209 string str_key, str_label; 209 string str_key, str_label;
210 err = StringUtil::getStringBetween(str_key, line.c_str(), '[', ']'); 210 err = FbTk::StringUtil::getStringBetween(str_key,
211 line.c_str(),
212 '[', ']');
211 if (err > 0 ) { 213 if (err > 0 ) {
212 parse_pos += err; 214 parse_pos += err;
213 err = StringUtil::getStringBetween(str_label, 215 err = FbTk::StringUtil::getStringBetween(str_label,
214 line.c_str() + parse_pos, 216 line.c_str() + parse_pos,
215 '{', '}'); 217 '{', '}');
216 if (err>0) { 218 if (err>0) {
@@ -308,12 +310,16 @@ void Remember::load() {
308 continue; 310 continue;
309 string key; 311 string key;
310 int pos=0; 312 int pos=0;
311 int err = StringUtil::getStringBetween(key, line.c_str(), '[', ']'); 313 int err = FbTk::StringUtil::getStringBetween(key,
314 line.c_str(),
315 '[', ']');
312 316
313 if (err >0 && key == "app") { 317 if (err >0 && key == "app") {
314 pos += err; 318 pos += err;
315 string label; 319 string label;
316 err = StringUtil::getStringBetween(label, line.c_str()+pos, '(', ')'); 320 err = FbTk::StringUtil::getStringBetween(label,
321 line.c_str()+pos,
322 '(', ')');
317 if (err>0) { 323 if (err>0) {
318 Application *a; 324 Application *a;
319 Apps::iterator i = apps.find(label); 325 Apps::iterator i = apps.find(label);
diff --git a/src/Workspace.cc b/src/Workspace.cc
index 9799034..b839f14 100644
--- a/src/Workspace.cc
+++ b/src/Workspace.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: Workspace.cc,v 1.55 2003/04/25 11:22:40 fluxgen Exp $ 25// $Id: Workspace.cc,v 1.56 2003/04/26 18:57:10 fluxgen Exp $
26 26
27#include "Workspace.hh" 27#include "Workspace.hh"
28 28
@@ -432,7 +432,7 @@ bool Workspace::loadGroups(const std::string &filename) {
432 string line; 432 string line;
433 vector<string> names; 433 vector<string> names;
434 getline(infile, line); 434 getline(infile, line);
435 StringUtil::stringtok(names, line); 435 FbTk::StringUtil::stringtok(names, line);
436 m_groups.push_back(names); 436 m_groups.push_back(names);
437 } 437 }
438 438