aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommands.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbCommands.hh')
-rw-r--r--src/FbCommands.hh23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/FbCommands.hh b/src/FbCommands.hh
index d9639ad..bd377f5 100644
--- a/src/FbCommands.hh
+++ b/src/FbCommands.hh
@@ -32,6 +32,10 @@
32#include "ClientPattern.hh" 32#include "ClientPattern.hh"
33#include "FocusableList.hh" 33#include "FocusableList.hh"
34 34
35namespace lua {
36class state;
37}
38
35namespace FbCommands { 39namespace FbCommands {
36 40
37/// executes a system command 41/// executes a system command
@@ -218,7 +222,6 @@ private:
218 Destination m_dest; 222 Destination m_dest;
219}; 223};
220 224
221
222/// test client pattern 225/// test client pattern
223class ClientPatternTestCmd: public FbTk::Command<void> { 226class ClientPatternTestCmd: public FbTk::Command<void> {
224public: 227public:
@@ -228,6 +231,24 @@ private:
228 std::string m_args; 231 std::string m_args;
229}; 232};
230 233
234/// Command that runs a lua function
235class LuaCmd: public FbTk::Command<void> {
236public:
237 /// parses the string as a lua chunk
238 LuaCmd(const std::string &chunk);
239
240 /// expect the function to be on the lua stack (as a function or a string)
241 LuaCmd(lua::state &l);
242
243 ~LuaCmd();
244
245 void execute();
246private:
247 int m_ref;
248
249 void init(lua::state &l);
250};
251
231} // end namespace FbCommands 252} // end namespace FbCommands
232 253
233#endif // FBCOMMANDS_HH 254#endif // FBCOMMANDS_HH