all repos — fluxbox @ 6717a1c805529ea6e1b1c19a591f876c9c8803db

custom fork of the fluxbox windowmanager

cosmetics
Mathias Gumz akira at fluxbox dot org
commit

6717a1c805529ea6e1b1c19a591f876c9c8803db

parent

65df54d635e8ad2029efea1c3c00eccfffe8532d

3 files changed, 34 insertions(+), 31 deletions(-)

jump to
M src/FbCommands.ccsrc/FbCommands.cc

@@ -171,7 +171,7 @@

setsid(); putenv(const_cast<char *>(displaystring.c_str())); execl(shell, shell, "-c", m_cmd.c_str(), static_cast<void*>(NULL)); - exit(0); + exit(EXIT_SUCCESS); return pid; // compiler happy -> we are happy ;) }
M src/MenuCreator.ccsrc/MenuCreator.cc

@@ -65,7 +65,9 @@ list<size_t> MenuCreator::stacksize_stack;

FbTk::StringConvertor MenuCreator::m_stringconvertor(FbTk::StringConvertor::ToFbString); -static void createStyleMenu(FbTk::Menu &parent, const string &label, +namespace { + +void createStyleMenu(FbTk::Menu &parent, const string &label, const string &directory) { // perform shell style ~ home directory expansion string stylesdir(FbTk::StringUtil::expandFilename(directory));

@@ -101,7 +103,7 @@ Fluxbox::instance()->saveMenuFilename(stylesdir.c_str());

} -static void createRootCmdMenu(FbTk::Menu &parent, const string &label, +void createRootCmdMenu(FbTk::Menu &parent, const string &label, const string &directory, const string &cmd) { // perform shell style ~ home directory expansion string rootcmddir(FbTk::StringUtil::expandFilename(directory));

@@ -141,15 +143,15 @@ class ParseItem {

public: explicit ParseItem(FbTk::Menu *menu):m_menu(menu) {} - inline void load(FbTk::Parser &p, FbTk::StringConvertor &m_labelconvertor) { + void load(FbTk::Parser &p, FbTk::StringConvertor &m_labelconvertor) { p>>m_key>>m_label>>m_cmd>>m_icon; m_label.second = m_labelconvertor.recode(m_label.second); } - inline const string &icon() const { return m_icon.second; } - inline const string &command() const { return m_cmd.second; } - inline const string &label() const { return m_label.second; } - inline const string &key() const { return m_key.second; } - inline FbTk::Menu *menu() { return m_menu; } + const string &icon() const { return m_icon.second; } + const string &command() const { return m_cmd.second; } + const string &label() const { return m_label.second; } + const string &key() const { return m_key.second; } + FbTk::Menu *menu() { return m_menu; } private: FbTk::Parser::Item m_key, m_label, m_cmd, m_icon; FbTk::Menu *m_menu;

@@ -170,10 +172,10 @@ }

}; -static void translateMenuItem(FbTk::Parser &parse, ParseItem &item, FbTk::StringConvertor &labelconvertor); +void translateMenuItem(FbTk::Parser &parse, ParseItem &item, FbTk::StringConvertor &labelconvertor); -static void parseMenu(FbTk::Parser &pars, FbTk::Menu &menu, FbTk::StringConvertor &label_convertor) { +void parseMenu(FbTk::Parser &pars, FbTk::Menu &menu, FbTk::StringConvertor &label_convertor) { ParseItem pitem(&menu); while (!pars.eof()) { pitem.load(pars, label_convertor);

@@ -183,7 +185,7 @@ translateMenuItem(pars, pitem, label_convertor);

} } -static void translateMenuItem(FbTk::Parser &parse, ParseItem &pitem, FbTk::StringConvertor &labelconvertor) { +void translateMenuItem(FbTk::Parser &parse, ParseItem &pitem, FbTk::StringConvertor &labelconvertor) { if (pitem.menu() == 0) throw string("translateMenuItem: We must have a menu in ParseItem!");

@@ -216,12 +218,10 @@ else

menu.insert(str_label, exit_cmd); } else if (str_key == "exec") { // execute and hide menu - using namespace FbTk; - RefCount<Command<void> > exec_cmd(FbTk::CommandParser<void>::instance().parse("exec " + str_cmd)); + FbTk::RefCount<FbTk::Command<void> > exec_cmd(FbTk::CommandParser<void>::instance().parse("exec " + str_cmd)); menu.insert(str_label, exec_cmd); } else if (str_key == "macrocmd") { - using namespace FbTk; - RefCount<Command<void> > macro_cmd(FbTk::CommandParser<void>::instance().parse("macrocmd " + str_cmd)); + FbTk::RefCount<FbTk::Command<void> > macro_cmd(FbTk::CommandParser<void>::instance().parse("macrocmd " + str_cmd)); menu.insert(str_label, macro_cmd); } else if (str_key == "style") { // style menu.insert(new StyleMenuItem(str_label, str_cmd));

@@ -339,7 +339,7 @@ }

} -static void parseWindowMenu(FbTk::Parser &parse, FbTk::Menu &menu, FbTk::StringConvertor &labelconvertor) { +void parseWindowMenu(FbTk::Parser &parse, FbTk::Menu &menu, FbTk::StringConvertor &labelconvertor) { ParseItem pitem(&menu); while (!parse.eof()) {

@@ -361,19 +361,6 @@ }

} } -FbTk::Menu *MenuCreator::createMenu(const string &label, int screen_number) { - BScreen *screen = Fluxbox::instance()->findScreen(screen_number); - if (screen == 0) - return 0; - - FbTk::Menu *menu = new FbMenu(screen->menuTheme(), - screen->imageControl(), - *screen->layerManager().getLayer(Layer::MENU)); - if (!label.empty()) - menu->setLabel(label); - - return menu; -} bool getStart(FbMenuParser &parser, string &label, FbTk::StringConvertor &labelconvertor) { ParseItem pitem(0);

@@ -389,6 +376,22 @@ return false;

label = pitem.label(); return true; +} + +}; // end of anonymous namespace + +FbTk::Menu *MenuCreator::createMenu(const string &label, int screen_number) { + BScreen *screen = Fluxbox::instance()->findScreen(screen_number); + if (screen == 0) + return 0; + + FbTk::Menu *menu = new FbMenu(screen->menuTheme(), + screen->imageControl(), + *screen->layerManager().getLayer(Layer::MENU)); + if (!label.empty()) + menu->setLabel(label); + + return menu; } FbTk::Menu *MenuCreator::createFromFile(const string &filename, int screen_number, bool require_begin) {
M src/fluxbox.ccsrc/fluxbox.cc

@@ -324,7 +324,7 @@ if ((++i) >= m_argc) {

cerr << _FB_CONSOLETEXT(main, ScreenRequiresArg, "error, -screen requires argument", "the -screen option requires a file argument") << endl; - exit(1); + exit(EXIT_FAILURE); } // "all" is default