diff options
author | fluxgen <fluxgen> | 2005-02-13 16:36:54 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2005-02-13 16:36:54 (GMT) |
commit | bac15c745e259b69dafd901d48c16c63c3f91ee1 (patch) | |
tree | 03a05e68f1418916efd114665661f3b6b4719db7 /src/FbCommandFactory.cc | |
parent | b8a39c1e6c3fd7d21188193cdb874da474149d33 (diff) | |
download | fluxbox-bac15c745e259b69dafd901d48c16c63c3f91ee1.zip fluxbox-bac15c745e259b69dafd901d48c16c63c3f91ee1.tar.bz2 |
using stringstream header in FbTk
Diffstat (limited to 'src/FbCommandFactory.cc')
-rw-r--r-- | src/FbCommandFactory.cc | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc index 7d9a8fb..86f9eff 100644 --- a/src/FbCommandFactory.cc +++ b/src/FbCommandFactory.cc | |||
@@ -34,22 +34,10 @@ | |||
34 | 34 | ||
35 | #include "FbTk/StringUtil.hh" | 35 | #include "FbTk/StringUtil.hh" |
36 | #include "FbTk/MacroCommand.hh" | 36 | #include "FbTk/MacroCommand.hh" |
37 | #include "FbTk/stringstream.hh" | ||
37 | 38 | ||
38 | #include <string> | 39 | #include <string> |
39 | 40 | ||
40 | #ifdef HAVE_CONFIG_H | ||
41 | #include "config.h" | ||
42 | #endif // HAVE_CONFIG_H | ||
43 | |||
44 | #ifdef HAVE_SSTREAM | ||
45 | #include <sstream> | ||
46 | #define FB_istringstream istringstream | ||
47 | #elif HAVE_STRSTREAM | ||
48 | #include <strstream> | ||
49 | #define FB_istringstream istrstream | ||
50 | #else | ||
51 | #error "You dont have sstream or strstream headers!" | ||
52 | #endif // HAVE_STRSTREAM | ||
53 | 41 | ||
54 | using namespace std; | 42 | using namespace std; |
55 | 43 | ||
@@ -151,11 +139,11 @@ FbCommandFactory::FbCommandFactory() { | |||
151 | "workspace12", | 139 | "workspace12", |
152 | /* end note */ | 140 | /* end note */ |
153 | "workspacemenu", | 141 | "workspacemenu", |
154 | "" | 142 | 0 |
155 | }; | 143 | }; |
156 | 144 | ||
157 | for (int i=0;; ++i) { | 145 | for (int i=0;; ++i) { |
158 | if (strcmp(commands[i], "") == 0) | 146 | if (commands[i] == 0) |
159 | break; | 147 | break; |
160 | addCommand(commands[i]); | 148 | addCommand(commands[i]); |
161 | } | 149 | } |
@@ -229,13 +217,13 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, | |||
229 | else if (command == "maximizehorizontal") | 217 | else if (command == "maximizehorizontal") |
230 | return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal); | 218 | return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal); |
231 | else if (command == "resize") { | 219 | else if (command == "resize") { |
232 | FB_istringstream is(arguments.c_str()); | 220 | FbTk_istringstream is(arguments.c_str()); |
233 | int dx = 0, dy = 0; | 221 | int dx = 0, dy = 0; |
234 | is >> dx >> dy; | 222 | is >> dx >> dy; |
235 | return new ResizeCmd(dx, dy); | 223 | return new ResizeCmd(dx, dy); |
236 | } | 224 | } |
237 | else if (command == "resizeto") { | 225 | else if (command == "resizeto") { |
238 | FB_istringstream is(arguments.c_str()); | 226 | FbTk_istringstream is(arguments.c_str()); |
239 | int dx = 0, dy = 0; | 227 | int dx = 0, dy = 0; |
240 | is >> dx >> dy; | 228 | is >> dx >> dy; |
241 | return new ResizeToCmd(dx, dy); | 229 | return new ResizeToCmd(dx, dy); |
@@ -245,13 +233,13 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, | |||
245 | else if (command == "resizevertical") | 233 | else if (command == "resizevertical") |
246 | return new ResizeCmd(0,atoi(arguments.c_str())); | 234 | return new ResizeCmd(0,atoi(arguments.c_str())); |
247 | else if (command == "moveto") { | 235 | else if (command == "moveto") { |
248 | FB_istringstream is(arguments.c_str()); | 236 | FbTk_istringstream is(arguments.c_str()); |
249 | int dx = 0, dy = 0; | 237 | int dx = 0, dy = 0; |
250 | is >> dx >> dy; | 238 | is >> dx >> dy; |
251 | return new MoveToCmd(dx,dy); | 239 | return new MoveToCmd(dx,dy); |
252 | } | 240 | } |
253 | else if (command == "move") { | 241 | else if (command == "move") { |
254 | FB_istringstream is(arguments.c_str()); | 242 | FbTk_istringstream is(arguments.c_str()); |
255 | int dx = 0, dy = 0; | 243 | int dx = 0, dy = 0; |
256 | is >> dx >> dy; | 244 | is >> dx >> dy; |
257 | return new MoveCmd(dx, dy); | 245 | return new MoveCmd(dx, dy); |
@@ -367,7 +355,7 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, | |||
367 | // | 355 | // |
368 | else if (command == "deiconify") { | 356 | else if (command == "deiconify") { |
369 | 357 | ||
370 | FB_istringstream iss(arguments); | 358 | FbTk_istringstream iss(arguments); |
371 | string mode; | 359 | string mode; |
372 | string d; | 360 | string d; |
373 | DeiconifyCmd::Destination dest; | 361 | DeiconifyCmd::Destination dest; |
@@ -419,7 +407,7 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, | |||
419 | c= FbTk::StringUtil::toLower(cmd); | 407 | c= FbTk::StringUtil::toLower(cmd); |
420 | 408 | ||
421 | FbTk::Command* fbcmd= stringToCommand(c,a); | 409 | FbTk::Command* fbcmd= stringToCommand(c,a); |
422 | if ( fbcmd ) { | 410 | if (fbcmd) { |
423 | FbTk::RefCount<FbTk::Command> rfbcmd(fbcmd); | 411 | FbTk::RefCount<FbTk::Command> rfbcmd(fbcmd); |
424 | macro->add(rfbcmd); | 412 | macro->add(rfbcmd); |
425 | } | 413 | } |