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/MenuCreator.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/MenuCreator.cc')
-rw-r--r-- | src/MenuCreator.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index 71c1b56..12b0f1c 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include "defaults.hh" | 25 | #include "defaults.hh" |
26 | #include "Screen.hh" | 26 | #include "Screen.hh" |
27 | #include "FbTk/ObjectRegistry.hh" | 27 | #include "FbTk/CommandParser.hh" |
28 | #include "fluxbox.hh" | 28 | #include "fluxbox.hh" |
29 | #include "Window.hh" | 29 | #include "Window.hh" |
30 | #include "WindowCmd.hh" | 30 | #include "WindowCmd.hh" |
@@ -209,7 +209,7 @@ static void translateMenuItem(FbTk::Parser &parse, ParseItem &pitem, FbTk::Strin | |||
209 | else | 209 | else |
210 | menu.insert(str_label, submenu); | 210 | menu.insert(str_label, submenu); |
211 | } else if (str_key == "exit") { // exit | 211 | } else if (str_key == "exit") { // exit |
212 | FbTk::RefCount<FbTk::Command> exit_cmd(FbTk::ObjectRegistry<FbTk::Command>::instance().parse("exit")); | 212 | FbTk::RefCount<FbTk::Command<void> > exit_cmd(FbTk::CommandParser<void>::instance().parse("exit")); |
213 | if (str_label.empty()) | 213 | if (str_label.empty()) |
214 | menu.insert(_FB_XTEXT(Menu, Exit, "Exit", "Exit Command"), exit_cmd); | 214 | menu.insert(_FB_XTEXT(Menu, Exit, "Exit", "Exit Command"), exit_cmd); |
215 | else | 215 | else |
@@ -217,11 +217,11 @@ static void translateMenuItem(FbTk::Parser &parse, ParseItem &pitem, FbTk::Strin | |||
217 | } else if (str_key == "exec") { | 217 | } else if (str_key == "exec") { |
218 | // execute and hide menu | 218 | // execute and hide menu |
219 | using namespace FbTk; | 219 | using namespace FbTk; |
220 | RefCount<Command> exec_cmd(FbTk::ObjectRegistry<FbTk::Command>::instance().parse("exec " + str_cmd)); | 220 | RefCount<Command<void> > exec_cmd(FbTk::CommandParser<void>::instance().parse("exec " + str_cmd)); |
221 | menu.insert(str_label, exec_cmd); | 221 | menu.insert(str_label, exec_cmd); |
222 | } else if (str_key == "macrocmd") { | 222 | } else if (str_key == "macrocmd") { |
223 | using namespace FbTk; | 223 | using namespace FbTk; |
224 | RefCount<Command> macro_cmd(FbTk::ObjectRegistry<FbTk::Command>::instance().parse("macrocmd " + str_cmd)); | 224 | RefCount<Command<void> > macro_cmd(FbTk::CommandParser<void>::instance().parse("macrocmd " + str_cmd)); |
225 | menu.insert(str_label, macro_cmd); | 225 | menu.insert(str_label, macro_cmd); |
226 | } else if (str_key == "style") { // style | 226 | } else if (str_key == "style") { // style |
227 | menu.insert(new StyleMenuItem(str_label, str_cmd)); | 227 | menu.insert(new StyleMenuItem(str_label, str_cmd)); |
@@ -313,10 +313,10 @@ static void translateMenuItem(FbTk::Parser &parse, ParseItem &pitem, FbTk::Strin | |||
313 | } else if (str_key == "endencoding") { | 313 | } else if (str_key == "endencoding") { |
314 | MenuCreator::endEncoding(); | 314 | MenuCreator::endEncoding(); |
315 | } | 315 | } |
316 | else { // ok, if we didn't find any special menu item we try with command FbTk::Parser | 316 | else { // ok, if we didn't find any special menu item we try with command parser |
317 | // we need to attach command with arguments so command FbTk::Parser can parse it | 317 | // we need to attach command with arguments so command parser can parse it |
318 | string line = str_key + " " + str_cmd; | 318 | string line = str_key + " " + str_cmd; |
319 | FbTk::RefCount<FbTk::Command> command(FbTk::ObjectRegistry<FbTk::Command>::instance().parse(line)); | 319 | FbTk::RefCount<FbTk::Command<void> > command(FbTk::CommandParser<void>::instance().parse(line)); |
320 | if (*command != 0) { | 320 | if (*command != 0) { |
321 | // special NLS default labels | 321 | // special NLS default labels |
322 | if (str_label.empty()) { | 322 | if (str_label.empty()) { |
@@ -507,7 +507,7 @@ FbTk::Menu *MenuCreator::createMenuType(const string &type, int screen_num) { | |||
507 | bool MenuCreator::createWindowMenuItem(const string &type, | 507 | bool MenuCreator::createWindowMenuItem(const string &type, |
508 | const string &label, | 508 | const string &label, |
509 | FbTk::Menu &menu) { | 509 | FbTk::Menu &menu) { |
510 | typedef FbTk::RefCount<FbTk::Command> RefCmd; | 510 | typedef FbTk::RefCount<FbTk::Command<void> > RefCmd; |
511 | _FB_USES_NLS; | 511 | _FB_USES_NLS; |
512 | 512 | ||
513 | static MenuContext context; | 513 | static MenuContext context; |