aboutsummaryrefslogtreecommitdiff
path: root/src/IconbarTool.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-01-11 07:41:22 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-01-11 07:41:22 (GMT)
commit9f2f65a698c4cc71373a7fe9d73a0889e0d3487b (patch)
tree4ad67db771d73ea3c48f80a1244037fc9754edd2 /src/IconbarTool.cc
parent1f01d84c080d607a91eb417efcaf5e500b5f1d7e (diff)
downloadfluxbox_pavel-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.zip
fluxbox_pavel-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.tar.bz2
make FbTk::Command a template class, split parsing information out of ObjectRegistry
Diffstat (limited to 'src/IconbarTool.cc')
-rw-r--r--src/IconbarTool.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
index d8579f2..8aa0db8 100644
--- a/src/IconbarTool.cc
+++ b/src/IconbarTool.cc
@@ -30,7 +30,7 @@
30#include "IconButton.hh" 30#include "IconButton.hh"
31#include "Workspace.hh" 31#include "Workspace.hh"
32#include "FbMenu.hh" 32#include "FbMenu.hh"
33#include "FbTk/ObjectRegistry.hh" 33#include "FbTk/CommandParser.hh"
34#include "WinClient.hh" 34#include "WinClient.hh"
35#include "FocusControl.hh" 35#include "FocusControl.hh"
36#include "FbCommands.hh" 36#include "FbCommands.hh"
@@ -103,7 +103,7 @@ class ToolbarModeMenuItem : public FbTk::MenuItem {
103public: 103public:
104 ToolbarModeMenuItem(const FbTk::FbString &label, IconbarTool &handler, 104 ToolbarModeMenuItem(const FbTk::FbString &label, IconbarTool &handler,
105 string mode, 105 string mode,
106 FbTk::RefCount<FbTk::Command> &cmd): 106 FbTk::RefCount<FbTk::Command<void> > &cmd):
107 FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) { 107 FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) {
108 setCloseOnClick(false); 108 setCloseOnClick(false);
109 } 109 }
@@ -122,7 +122,7 @@ class ToolbarAlignMenuItem: public FbTk::MenuItem {
122public: 122public:
123 ToolbarAlignMenuItem(const FbTk::FbString &label, IconbarTool &handler, 123 ToolbarAlignMenuItem(const FbTk::FbString &label, IconbarTool &handler,
124 FbTk::Container::Alignment mode, 124 FbTk::Container::Alignment mode,
125 FbTk::RefCount<FbTk::Command> &cmd): 125 FbTk::RefCount<FbTk::Command<void> > &cmd):
126 FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) { 126 FbTk::MenuItem(label, cmd), m_handler(handler), m_mode(mode) {
127 setCloseOnClick(false); 127 setCloseOnClick(false);
128 } 128 }
@@ -143,7 +143,7 @@ void setupModeMenu(FbTk::Menu &menu, IconbarTool &handler) {
143 143
144 menu.setLabel(_FB_XTEXT(Toolbar, IconbarMode, "Iconbar Mode", "Menu title - chooses which set of icons are shown in the iconbar")); 144 menu.setLabel(_FB_XTEXT(Toolbar, IconbarMode, "Iconbar Mode", "Menu title - chooses which set of icons are shown in the iconbar"));
145 145
146 RefCount<Command> saverc_cmd(new FbCommands::SaveResources()); 146 RefCount<Command<void> > saverc_cmd(new FbCommands::SaveResources());
147 147
148 148
149 menu.insert(new ToolbarModeMenuItem(_FB_XTEXT(Toolbar, IconbarModeNone, 149 menu.insert(new ToolbarModeMenuItem(_FB_XTEXT(Toolbar, IconbarModeNone,
@@ -208,9 +208,9 @@ void setupModeMenu(FbTk::Menu &menu, IconbarTool &handler) {
208 menu.updateMenu(); 208 menu.updateMenu();
209} 209}
210 210
211typedef FbTk::RefCount<FbTk::Command> RefCmd; 211typedef FbTk::RefCount<FbTk::Command<void> > RefCmd;
212 212
213class ShowMenu: public FbTk::Command { 213class ShowMenu: public FbTk::Command<void> {
214public: 214public:
215 explicit ShowMenu(FluxboxWindow &win):m_win(win) { } 215 explicit ShowMenu(FluxboxWindow &win):m_win(win) { }
216 void execute() { 216 void execute() {
@@ -229,7 +229,7 @@ private:
229 FluxboxWindow &m_win; 229 FluxboxWindow &m_win;
230}; 230};
231 231
232class FocusCommand: public FbTk::Command { 232class FocusCommand: public FbTk::Command<void> {
233public: 233public:
234 explicit FocusCommand(Focusable &win): m_win(win) { } 234 explicit FocusCommand(Focusable &win): m_win(win) { }
235 void execute() { 235 void execute() {
@@ -283,11 +283,11 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent,
283 using namespace FbTk; 283 using namespace FbTk;
284 // setup use pixmap item to reconfig iconbar and save resource on click 284 // setup use pixmap item to reconfig iconbar and save resource on click
285 MacroCommand *save_and_reconfig = new MacroCommand(); 285 MacroCommand *save_and_reconfig = new MacroCommand();
286 RefCount<Command> reconfig(new SimpleCommand<IconbarTool>(*this, &IconbarTool::renderTheme)); 286 RefCount<Command<void> > reconfig(new SimpleCommand<IconbarTool>(*this, &IconbarTool::renderTheme));
287 RefCount<Command> save(FbTk::ObjectRegistry<Command>::instance().parse("saverc")); 287 RefCount<Command<void> > save(FbTk::CommandParser<void>::instance().parse("saverc"));
288 save_and_reconfig->add(reconfig); 288 save_and_reconfig->add(reconfig);
289 save_and_reconfig->add(save); 289 save_and_reconfig->add(save);
290 RefCount<Command> s_and_reconfig(save_and_reconfig); 290 RefCount<Command<void> > s_and_reconfig(save_and_reconfig);
291 m_menu.insert(new FbTk::BoolMenuItem(_FB_XTEXT(Toolbar, ShowIcons, 291 m_menu.insert(new FbTk::BoolMenuItem(_FB_XTEXT(Toolbar, ShowIcons,
292 "Show Pictures", "chooses if little icons are shown next to title in the iconbar"), 292 "Show Pictures", "chooses if little icons are shown next to title in the iconbar"),
293 m_rc_use_pixmap, s_and_reconfig)); 293 m_rc_use_pixmap, s_and_reconfig));