aboutsummaryrefslogtreecommitdiff
path: root/src/Slit.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/Slit.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/Slit.cc')
-rw-r--r--src/Slit.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/Slit.cc b/src/Slit.cc
index b412eec..18c21f4 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -176,7 +176,7 @@ namespace {
176 176
177class SlitClientMenuItem: public FbTk::MenuItem{ 177class SlitClientMenuItem: public FbTk::MenuItem{
178public: 178public:
179 explicit SlitClientMenuItem(Slit& slit, SlitClient &client, FbTk::RefCount<FbTk::Command> &cmd): 179 explicit SlitClientMenuItem(Slit& slit, SlitClient &client, FbTk::RefCount<FbTk::Command<void> > &cmd):
180 FbTk::MenuItem(client.matchName().c_str(), cmd), m_slit(slit), m_client(client) { 180 FbTk::MenuItem(client.matchName().c_str(), cmd), m_slit(slit), m_client(client) {
181 setCommand(cmd); 181 setCommand(cmd);
182 FbTk::MenuItem::setSelected(client.visible()); 182 FbTk::MenuItem::setSelected(client.visible());
@@ -207,7 +207,7 @@ private:
207 207
208class SlitDirMenuItem: public FbTk::MenuItem { 208class SlitDirMenuItem: public FbTk::MenuItem {
209public: 209public:
210 SlitDirMenuItem(const FbTk::FbString &label, Slit &slit, FbTk::RefCount<FbTk::Command> &cmd) 210 SlitDirMenuItem(const FbTk::FbString &label, Slit &slit, FbTk::RefCount<FbTk::Command<void> > &cmd)
211 :FbTk::MenuItem(label,cmd), 211 :FbTk::MenuItem(label,cmd),
212 m_slit(slit), 212 m_slit(slit),
213 m_label(label) { 213 m_label(label) {
@@ -242,7 +242,7 @@ private:
242 242
243class PlaceSlitMenuItem: public FbTk::MenuItem { 243class PlaceSlitMenuItem: public FbTk::MenuItem {
244public: 244public:
245 PlaceSlitMenuItem(const FbTk::FbString &label, Slit &slit, Slit::Placement place, FbTk::RefCount<FbTk::Command> &cmd): 245 PlaceSlitMenuItem(const FbTk::FbString &label, Slit &slit, Slit::Placement place, FbTk::RefCount<FbTk::Command<void> > &cmd):
246 FbTk::MenuItem(label, cmd), m_slit(slit), m_place(place) { 246 FbTk::MenuItem(label, cmd), m_slit(slit), m_place(place) {
247 setCloseOnClick(false); 247 setCloseOnClick(false);
248 } 248 }
@@ -317,7 +317,7 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
317 // setup timer 317 // setup timer
318 m_timer.setTimeout(200); // default timeout 318 m_timer.setTimeout(200); // default timeout
319 m_timer.fireOnce(true); 319 m_timer.fireOnce(true);
320 FbTk::RefCount<FbTk::Command> toggle_hidden(new FbTk::SimpleCommand<Slit>(*this, &Slit::toggleHidden)); 320 FbTk::RefCount<FbTk::Command<void> > toggle_hidden(new FbTk::SimpleCommand<Slit>(*this, &Slit::toggleHidden));
321 m_timer.setCommand(toggle_hidden); 321 m_timer.setCommand(toggle_hidden);
322 322
323 323
@@ -1178,14 +1178,14 @@ void Slit::updateClientmenu() {
1178 m_clientlist_menu.removeAll(); 1178 m_clientlist_menu.removeAll();
1179 m_clientlist_menu.setLabel(_FB_XTEXT(Slit, ClientsMenu, "Clients", "Slit client menu")); 1179 m_clientlist_menu.setLabel(_FB_XTEXT(Slit, ClientsMenu, "Clients", "Slit client menu"));
1180 1180
1181 FbTk::RefCount<FbTk::Command> cycle_up(new FbTk::SimpleCommand<Slit>(*this, &Slit::cycleClientsUp)); 1181 FbTk::RefCount<FbTk::Command<void> > cycle_up(new FbTk::SimpleCommand<Slit>(*this, &Slit::cycleClientsUp));
1182 FbTk::RefCount<FbTk::Command> cycle_down(new FbTk::SimpleCommand<Slit>(*this, &Slit::cycleClientsDown)); 1182 FbTk::RefCount<FbTk::Command<void> > cycle_down(new FbTk::SimpleCommand<Slit>(*this, &Slit::cycleClientsDown));
1183 m_clientlist_menu.insert(_FB_XTEXT(Slit, CycleUp, "Cycle Up", "Cycle clients upwards"), cycle_up); 1183 m_clientlist_menu.insert(_FB_XTEXT(Slit, CycleUp, "Cycle Up", "Cycle clients upwards"), cycle_up);
1184 m_clientlist_menu.insert(_FB_XTEXT(Slit, CycleDown, "Cycle Down", "Cycle clients downwards"), cycle_down); 1184 m_clientlist_menu.insert(_FB_XTEXT(Slit, CycleDown, "Cycle Down", "Cycle clients downwards"), cycle_down);
1185 1185
1186 m_clientlist_menu.insert(new FbTk::MenuSeparator()); 1186 m_clientlist_menu.insert(new FbTk::MenuSeparator());
1187 1187
1188 FbTk::RefCount<FbTk::Command> reconfig(new FbTk::SimpleCommand<Slit>(*this, &Slit::reconfigure)); 1188 FbTk::RefCount<FbTk::Command<void> > reconfig(new FbTk::SimpleCommand<Slit>(*this, &Slit::reconfigure));
1189 SlitClients::iterator it = m_client_list.begin(); 1189 SlitClients::iterator it = m_client_list.begin();
1190 for (; it != m_client_list.end(); ++it) { 1190 for (; it != m_client_list.end(); ++it) {
1191 if ((*it) != 0 && (*it)->window() != 0) 1191 if ((*it) != 0 && (*it)->window() != 0)
@@ -1193,7 +1193,7 @@ void Slit::updateClientmenu() {
1193 } 1193 }
1194 1194
1195 m_clientlist_menu.insert(new FbTk::MenuSeparator()); 1195 m_clientlist_menu.insert(new FbTk::MenuSeparator());
1196 FbTk::RefCount<FbTk::Command> savecmd(new FbTk::SimpleCommand<Slit>(*this, &Slit::saveClientList)); 1196 FbTk::RefCount<FbTk::Command<void> > savecmd(new FbTk::SimpleCommand<Slit>(*this, &Slit::saveClientList));
1197 m_clientlist_menu.insert(_FB_XTEXT(Slit, 1197 m_clientlist_menu.insert(_FB_XTEXT(Slit,
1198 SaveSlitList, 1198 SaveSlitList,
1199 "Save SlitList", "Saves the current order in the slit"), 1199 "Save SlitList", "Saves the current order in the slit"),
@@ -1224,9 +1224,9 @@ void Slit::setupMenu() {
1224 1224
1225 FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand(); 1225 FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand();
1226 FbTk::MacroCommand *s_a_reconf_slit_macro = new FbTk::MacroCommand(); 1226 FbTk::MacroCommand *s_a_reconf_slit_macro = new FbTk::MacroCommand();
1227 FbTk::RefCount<FbTk::Command> saverc_cmd(new FbCommands::SaveResources()); 1227 FbTk::RefCount<FbTk::Command<void> > saverc_cmd(new FbCommands::SaveResources());
1228 FbTk::RefCount<FbTk::Command> reconf_cmd(new FbCommands::ReconfigureFluxboxCmd()); 1228 FbTk::RefCount<FbTk::Command<void> > reconf_cmd(new FbCommands::ReconfigureFluxboxCmd());
1229 FbTk::RefCount<FbTk::Command> reconf_slit_cmd(new FbTk::SimpleCommand<Slit>(*this, &Slit::reconfigure)); 1229 FbTk::RefCount<FbTk::Command<void> > reconf_slit_cmd(new FbTk::SimpleCommand<Slit>(*this, &Slit::reconfigure));
1230 1230
1231 s_a_reconf_macro->add(saverc_cmd); 1231 s_a_reconf_macro->add(saverc_cmd);
1232 s_a_reconf_macro->add(reconf_cmd); 1232 s_a_reconf_macro->add(reconf_cmd);
@@ -1234,8 +1234,8 @@ void Slit::setupMenu() {
1234 s_a_reconf_slit_macro->add(saverc_cmd); 1234 s_a_reconf_slit_macro->add(saverc_cmd);
1235 s_a_reconf_slit_macro->add(reconf_slit_cmd); 1235 s_a_reconf_slit_macro->add(reconf_slit_cmd);
1236 1236
1237 FbTk::RefCount<FbTk::Command> save_and_reconfigure(s_a_reconf_macro); 1237 FbTk::RefCount<FbTk::Command<void> > save_and_reconfigure(s_a_reconf_macro);
1238 FbTk::RefCount<FbTk::Command> save_and_reconfigure_slit(s_a_reconf_slit_macro); 1238 FbTk::RefCount<FbTk::Command<void> > save_and_reconfigure_slit(s_a_reconf_slit_macro);
1239 1239
1240 1240
1241 // it'll be freed by the slitmenu (since not marked internal) 1241 // it'll be freed by the slitmenu (since not marked internal)
@@ -1280,10 +1280,10 @@ void Slit::setupMenu() {
1280 0, 255, m_slitmenu); 1280 0, 255, m_slitmenu);
1281 // setup command for alpha value 1281 // setup command for alpha value
1282 MacroCommand *alpha_macrocmd = new MacroCommand(); 1282 MacroCommand *alpha_macrocmd = new MacroCommand();
1283 RefCount<Command> alpha_cmd(new SimpleCommand<Slit>(*this, &Slit::updateAlpha)); 1283 RefCount<Command<void> > alpha_cmd(new SimpleCommand<Slit>(*this, &Slit::updateAlpha));
1284 alpha_macrocmd->add(saverc_cmd); 1284 alpha_macrocmd->add(saverc_cmd);
1285 alpha_macrocmd->add(alpha_cmd); 1285 alpha_macrocmd->add(alpha_cmd);
1286 RefCount<Command> set_alpha_cmd(alpha_macrocmd); 1286 RefCount<Command<void> > set_alpha_cmd(alpha_macrocmd);
1287 alpha_menuitem->setCommand(set_alpha_cmd); 1287 alpha_menuitem->setCommand(set_alpha_cmd);
1288 1288
1289 m_slitmenu.insert(alpha_menuitem); 1289 m_slitmenu.insert(alpha_menuitem);