diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-11 07:41:22 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-11 07:41:22 (GMT) |
commit | 9f2f65a698c4cc71373a7fe9d73a0889e0d3487b (patch) | |
tree | 4ad67db771d73ea3c48f80a1244037fc9754edd2 /src/Screen.cc | |
parent | 1f01d84c080d607a91eb417efcaf5e500b5f1d7e (diff) | |
download | fluxbox-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.zip fluxbox-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.tar.bz2 |
make FbTk::Command a template class, split parsing information out of ObjectRegistry
Diffstat (limited to 'src/Screen.cc')
-rw-r--r-- | src/Screen.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index eba9eb7..ddfb65f 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -48,7 +48,7 @@ | |||
48 | #include "WinClient.hh" | 48 | #include "WinClient.hh" |
49 | #include "FbWinFrame.hh" | 49 | #include "FbWinFrame.hh" |
50 | #include "Strut.hh" | 50 | #include "Strut.hh" |
51 | #include "FbTk/ObjectRegistry.hh" | 51 | #include "FbTk/CommandParser.hh" |
52 | #include "AtomHandler.hh" | 52 | #include "AtomHandler.hh" |
53 | #include "HeadArea.hh" | 53 | #include "HeadArea.hh" |
54 | #include "FbCommands.hh" | 54 | #include "FbCommands.hh" |
@@ -168,7 +168,7 @@ class TabPlacementMenuItem: public FbTk::MenuItem { | |||
168 | public: | 168 | public: |
169 | TabPlacementMenuItem(FbTk::FbString & label, BScreen &screen, | 169 | TabPlacementMenuItem(FbTk::FbString & label, BScreen &screen, |
170 | FbWinFrame::TabPlacement place, | 170 | FbWinFrame::TabPlacement place, |
171 | FbTk::RefCount<FbTk::Command> &cmd): | 171 | FbTk::RefCount<FbTk::Command<void> > &cmd): |
172 | FbTk::MenuItem(label, cmd), | 172 | FbTk::MenuItem(label, cmd), |
173 | m_screen(screen), | 173 | m_screen(screen), |
174 | m_place(place) { | 174 | m_place(place) { |
@@ -773,7 +773,7 @@ void BScreen::propertyNotify(Atom atom) { | |||
773 | &ret_bytes_after, (unsigned char **)&str); | 773 | &ret_bytes_after, (unsigned char **)&str); |
774 | } | 774 | } |
775 | 775 | ||
776 | FbTk::RefCount<FbTk::Command> cmd(FbTk::ObjectRegistry<FbTk::Command>::instance().parse(str, false)); | 776 | FbTk::RefCount<FbTk::Command<void> > cmd(FbTk::CommandParser<void>::instance().parse(str, false)); |
777 | if (cmd.get()) | 777 | if (cmd.get()) |
778 | cmd->execute(); | 778 | cmd->execute(); |
779 | XFree(str); | 779 | XFree(str); |
@@ -1479,9 +1479,9 @@ void BScreen::initMenu() { | |||
1479 | if (m_rootmenu.get() == 0) { | 1479 | if (m_rootmenu.get() == 0) { |
1480 | _FB_USES_NLS; | 1480 | _FB_USES_NLS; |
1481 | m_rootmenu.reset(createMenu(_FB_XTEXT(Menu, DefaultRootMenu, "Fluxbox default menu", "Title of fallback root menu"))); | 1481 | m_rootmenu.reset(createMenu(_FB_XTEXT(Menu, DefaultRootMenu, "Fluxbox default menu", "Title of fallback root menu"))); |
1482 | FbTk::RefCount<FbTk::Command> restart_fb(FbTk::ObjectRegistry<FbTk::Command>::instance().parse("restart")); | 1482 | FbTk::RefCount<FbTk::Command<void> > restart_fb(FbTk::CommandParser<void>::instance().parse("restart")); |
1483 | FbTk::RefCount<FbTk::Command> exit_fb(FbTk::ObjectRegistry<FbTk::Command>::instance().parse("exit")); | 1483 | FbTk::RefCount<FbTk::Command<void> > exit_fb(FbTk::CommandParser<void>::instance().parse("exit")); |
1484 | FbTk::RefCount<FbTk::Command> execute_xterm(FbTk::ObjectRegistry<FbTk::Command>::instance().parse("exec xterm")); | 1484 | FbTk::RefCount<FbTk::Command<void> > execute_xterm(FbTk::CommandParser<void>::instance().parse("exec xterm")); |
1485 | m_rootmenu->setInternalMenu(); | 1485 | m_rootmenu->setInternalMenu(); |
1486 | m_rootmenu->insert("xterm", execute_xterm); | 1486 | m_rootmenu->insert("xterm", execute_xterm); |
1487 | m_rootmenu->insert(_FB_XTEXT(Menu, Restart, "Restart", "Restart command"), | 1487 | m_rootmenu->insert(_FB_XTEXT(Menu, Restart, "Restart", "Restart command"), |
@@ -1523,20 +1523,20 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1523 | 1523 | ||
1524 | FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand(); | 1524 | FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand(); |
1525 | FbTk::MacroCommand *s_a_reconftabs_macro = new FbTk::MacroCommand(); | 1525 | FbTk::MacroCommand *s_a_reconftabs_macro = new FbTk::MacroCommand(); |
1526 | FbTk::RefCount<FbTk::Command> saverc_cmd(new FbTk::SimpleCommand<Fluxbox>( | 1526 | FbTk::RefCount<FbTk::Command<void> > saverc_cmd(new FbTk::SimpleCommand<Fluxbox>( |
1527 | *Fluxbox::instance(), | 1527 | *Fluxbox::instance(), |
1528 | &Fluxbox::save_rc)); | 1528 | &Fluxbox::save_rc)); |
1529 | FbTk::RefCount<FbTk::Command> reconf_cmd(FbTk::ObjectRegistry<FbTk::Command>::instance().parse("reconfigure")); | 1529 | FbTk::RefCount<FbTk::Command<void> > reconf_cmd(FbTk::CommandParser<void>::instance().parse("reconfigure")); |
1530 | 1530 | ||
1531 | FbTk::RefCount<FbTk::Command> reconftabs_cmd(new FbTk::SimpleCommand<BScreen>( | 1531 | FbTk::RefCount<FbTk::Command<void> > reconftabs_cmd(new FbTk::SimpleCommand<BScreen>( |
1532 | *this, | 1532 | *this, |
1533 | &BScreen::reconfigureTabs)); | 1533 | &BScreen::reconfigureTabs)); |
1534 | s_a_reconf_macro->add(saverc_cmd); | 1534 | s_a_reconf_macro->add(saverc_cmd); |
1535 | s_a_reconf_macro->add(reconf_cmd); | 1535 | s_a_reconf_macro->add(reconf_cmd); |
1536 | s_a_reconftabs_macro->add(saverc_cmd); | 1536 | s_a_reconftabs_macro->add(saverc_cmd); |
1537 | s_a_reconftabs_macro->add(reconftabs_cmd); | 1537 | s_a_reconftabs_macro->add(reconftabs_cmd); |
1538 | FbTk::RefCount<FbTk::Command> save_and_reconfigure(s_a_reconf_macro); | 1538 | FbTk::RefCount<FbTk::Command<void> > save_and_reconfigure(s_a_reconf_macro); |
1539 | FbTk::RefCount<FbTk::Command> save_and_reconftabs(s_a_reconftabs_macro); | 1539 | FbTk::RefCount<FbTk::Command<void> > save_and_reconftabs(s_a_reconftabs_macro); |
1540 | // create focus menu | 1540 | // create focus menu |
1541 | // we don't set this to internal menu so will | 1541 | // we don't set this to internal menu so will |
1542 | // be deleted toghether with the parent | 1542 | // be deleted toghether with the parent |
@@ -1693,7 +1693,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1693 | 1693 | ||
1694 | // in order to save system resources, don't save or reconfigure alpha | 1694 | // in order to save system resources, don't save or reconfigure alpha |
1695 | // settings until after the user is done changing them | 1695 | // settings until after the user is done changing them |
1696 | FbTk::RefCount<FbTk::Command> delayed_save_and_reconf( | 1696 | FbTk::RefCount<FbTk::Command<void> > delayed_save_and_reconf( |
1697 | new FbTk::DelayedCmd(save_and_reconfigure)); | 1697 | new FbTk::DelayedCmd(save_and_reconfigure)); |
1698 | 1698 | ||
1699 | FbTk::MenuItem *focused_alpha_item = | 1699 | FbTk::MenuItem *focused_alpha_item = |