mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
src/gui/luainstance.cpp add switch enableUTF8 to ComponentsText
This commit is contained in:
@@ -2072,6 +2072,7 @@ void CLuaInstance::ComponentsTextRegister(lua_State *L)
|
||||
{ "setText", CLuaInstance::ComponentsTextSetText },
|
||||
{ "scroll", CLuaInstance::ComponentsTextScroll },
|
||||
{ "setCenterPos", CLuaInstance::ComponentsTextSetCenterPos },
|
||||
{ "enableUTF8", CLuaInstance::ComponentsTextEnableUTF8 },
|
||||
{ "__gc", CLuaInstance::ComponentsTextDelete },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
@@ -2258,6 +2259,24 @@ int CLuaInstance::ComponentsTextSetCenterPos(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CLuaInstance::ComponentsTextEnableUTF8(lua_State *L)
|
||||
{
|
||||
lua_assert(lua_istable(L,1));
|
||||
CLuaComponentsText *m = ComponentsTextCheck(L, 1);
|
||||
if (!m) return 0;
|
||||
|
||||
bool utf8_encoded = true;
|
||||
if (!tableLookup(L, "utf8_encoded", utf8_encoded))
|
||||
{
|
||||
std::string tmp = "true";
|
||||
if (tableLookup(L, "utf8_encoded", tmp))
|
||||
paramBoolDeprecated(L, tmp.c_str());
|
||||
utf8_encoded = (tmp == "true" || tmp == "1" || tmp == "yes");
|
||||
}
|
||||
m->ct->enableUTF8(utf8_encoded);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CLuaInstance::ComponentsTextDelete(lua_State *L)
|
||||
{
|
||||
DBG("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
||||
|
@@ -278,6 +278,7 @@ private:
|
||||
static int ComponentsTextSetText(lua_State *L);
|
||||
static int ComponentsTextScroll(lua_State *L);
|
||||
static int ComponentsTextSetCenterPos(lua_State *L);
|
||||
static int ComponentsTextEnableUTF8(lua_State *L);
|
||||
static int ComponentsTextDelete(lua_State *L);
|
||||
|
||||
static CLuaPicture *CPictureCheck(lua_State *L, int n);
|
||||
|
Reference in New Issue
Block a user