aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommands.hh
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-02 22:05:05 (GMT)
committerPaul Tagliamonte <paultag@fluxbox.org>2012-04-07 02:11:29 (GMT)
commita1f3fe304cfb5826991ebee146a9a32cb5b0fc5e (patch)
tree713682c7ab5195dbeda2b331ccb7e390b7b15bfe /src/FbCommands.hh
parent382c088c5c2955bdd8c6fac0f7d8b0e310f0554f (diff)
downloadfluxbox_paul-a1f3fe304cfb5826991ebee146a9a32cb5b0fc5e.zip
fluxbox_paul-a1f3fe304cfb5826991ebee146a9a32cb5b0fc5e.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