diff options
author | fluxgen <fluxgen> | 2003-04-26 18:27:56 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-04-26 18:27:56 (GMT) |
commit | 6e460803e4429db5a230417fcbb67214217b58fb (patch) | |
tree | e4f8fd76cea2ce493fefab38f2309e4bd27dd580 /src | |
parent | ae47696324e489355d19ea45c17442a3515a8845 (diff) | |
download | fluxbox-6e460803e4429db5a230417fcbb67214217b58fb.zip fluxbox-6e460803e4429db5a230417fcbb67214217b58fb.tar.bz2 |
moved StringUtil to FbTk
Diffstat (limited to 'src')
-rw-r--r-- | src/Keys.cc | 8 | ||||
-rw-r--r-- | src/Makefile.am | 5 | ||||
-rw-r--r-- | 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 @@ | |||
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: Keys.cc,v 1.26 2003/04/20 12:21:35 rathnor Exp $ | 22 | //$Id: Keys.cc,v 1.27 2003/04/26 18:27:56 fluxgen Exp $ |
23 | 23 | ||
24 | 24 | ||
25 | #include "Keys.hh" | 25 | #include "Keys.hh" |
@@ -28,7 +28,7 @@ | |||
28 | #include "App.hh" | 28 | #include "App.hh" |
29 | 29 | ||
30 | #ifdef HAVE_CONFIG_H | 30 | #ifdef HAVE_CONFIG_H |
31 | #include "../config.h" | 31 | #include "config.h" |
32 | #endif // HAVE_CONFIG_H | 32 | #endif // HAVE_CONFIG_H |
33 | 33 | ||
34 | 34 | ||
@@ -213,7 +213,7 @@ bool Keys::load(const char *filename) { | |||
213 | line++; | 213 | line++; |
214 | vector<string> val; | 214 | vector<string> val; |
215 | //Parse arguments | 215 | //Parse arguments |
216 | StringUtil::stringtok(val, linebuffer.c_str()); | 216 | FbTk::StringUtil::stringtok(val, linebuffer.c_str()); |
217 | 217 | ||
218 | //must have at least 1 argument | 218 | //must have at least 1 argument |
219 | if (val.size() <= 0) | 219 | if (val.size() <= 0) |
@@ -297,7 +297,7 @@ bool Keys::load(const char *filename) { | |||
297 | case Keys::EXECUTE: | 297 | case Keys::EXECUTE: |
298 | last_key->execcommand = | 298 | last_key->execcommand = |
299 | const_cast<char *> | 299 | const_cast<char *> |
300 | (StringUtil::strcasestr(linebuffer.c_str(), | 300 | (FbTk::StringUtil::strcasestr(linebuffer.c_str(), |
301 | getActionStr(Keys::EXECUTE))+ | 301 | getActionStr(Keys::EXECUTE))+ |
302 | strlen(getActionStr(Keys::EXECUTE))); | 302 | strlen(getActionStr(Keys::EXECUTE))); |
303 | break; | 303 | 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 \ | |||
61 | Resource.hh Resource.cc \ | 61 | Resource.hh Resource.cc \ |
62 | RootTheme.hh RootTheme.cc \ | 62 | RootTheme.hh RootTheme.cc \ |
63 | Screen.cc Screen.hh \ | 63 | Screen.cc Screen.hh \ |
64 | Slit.cc Slit.hh StringUtil.cc StringUtil.hh \ | 64 | Slit.cc Slit.hh \ |
65 | TextButton.hh TextButton.cc \ | 65 | TextButton.hh TextButton.cc \ |
66 | Toolbar.cc Toolbar.hh \ | 66 | Toolbar.cc Toolbar.hh \ |
67 | ToolbarHandler.cc ToolbarHandler.hh \ | 67 | ToolbarHandler.cc ToolbarHandler.hh \ |
68 | ToolbarTheme.hh ToolbarTheme.cc \ | 68 | ToolbarTheme.hh ToolbarTheme.cc \ |
69 | WinButton.hh WinButton.cc Window.cc Window.hh \ | 69 | WinButton.hh WinButton.cc \ |
70 | Window.cc Window.hh \ | ||
70 | Workspace.cc Workspace.hh \ | 71 | Workspace.cc Workspace.hh \ |
71 | XrmDatabaseHelper.hh FbCommands.hh FbCommands.cc LayerMenu.hh \ | 72 | XrmDatabaseHelper.hh FbCommands.hh FbCommands.cc LayerMenu.hh \ |
72 | IntResMenuItem.hh IntResMenuItem.cc FbMenu.hh \ | 73 | 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 @@ | |||
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: Screen.cc,v 1.137 2003/04/26 15:00:25 fluxgen Exp $ | 25 | // $Id: Screen.cc,v 1.138 2003/04/26 18:27:01 fluxgen Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
@@ -1352,15 +1352,15 @@ void BScreen::setupWindowActions(FluxboxWindow &win) { | |||
1352 | #endif // DEBUG | 1352 | #endif // DEBUG |
1353 | } else if ((*dir)[i] == Fluxbox::STICK) { | 1353 | } else if ((*dir)[i] == Fluxbox::STICK) { |
1354 | WinButton *winbtn = new WinButton(win, WinButton::STICK, | 1354 | WinButton *winbtn = new WinButton(win, WinButton::STICK, |
1355 | frame.titlebar(), | 1355 | frame.titlebar(), |
1356 | 0, 0, 10, 10); | 1356 | 0, 0, 10, 10); |
1357 | win.stateSig().attach(winbtn); | 1357 | win.stateSig().attach(winbtn); |
1358 | winbtn->setOnClick(stick_cmd); | 1358 | winbtn->setOnClick(stick_cmd); |
1359 | newbutton = winbtn; | 1359 | newbutton = winbtn; |
1360 | } else if ((*dir)[i] == Fluxbox::SHADE) { | 1360 | } else if ((*dir)[i] == Fluxbox::SHADE) { |
1361 | WinButton *winbtn = new WinButton(win, WinButton::SHADE, | 1361 | WinButton *winbtn = new WinButton(win, WinButton::SHADE, |
1362 | frame.titlebar(), | 1362 | frame.titlebar(), |
1363 | 0, 0, 10, 10); | 1363 | 0, 0, 10, 10); |
1364 | winbtn->setOnClick(shade_cmd); | 1364 | winbtn->setOnClick(shade_cmd); |
1365 | } | 1365 | } |
1366 | 1366 | ||
@@ -1754,12 +1754,18 @@ void BScreen::initMenu() { | |||
1754 | if (line[0] != '#') { | 1754 | if (line[0] != '#') { |
1755 | string key; | 1755 | string key; |
1756 | int pos=0; | 1756 | int pos=0; |
1757 | int err = StringUtil::getStringBetween(key, line.c_str(), '[', ']'); | 1757 | int err = FbTk::StringUtil:: |
1758 | getStringBetween(key, | ||
1759 | line.c_str(), | ||
1760 | '[', ']'); | ||
1758 | 1761 | ||
1759 | if (key == "begin") { | 1762 | if (key == "begin") { |
1760 | pos += err; | 1763 | pos += err; |
1761 | string label; | 1764 | string label; |
1762 | err = StringUtil::getStringBetween(label, line.c_str()+pos, '(', ')'); | 1765 | err = FbTk::StringUtil:: |
1766 | getStringBetween(label, | ||
1767 | line.c_str()+pos, | ||
1768 | '(', ')'); | ||
1763 | if (err>0) { | 1769 | if (err>0) { |
1764 | m_rootmenu->setLabel(label.c_str()); | 1770 | m_rootmenu->setLabel(label.c_str()); |
1765 | defaultMenu = parseMenuFile(menu_file, *m_rootmenu.get(), row); | 1771 | defaultMenu = parseMenuFile(menu_file, *m_rootmenu.get(), row); |
@@ -1819,13 +1825,22 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) { | |||
1819 | 1825 | ||
1820 | std::string str_key, str_label, str_cmd; | 1826 | std::string str_key, str_label, str_cmd; |
1821 | 1827 | ||
1822 | err = StringUtil::getStringBetween(str_key, line.c_str(), '[', ']'); | 1828 | err = FbTk::StringUtil:: |
1829 | getStringBetween(str_key, | ||
1830 | line.c_str(), | ||
1831 | '[', ']'); | ||
1823 | if (err > 0 ) { | 1832 | if (err > 0 ) { |
1824 | parse_pos += err; | 1833 | parse_pos += err; |
1825 | err = StringUtil::getStringBetween(str_label, line.c_str() + parse_pos, '(', ')'); | 1834 | err = FbTk::StringUtil:: |
1835 | getStringBetween(str_label, | ||
1836 | line.c_str() + parse_pos, | ||
1837 | '(', ')'); | ||
1826 | if (err>0) { | 1838 | if (err>0) { |
1827 | parse_pos += err; | 1839 | parse_pos += err; |
1828 | StringUtil::getStringBetween(str_cmd, line.c_str() + parse_pos, '{', '}'); | 1840 | FbTk::StringUtil:: |
1841 | getStringBetween(str_cmd, | ||
1842 | line.c_str() + parse_pos, | ||
1843 | '{', '}'); | ||
1829 | } | 1844 | } |
1830 | } else | 1845 | } else |
1831 | continue; //read next line | 1846 | continue; //read next line |
@@ -1880,7 +1895,7 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) { | |||
1880 | // and insert style | 1895 | // and insert style |
1881 | FbTk::RefCount<FbTk::Command> | 1896 | FbTk::RefCount<FbTk::Command> |
1882 | setstyle_cmd(new FbCommands:: | 1897 | setstyle_cmd(new FbCommands:: |
1883 | SetStyleCmd(StringUtil:: | 1898 | SetStyleCmd(FbTk::StringUtil:: |
1884 | expandFilename(str_cmd))); | 1899 | expandFilename(str_cmd))); |
1885 | menu.insert(str_label.c_str(), setstyle_cmd); | 1900 | menu.insert(str_label.c_str(), setstyle_cmd); |
1886 | 1901 | ||
@@ -1913,7 +1928,7 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) { | |||
1913 | cerr<<"Row: "<<row<<endl; | 1928 | cerr<<"Row: "<<row<<endl; |
1914 | } else { // start of else 'x' | 1929 | } else { // start of else 'x' |
1915 | // perform shell style ~ home directory expansion | 1930 | // perform shell style ~ home directory expansion |
1916 | string newfile(StringUtil::expandFilename(str_label)); | 1931 | string newfile(FbTk::StringUtil::expandFilename(str_label)); |
1917 | 1932 | ||
1918 | if (newfile.size() != 0) { | 1933 | if (newfile.size() != 0) { |
1919 | FILE *submenufile = fopen(newfile.c_str(), "r"); | 1934 | FILE *submenufile = fopen(newfile.c_str(), "r"); |
@@ -2160,7 +2175,7 @@ void BScreen::createStyleMenu(FbTk::Menu &menu, | |||
2160 | const char *label, const char *directory) { | 2175 | const char *label, const char *directory) { |
2161 | 2176 | ||
2162 | // perform shell style ~ home directory expansion | 2177 | // perform shell style ~ home directory expansion |
2163 | string stylesdir(StringUtil::expandFilename(directory ? directory : "")); | 2178 | string stylesdir(FbTk::StringUtil::expandFilename(directory ? directory : "")); |
2164 | 2179 | ||
2165 | I18n *i18n = I18n::instance(); | 2180 | I18n *i18n = I18n::instance(); |
2166 | struct stat statbuf; | 2181 | struct stat statbuf; |