summaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc41
1 files changed, 28 insertions, 13 deletions
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;