aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommands.hh
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-02 22:05:05 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-11-01 09:57:20 (GMT)
commit96d14bf5abde4faf7312d43bfd3e339f75fabc0d (patch)
treeb8fec2dfa81630417df279fc0559d96e6def5846 /src/FbCommands.hh
parent9ca7bf6a038eb40824b43d59b3754c0ac96fee3f (diff)
downloadfluxbox_pavel-96d14bf5abde4faf7312d43bfd3e339f75fabc0d.zip
fluxbox_pavel-96d14bf5abde4faf7312d43bfd3e339f75fabc0d.tar.bz2
Add a new command which executes lua functions
Diffstat (limited to 'src/FbCommands.hh')
-rw-r--r--src/FbCommands.hh22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/FbCommands.hh b/src/FbCommands.hh
index b6b1f7f..ef9812b 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,6 +222,24 @@ private:
218 Destination m_dest; 222 Destination m_dest;
219}; 223};
220 224
225/// Command that runs a lua function
226class LuaCmd: public FbTk::Command<void> {
227public:
228 /// parses the string as a lua chunk
229 LuaCmd(const std::string &chunk);
230
231 /// expect the function to be on the lua stack (as a function or a string)
232 LuaCmd(lua::state &l);
233
234 ~LuaCmd();
235
236 void execute();
237private:
238 int m_ref;
239
240 void init(lua::state &l);
241};
242
221} // end namespace FbCommands 243} // end namespace FbCommands
222 244
223#endif // FBCOMMANDS_HH 245#endif // FBCOMMANDS_HH