From 6e460803e4429db5a230417fcbb67214217b58fb Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sat, 26 Apr 2003 18:27:56 +0000 Subject: moved StringUtil to FbTk --- src/Keys.cc | 8 ++++---- src/Makefile.am | 5 +++-- src/Screen.cc | 41 ++++++++++++++++++++++++++++------------- 3 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/Keys.cc b/src/Keys.cc index a818e3b..a9879b5 100644 --- a/src/Keys.cc +++ b/src/Keys.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -//$Id: Keys.cc,v 1.26 2003/04/20 12:21:35 rathnor Exp $ +//$Id: Keys.cc,v 1.27 2003/04/26 18:27:56 fluxgen Exp $ #include "Keys.hh" @@ -28,7 +28,7 @@ #include "App.hh" #ifdef HAVE_CONFIG_H -#include "../config.h" +#include "config.h" #endif // HAVE_CONFIG_H @@ -213,7 +213,7 @@ bool Keys::load(const char *filename) { line++; vector val; //Parse arguments - StringUtil::stringtok(val, linebuffer.c_str()); + FbTk::StringUtil::stringtok(val, linebuffer.c_str()); //must have at least 1 argument if (val.size() <= 0) @@ -297,7 +297,7 @@ bool Keys::load(const char *filename) { case Keys::EXECUTE: last_key->execcommand = const_cast - (StringUtil::strcasestr(linebuffer.c_str(), + (FbTk::StringUtil::strcasestr(linebuffer.c_str(), getActionStr(Keys::EXECUTE))+ strlen(getActionStr(Keys::EXECUTE))); break; diff --git a/src/Makefile.am b/src/Makefile.am index a49c653..75610c0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -61,12 +61,13 @@ fluxbox_SOURCES = AtomHandler.hh ArrowButton.hh ArrowButton.cc \ Resource.hh Resource.cc \ RootTheme.hh RootTheme.cc \ Screen.cc Screen.hh \ - Slit.cc Slit.hh StringUtil.cc StringUtil.hh \ + Slit.cc Slit.hh \ TextButton.hh TextButton.cc \ Toolbar.cc Toolbar.hh \ ToolbarHandler.cc ToolbarHandler.hh \ ToolbarTheme.hh ToolbarTheme.cc \ - WinButton.hh WinButton.cc Window.cc Window.hh \ + WinButton.hh WinButton.cc \ + Window.cc Window.hh \ Workspace.cc Workspace.hh \ XrmDatabaseHelper.hh FbCommands.hh FbCommands.cc LayerMenu.hh \ IntResMenuItem.hh IntResMenuItem.cc FbMenu.hh \ diff --git a/src/Screen.cc b/src/Screen.cc index 76d343c..8e5e830 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.137 2003/04/26 15:00:25 fluxgen Exp $ +// $Id: Screen.cc,v 1.138 2003/04/26 18:27:01 fluxgen Exp $ #include "Screen.hh" @@ -1352,15 +1352,15 @@ void BScreen::setupWindowActions(FluxboxWindow &win) { #endif // DEBUG } else if ((*dir)[i] == Fluxbox::STICK) { WinButton *winbtn = new WinButton(win, WinButton::STICK, - frame.titlebar(), - 0, 0, 10, 10); + frame.titlebar(), + 0, 0, 10, 10); win.stateSig().attach(winbtn); winbtn->setOnClick(stick_cmd); newbutton = winbtn; } else if ((*dir)[i] == Fluxbox::SHADE) { WinButton *winbtn = new WinButton(win, WinButton::SHADE, - frame.titlebar(), - 0, 0, 10, 10); + frame.titlebar(), + 0, 0, 10, 10); winbtn->setOnClick(shade_cmd); } @@ -1754,12 +1754,18 @@ void BScreen::initMenu() { if (line[0] != '#') { string key; int pos=0; - int err = StringUtil::getStringBetween(key, line.c_str(), '[', ']'); + int err = FbTk::StringUtil:: + getStringBetween(key, + line.c_str(), + '[', ']'); if (key == "begin") { pos += err; string label; - err = StringUtil::getStringBetween(label, line.c_str()+pos, '(', ')'); + err = FbTk::StringUtil:: + getStringBetween(label, + line.c_str()+pos, + '(', ')'); if (err>0) { m_rootmenu->setLabel(label.c_str()); defaultMenu = parseMenuFile(menu_file, *m_rootmenu.get(), row); @@ -1819,13 +1825,22 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) { std::string str_key, str_label, str_cmd; - err = StringUtil::getStringBetween(str_key, line.c_str(), '[', ']'); + err = FbTk::StringUtil:: + getStringBetween(str_key, + line.c_str(), + '[', ']'); if (err > 0 ) { parse_pos += err; - err = StringUtil::getStringBetween(str_label, line.c_str() + parse_pos, '(', ')'); + err = FbTk::StringUtil:: + getStringBetween(str_label, + line.c_str() + parse_pos, + '(', ')'); if (err>0) { parse_pos += err; - StringUtil::getStringBetween(str_cmd, line.c_str() + parse_pos, '{', '}'); + FbTk::StringUtil:: + getStringBetween(str_cmd, + line.c_str() + parse_pos, + '{', '}'); } } else continue; //read next line @@ -1880,7 +1895,7 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) { // and insert style FbTk::RefCount setstyle_cmd(new FbCommands:: - SetStyleCmd(StringUtil:: + SetStyleCmd(FbTk::StringUtil:: expandFilename(str_cmd))); menu.insert(str_label.c_str(), setstyle_cmd); @@ -1913,7 +1928,7 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) { cerr<<"Row: "<