diff options
Diffstat (limited to 'src/FbCommandFactory.cc')
-rw-r--r-- | src/FbCommandFactory.cc | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc index b0b5976..b62a9ce 100644 --- a/src/FbCommandFactory.cc +++ b/src/FbCommandFactory.cc | |||
@@ -20,7 +20,7 @@ | |||
20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21 | // DEALINGS IN THE SOFTWARE. | 21 | // DEALINGS IN THE SOFTWARE. |
22 | 22 | ||
23 | // $Id: FbCommandFactory.cc,v 1.19 2003/10/25 22:11:22 fluxgen Exp $ | 23 | // $Id: FbCommandFactory.cc,v 1.20 2003/11/17 00:33:16 fluxgen Exp $ |
24 | 24 | ||
25 | #include "FbCommandFactory.hh" | 25 | #include "FbCommandFactory.hh" |
26 | 26 | ||
@@ -36,7 +36,22 @@ | |||
36 | #include "FbTk/MacroCommand.hh" | 36 | #include "FbTk/MacroCommand.hh" |
37 | 37 | ||
38 | #include <string> | 38 | #include <string> |
39 | |||
40 | #ifdef HAVE_CONFIG_H | ||
41 | #include "config.h" | ||
42 | #endif // HAVE_CONFIG_H | ||
43 | |||
44 | #ifdef HAVE_SSTREAM | ||
39 | #include <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 | |||
54 | using namespace std; | ||
40 | 55 | ||
41 | // autoregister this module to command parser | 56 | // autoregister this module to command parser |
42 | FbCommandFactory FbCommandFactory::s_autoreg; | 57 | FbCommandFactory FbCommandFactory::s_autoreg; |
@@ -141,13 +156,13 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, | |||
141 | else if (command == "maximizehorizontal") | 156 | else if (command == "maximizehorizontal") |
142 | return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal); | 157 | return new CurrentWindowCmd(&FluxboxWindow::maximizeHorizontal); |
143 | else if (command == "resize") { | 158 | else if (command == "resize") { |
144 | std::istringstream is(arguments); | 159 | FB_istringstream is(arguments.c_str()); |
145 | int dx = 0, dy = 0; | 160 | int dx = 0, dy = 0; |
146 | is >> dx >> dy; | 161 | is >> dx >> dy; |
147 | return new ResizeCmd(dx, dy); | 162 | return new ResizeCmd(dx, dy); |
148 | } | 163 | } |
149 | else if (command == "resizeto") { | 164 | else if (command == "resizeto") { |
150 | std::istringstream is(arguments); | 165 | FB_istringstream is(arguments.c_str()); |
151 | int dx = 0, dy = 0; | 166 | int dx = 0, dy = 0; |
152 | is >> dx >> dy; | 167 | is >> dx >> dy; |
153 | return new ResizeToCmd(dx, dy); | 168 | return new ResizeToCmd(dx, dy); |
@@ -157,13 +172,13 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, | |||
157 | else if (command == "resizevertical") | 172 | else if (command == "resizevertical") |
158 | return new ResizeCmd(0,atoi(arguments.c_str())); | 173 | return new ResizeCmd(0,atoi(arguments.c_str())); |
159 | else if (command == "moveto") { | 174 | else if (command == "moveto") { |
160 | std::istringstream is(arguments); | 175 | FB_istringstream is(arguments.c_str()); |
161 | int dx = 0, dy = 0; | 176 | int dx = 0, dy = 0; |
162 | is >> dx >> dy; | 177 | is >> dx >> dy; |
163 | return new MoveToCmd(dx,dy); | 178 | return new MoveToCmd(dx,dy); |
164 | } | 179 | } |
165 | else if (command == "move") { | 180 | else if (command == "move") { |
166 | std::istringstream is(arguments); | 181 | FB_istringstream is(arguments.c_str()); |
167 | int dx = 0, dy = 0; | 182 | int dx = 0, dy = 0; |
168 | is >> dx >> dy; | 183 | is >> dx >> dy; |
169 | return new MoveCmd(dx, dy); | 184 | return new MoveCmd(dx, dy); |