Add a --enable-lua switch to enable LUA support

This commit is contained in:
M. Liebmann
2014-01-21 16:23:58 +01:00
parent ad206dbbc1
commit 82d4832013
8 changed files with 68 additions and 7 deletions

View File

@@ -45,11 +45,13 @@
#include <string>
#include <vector>
#if ENABLE_LUA
extern "C" {
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#endif
#define NO_WIDGET_ID -1
@@ -75,10 +77,12 @@ class CChangeObserver
{
return false;
}
#if ENABLE_LUA
virtual bool changeNotify(lua_State * /*L*/, const std::string & /*luaId*/, const std::string & /*luaAction*/, void * /*Data*/)
{
return false;
}
#endif
};
class CMenuTarget
@@ -103,9 +107,11 @@ class CMenuItem
fb_pixel_t item_color, item_bgcolor;
void initItemColors(const bool select_mode);
#if ENABLE_LUA
lua_State *luaState;
std::string luaAction;
std::string luaId;
#endif
neutrino_locale_t name;
std::string nameString;
@@ -170,8 +176,9 @@ class CMenuItem
void setHint(const std::string icon, const neutrino_locale_t text) { hintIcon = icon; hint = text; }
void setHint(const std::string icon, const std::string text) { hintIcon = icon; hintText = text; }
#if ENABLE_LUA
void setLua(lua_State *_luaState, std::string &_luaAction, std::string &_luaId) { luaState = _luaState; luaAction = _luaAction; luaId = _luaId; };
#endif
virtual const char *getName();
};