diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-07-07 22:24:40 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-11-01 09:57:21 (GMT) |
commit | b3bd3805961c05776c7f398ce98082effebd8ca2 (patch) | |
tree | be6ae2777f181067d94523e3d2a1870235d06665 /src/FbTk/Luamm.hh | |
parent | 1477ad91d172bde0e88b3b90ecef882f6a7bf31c (diff) | |
download | fluxbox_paul-b3bd3805961c05776c7f398ce98082effebd8ca2.zip fluxbox_paul-b3bd3805961c05776c7f398ce98082effebd8ca2.tar.bz2 |
A lightweight version of lua::state::pushclosure which handles the simple cases
Diffstat (limited to 'src/FbTk/Luamm.hh')
-rw-r--r-- | src/FbTk/Luamm.hh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/FbTk/Luamm.hh b/src/FbTk/Luamm.hh index 05cb569..96a5eea 100644 --- a/src/FbTk/Luamm.hh +++ b/src/FbTk/Luamm.hh | |||
@@ -237,9 +237,10 @@ namespace lua { | |||
237 | void newtable() { lua_newtable(cobj); } | 237 | void newtable() { lua_newtable(cobj); } |
238 | void *newuserdata(size_t size) { return lua_newuserdata(cobj, size); } | 238 | void *newuserdata(size_t size) { return lua_newuserdata(cobj, size); } |
239 | // Functor can be anything that FbTk::Slot can handle, everything else remains | 239 | // Functor can be anything that FbTk::Slot can handle, everything else remains |
240 | // identical | 240 | // identical. We also provide a specialized, lightweight version for simple functors |
241 | template<typename Functor> | 241 | template<typename Functor> |
242 | void pushclosure(const Functor &fn, int n); | 242 | void pushclosure(const Functor &fn, int n); |
243 | void pushclosure(int (*fn)(state *), int n); | ||
243 | template<typename Functor> | 244 | template<typename Functor> |
244 | void pushfunction(const Functor &fn) { pushclosure(fn, 0); } | 245 | void pushfunction(const Functor &fn) { pushclosure(fn, 0); } |
245 | void pushstring(const char *s) { lua_pushstring(cobj, s); } | 246 | void pushstring(const char *s) { lua_pushstring(cobj, s); } |