mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
CLuaInstance: Fix and unified script function calls
- No api changes, code only
This commit is contained in:
@@ -129,8 +129,8 @@ int CLuaInstCCPicture::CCPictureNew(lua_State *L)
|
|||||||
int CLuaInstCCPicture::CCPicturePaint(lua_State *L)
|
int CLuaInstCCPicture::CCPicturePaint(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCPicture *m = CCPictureCheck(L, 1);
|
CLuaCCPicture *D = CCPictureCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
bool do_save_bg = true;
|
bool do_save_bg = true;
|
||||||
if (!tableLookup(L, "do_save_bg", do_save_bg)) {
|
if (!tableLookup(L, "do_save_bg", do_save_bg)) {
|
||||||
@@ -139,15 +139,15 @@ int CLuaInstCCPicture::CCPicturePaint(lua_State *L)
|
|||||||
paramBoolDeprecated(L, tmp.c_str());
|
paramBoolDeprecated(L, tmp.c_str());
|
||||||
do_save_bg = (tmp == "true" || tmp == "1" || tmp == "yes");
|
do_save_bg = (tmp == "true" || tmp == "1" || tmp == "yes");
|
||||||
}
|
}
|
||||||
m->cp->paint(do_save_bg);
|
D->cp->paint(do_save_bg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCPicture::CCPictureHide(lua_State *L)
|
int CLuaInstCCPicture::CCPictureHide(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCPicture *m = CCPictureCheck(L, 1);
|
CLuaCCPicture *D = CCPictureCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
bool no_restore = false;
|
bool no_restore = false;
|
||||||
if (!tableLookup(L, "no_restore", no_restore)) {
|
if (!tableLookup(L, "no_restore", no_restore)) {
|
||||||
@@ -156,48 +156,47 @@ int CLuaInstCCPicture::CCPictureHide(lua_State *L)
|
|||||||
paramBoolDeprecated(L, tmp.c_str());
|
paramBoolDeprecated(L, tmp.c_str());
|
||||||
no_restore = (tmp == "true" || tmp == "1" || tmp == "yes");
|
no_restore = (tmp == "true" || tmp == "1" || tmp == "yes");
|
||||||
}
|
}
|
||||||
if (m->parent) {
|
if (D->parent) {
|
||||||
m->cp->setPicture("");
|
D->cp->setPicture("");
|
||||||
m->cp->paint();
|
D->cp->paint();
|
||||||
} else
|
} else
|
||||||
m->cp->hide(no_restore);
|
D->cp->hide(no_restore);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCPicture::CCPictureSetPicture(lua_State *L)
|
int CLuaInstCCPicture::CCPictureSetPicture(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCPicture *m = CCPictureCheck(L, 1);
|
CLuaCCPicture *D = CCPictureCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
std::string image_name = "";
|
std::string image_name = "";
|
||||||
tableLookup(L, "image", image_name);
|
tableLookup(L, "image", image_name);
|
||||||
|
|
||||||
m->cp->setPicture(image_name);
|
D->cp->setPicture(image_name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCPicture::CCPictureSetCenterPos(lua_State *L)
|
int CLuaInstCCPicture::CCPictureSetCenterPos(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCPicture *m = CCPictureCheck(L, 1);
|
CLuaCCPicture *D = CCPictureCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
lua_Integer tmp_along_mode, along_mode = CC_ALONG_X | CC_ALONG_Y;
|
lua_Integer tmp_along_mode, along_mode = CC_ALONG_X | CC_ALONG_Y;
|
||||||
tableLookup(L, "along_mode", tmp_along_mode);
|
tableLookup(L, "along_mode", tmp_along_mode);
|
||||||
|
|
||||||
if (tmp_along_mode & CC_ALONG_X || tmp_along_mode & CC_ALONG_Y)
|
if (tmp_along_mode & CC_ALONG_X || tmp_along_mode & CC_ALONG_Y)
|
||||||
along_mode=tmp_along_mode;
|
along_mode=tmp_along_mode;
|
||||||
|
|
||||||
m->cp->setCenterPos(along_mode);
|
D->cp->setCenterPos(along_mode);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCPicture::CCPictureDelete(lua_State *L)
|
int CLuaInstCCPicture::CCPictureDelete(lua_State *L)
|
||||||
{
|
{
|
||||||
LUA_DEBUG("CLuaInstCCPicture::%s %d\n", __func__, lua_gettop(L));
|
LUA_DEBUG("CLuaInstCCPicture::%s %d\n", __func__, lua_gettop(L));
|
||||||
CLuaCCPicture *m = CCPictureCheck(L, 1);
|
CLuaCCPicture *D = CCPictureCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
delete D;
|
||||||
delete m;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -92,8 +92,8 @@ int CLuaInstCCSignalbox::CCSignalBoxNew(lua_State *L)
|
|||||||
int CLuaInstCCSignalbox::CCSignalBoxPaint(lua_State *L)
|
int CLuaInstCCSignalbox::CCSignalBoxPaint(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCSignalBox *m = CCSignalBoxCheck(L, 1);
|
CLuaCCSignalBox *D = CCSignalBoxCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
bool do_save_bg = true;
|
bool do_save_bg = true;
|
||||||
if (!tableLookup(L, "do_save_bg", do_save_bg)) {
|
if (!tableLookup(L, "do_save_bg", do_save_bg)) {
|
||||||
@@ -102,31 +102,29 @@ int CLuaInstCCSignalbox::CCSignalBoxPaint(lua_State *L)
|
|||||||
paramBoolDeprecated(L, tmp.c_str());
|
paramBoolDeprecated(L, tmp.c_str());
|
||||||
do_save_bg = (tmp == "true" || tmp == "1" || tmp == "yes");
|
do_save_bg = (tmp == "true" || tmp == "1" || tmp == "yes");
|
||||||
}
|
}
|
||||||
m->s->paint(do_save_bg);
|
D->s->paint(do_save_bg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCSignalbox::CCSignalBoxSetCenterPos(lua_State *L)
|
int CLuaInstCCSignalbox::CCSignalBoxSetCenterPos(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCSignalBox *m = CCSignalBoxCheck(L, 1);
|
CLuaCCSignalBox *D = CCSignalBoxCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
lua_Integer tmp_along_mode, along_mode = CC_ALONG_X | CC_ALONG_Y;
|
lua_Integer tmp_along_mode, along_mode = CC_ALONG_X | CC_ALONG_Y;
|
||||||
tableLookup(L, "along_mode", tmp_along_mode);
|
tableLookup(L, "along_mode", tmp_along_mode);
|
||||||
|
|
||||||
if (tmp_along_mode & CC_ALONG_X || tmp_along_mode & CC_ALONG_Y)
|
if (tmp_along_mode & CC_ALONG_X || tmp_along_mode & CC_ALONG_Y)
|
||||||
along_mode=tmp_along_mode;
|
along_mode=tmp_along_mode;
|
||||||
|
|
||||||
m->s->setCenterPos(along_mode);
|
D->s->setCenterPos(along_mode);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCSignalbox::CCSignalBoxDelete(lua_State *L)
|
int CLuaInstCCSignalbox::CCSignalBoxDelete(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaCCSignalBox *m = CCSignalBoxCheck(L, 1);
|
CLuaCCSignalBox *D = CCSignalBoxCheck(L, 1);
|
||||||
if (!m)
|
if (!D) return 0;
|
||||||
return 0;
|
delete D;
|
||||||
|
|
||||||
delete m;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -154,8 +154,8 @@ int CLuaInstCCText::CCTextNew(lua_State *L)
|
|||||||
int CLuaInstCCText::CCTextPaint(lua_State *L)
|
int CLuaInstCCText::CCTextPaint(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCText *m = CCTextCheck(L, 1);
|
CLuaCCText *D = CCTextCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
bool do_save_bg = true;
|
bool do_save_bg = true;
|
||||||
if (!tableLookup(L, "do_save_bg", do_save_bg)) {
|
if (!tableLookup(L, "do_save_bg", do_save_bg)) {
|
||||||
@@ -164,15 +164,15 @@ int CLuaInstCCText::CCTextPaint(lua_State *L)
|
|||||||
paramBoolDeprecated(L, tmp.c_str());
|
paramBoolDeprecated(L, tmp.c_str());
|
||||||
do_save_bg = (tmp == "true" || tmp == "1" || tmp == "yes");
|
do_save_bg = (tmp == "true" || tmp == "1" || tmp == "yes");
|
||||||
}
|
}
|
||||||
m->ct->paint(do_save_bg);
|
D->ct->paint(do_save_bg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCText::CCTextHide(lua_State *L)
|
int CLuaInstCCText::CCTextHide(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCText *m = CCTextCheck(L, 1);
|
CLuaCCText *D = CCTextCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
bool no_restore = false;
|
bool no_restore = false;
|
||||||
if (!tableLookup(L, "no_restore", no_restore)) {
|
if (!tableLookup(L, "no_restore", no_restore)) {
|
||||||
@@ -181,36 +181,36 @@ int CLuaInstCCText::CCTextHide(lua_State *L)
|
|||||||
paramBoolDeprecated(L, tmp.c_str());
|
paramBoolDeprecated(L, tmp.c_str());
|
||||||
no_restore = (tmp == "true" || tmp == "1" || tmp == "yes");
|
no_restore = (tmp == "true" || tmp == "1" || tmp == "yes");
|
||||||
}
|
}
|
||||||
if (m->parent) {
|
if (D->parent) {
|
||||||
m->ct->setText("", m->mode, g_Font[m->font_text]);
|
D->ct->setText("", D->mode, g_Font[D->font_text]);
|
||||||
m->ct->paint();
|
D->ct->paint();
|
||||||
} else
|
} else
|
||||||
m->ct->hide(no_restore);
|
D->ct->hide(no_restore);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCText::CCTextSetText(lua_State *L)
|
int CLuaInstCCText::CCTextSetText(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCText *m = CCTextCheck(L, 1);
|
CLuaCCText *D = CCTextCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
std::string text = "";
|
std::string text = "";
|
||||||
lua_Integer mode = m->mode;
|
lua_Integer mode = D->mode;
|
||||||
lua_Integer font_text = m->font_text;
|
lua_Integer font_text = D->font_text;
|
||||||
tableLookup(L, "text", text);
|
tableLookup(L, "text", text);
|
||||||
tableLookup(L, "mode", mode);
|
tableLookup(L, "mode", mode);
|
||||||
tableLookup(L, "font_text", font_text);
|
tableLookup(L, "font_text", font_text);
|
||||||
|
|
||||||
m->ct->setText(text, mode, g_Font[font_text]);
|
D->ct->setText(text, mode, g_Font[font_text]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCText::CCTextScroll(lua_State *L)
|
int CLuaInstCCText::CCTextScroll(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCText *m = CCTextCheck(L, 1);
|
CLuaCCText *D = CCTextCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
std::string tmp = "true";
|
std::string tmp = "true";
|
||||||
tableLookup(L, "dir", tmp);
|
tableLookup(L, "dir", tmp);
|
||||||
@@ -219,7 +219,7 @@ int CLuaInstCCText::CCTextScroll(lua_State *L)
|
|||||||
tableLookup(L, "pages", pages);
|
tableLookup(L, "pages", pages);
|
||||||
|
|
||||||
//get the textbox instance from lua object and use CTexBbox scroll methods
|
//get the textbox instance from lua object and use CTexBbox scroll methods
|
||||||
CTextBox* ctb = m->ct->getCTextBoxObject();
|
CTextBox* ctb = D->ct->getCTextBoxObject();
|
||||||
if (ctb) {
|
if (ctb) {
|
||||||
if (pages == -1)
|
if (pages == -1)
|
||||||
pages = ctb->getPages();
|
pages = ctb->getPages();
|
||||||
@@ -236,23 +236,23 @@ int CLuaInstCCText::CCTextScroll(lua_State *L)
|
|||||||
int CLuaInstCCText::CCTextSetCenterPos(lua_State *L)
|
int CLuaInstCCText::CCTextSetCenterPos(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCText *m = CCTextCheck(L, 1);
|
CLuaCCText *D = CCTextCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
lua_Integer tmp_along_mode, along_mode = CC_ALONG_X | CC_ALONG_Y;
|
lua_Integer tmp_along_mode, along_mode = CC_ALONG_X | CC_ALONG_Y;
|
||||||
tableLookup(L, "along_mode", tmp_along_mode);
|
tableLookup(L, "along_mode", tmp_along_mode);
|
||||||
|
|
||||||
if (tmp_along_mode & CC_ALONG_X || tmp_along_mode & CC_ALONG_Y)
|
if (tmp_along_mode & CC_ALONG_X || tmp_along_mode & CC_ALONG_Y)
|
||||||
along_mode=tmp_along_mode;
|
along_mode=tmp_along_mode;
|
||||||
|
|
||||||
m->ct->setCenterPos(along_mode);
|
D->ct->setCenterPos(along_mode);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCText::CCTextEnableUTF8(lua_State *L)
|
int CLuaInstCCText::CCTextEnableUTF8(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCText *m = CCTextCheck(L, 1);
|
CLuaCCText *D = CCTextCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
bool utf8_encoded = true;
|
bool utf8_encoded = true;
|
||||||
if (!tableLookup(L, "utf8_encoded", utf8_encoded)) {
|
if (!tableLookup(L, "utf8_encoded", utf8_encoded)) {
|
||||||
@@ -261,17 +261,15 @@ int CLuaInstCCText::CCTextEnableUTF8(lua_State *L)
|
|||||||
paramBoolDeprecated(L, tmp.c_str());
|
paramBoolDeprecated(L, tmp.c_str());
|
||||||
utf8_encoded = (tmp == "true" || tmp == "1" || tmp == "yes");
|
utf8_encoded = (tmp == "true" || tmp == "1" || tmp == "yes");
|
||||||
}
|
}
|
||||||
m->ct->enableUTF8(utf8_encoded);
|
D->ct->enableUTF8(utf8_encoded);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCText::CCTextDelete(lua_State *L)
|
int CLuaInstCCText::CCTextDelete(lua_State *L)
|
||||||
{
|
{
|
||||||
LUA_DEBUG("CLuaInstCCText::%s %d\n", __func__, lua_gettop(L));
|
LUA_DEBUG("CLuaInstCCText::%s %d\n", __func__, lua_gettop(L));
|
||||||
CLuaCCText *m = CCTextCheck(L, 1);
|
CLuaCCText *D = CCTextCheck(L, 1);
|
||||||
if (!m)
|
if (!D) return 0;
|
||||||
return 0;
|
delete D;
|
||||||
|
|
||||||
delete m;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -177,8 +177,8 @@ CLuaCCWindow *CLuaInstCCWindow::CCWindowCheck(lua_State *L, int n)
|
|||||||
int CLuaInstCCWindow::CCWindowPaint(lua_State *L)
|
int CLuaInstCCWindow::CCWindowPaint(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCWindow *m = CCWindowCheck(L, 1);
|
CLuaCCWindow *D = CCWindowCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
bool do_save_bg = true;
|
bool do_save_bg = true;
|
||||||
if (!tableLookup(L, "do_save_bg", do_save_bg)) {
|
if (!tableLookup(L, "do_save_bg", do_save_bg)) {
|
||||||
@@ -187,15 +187,15 @@ int CLuaInstCCWindow::CCWindowPaint(lua_State *L)
|
|||||||
paramBoolDeprecated(L, tmp.c_str());
|
paramBoolDeprecated(L, tmp.c_str());
|
||||||
do_save_bg = (tmp == "true" || tmp == "1" || tmp == "yes");
|
do_save_bg = (tmp == "true" || tmp == "1" || tmp == "yes");
|
||||||
}
|
}
|
||||||
m->w->paint(do_save_bg);
|
D->w->paint(do_save_bg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCWindow::CCWindowHide(lua_State *L)
|
int CLuaInstCCWindow::CCWindowHide(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCWindow *m = CCWindowCheck(L, 1);
|
CLuaCCWindow *D = CCWindowCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
bool no_restore = false;
|
bool no_restore = false;
|
||||||
if (!tableLookup(L, "no_restore", no_restore)) {
|
if (!tableLookup(L, "no_restore", no_restore)) {
|
||||||
@@ -204,41 +204,41 @@ int CLuaInstCCWindow::CCWindowHide(lua_State *L)
|
|||||||
paramBoolDeprecated(L, tmp.c_str());
|
paramBoolDeprecated(L, tmp.c_str());
|
||||||
no_restore = (tmp == "true" || tmp == "1" || tmp == "yes");
|
no_restore = (tmp == "true" || tmp == "1" || tmp == "yes");
|
||||||
}
|
}
|
||||||
m->w->hide(no_restore);
|
D->w->hide(no_restore);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCWindow::CCWindowSetCaption(lua_State *L)
|
int CLuaInstCCWindow::CCWindowSetCaption(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCWindow *m = CCWindowCheck(L, 1);
|
CLuaCCWindow *D = CCWindowCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
std::string name = "";
|
std::string name = "";
|
||||||
tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name);
|
tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name);
|
||||||
|
|
||||||
m->w->setWindowCaption(name);
|
D->w->setWindowCaption(name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCWindow::CCWindowSetWindowColor(lua_State *L)
|
int CLuaInstCCWindow::CCWindowSetWindowColor(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCWindow *m = CCWindowCheck(L, 1);
|
CLuaCCWindow *D = CCWindowCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
lua_Unsigned color;
|
lua_Unsigned color;
|
||||||
if (tableLookup(L, "color_frame" , color)) {
|
if (tableLookup(L, "color_frame" , color)) {
|
||||||
checkMagicMask(color);
|
checkMagicMask(color);
|
||||||
m->w->setColorFrame(color);
|
D->w->setColorFrame(color);
|
||||||
}
|
}
|
||||||
if (tableLookup(L, "color_body" , color)) {
|
if (tableLookup(L, "color_body" , color)) {
|
||||||
checkMagicMask(color);
|
checkMagicMask(color);
|
||||||
m->w->setColorBody(color);
|
D->w->setColorBody(color);
|
||||||
}
|
}
|
||||||
if (tableLookup(L, "color_shadow" , color)) {
|
if (tableLookup(L, "color_shadow" , color)) {
|
||||||
checkMagicMask(color);
|
checkMagicMask(color);
|
||||||
m->w->setColorShadow(color);
|
D->w->setColorShadow(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -246,12 +246,12 @@ int CLuaInstCCWindow::CCWindowSetWindowColor(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstCCWindow::CCWindowPaintHeader(lua_State *L)
|
int CLuaInstCCWindow::CCWindowPaintHeader(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaCCWindow *m = CCWindowCheck(L, 1);
|
CLuaCCWindow *D = CCWindowCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
CComponentsHeader* header = m->w->getHeaderObject();
|
CComponentsHeader* header = D->w->getHeaderObject();
|
||||||
if (header)
|
if (header)
|
||||||
m->w->showHeader();
|
D->w->showHeader();
|
||||||
header->paint();
|
header->paint();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -273,11 +273,10 @@ int CLuaInstCCWindow::CCWindowGetFooterHeight_dep(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstCCWindow::CCWindowGetHeaderHeight(lua_State *L)
|
int CLuaInstCCWindow::CCWindowGetHeaderHeight(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaCCWindow *m = CCWindowCheck(L, 1);
|
CLuaCCWindow *D = CCWindowCheck(L, 1);
|
||||||
if (!m)
|
if (!D) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
CComponentsHeader* header = m->w->getHeaderObject();
|
CComponentsHeader* header = D->w->getHeaderObject();
|
||||||
int hh = 0;
|
int hh = 0;
|
||||||
if (header)
|
if (header)
|
||||||
hh = header->getHeight();
|
hh = header->getHeight();
|
||||||
@@ -287,11 +286,10 @@ int CLuaInstCCWindow::CCWindowGetHeaderHeight(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstCCWindow::CCWindowGetFooterHeight(lua_State *L)
|
int CLuaInstCCWindow::CCWindowGetFooterHeight(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaCCWindow *m = CCWindowCheck(L, 1);
|
CLuaCCWindow *D = CCWindowCheck(L, 1);
|
||||||
if (!m)
|
if (!D) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
CComponentsFooter* footer = m->w->getFooterObject();
|
CComponentsFooter* footer = D->w->getFooterObject();
|
||||||
int fh = 0;
|
int fh = 0;
|
||||||
if (footer)
|
if (footer)
|
||||||
fh = footer->getHeight();
|
fh = footer->getHeight();
|
||||||
@@ -302,25 +300,23 @@ int CLuaInstCCWindow::CCWindowGetFooterHeight(lua_State *L)
|
|||||||
int CLuaInstCCWindow::CCWindowSetCenterPos(lua_State *L)
|
int CLuaInstCCWindow::CCWindowSetCenterPos(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
CLuaCCWindow *m = CCWindowCheck(L, 1);
|
CLuaCCWindow *D = CCWindowCheck(L, 1);
|
||||||
if (!m) return 0;
|
if (!D) return 0;
|
||||||
lua_Integer tmp_along_mode, along_mode = CC_ALONG_X | CC_ALONG_Y;
|
lua_Integer tmp_along_mode, along_mode = CC_ALONG_X | CC_ALONG_Y;
|
||||||
tableLookup(L, "along_mode", tmp_along_mode);
|
tableLookup(L, "along_mode", tmp_along_mode);
|
||||||
|
|
||||||
if (tmp_along_mode & CC_ALONG_X || tmp_along_mode & CC_ALONG_Y)
|
if (tmp_along_mode & CC_ALONG_X || tmp_along_mode & CC_ALONG_Y)
|
||||||
along_mode=tmp_along_mode;
|
along_mode=tmp_along_mode;
|
||||||
|
|
||||||
m->w->setCenterPos(along_mode);
|
D->w->setCenterPos(along_mode);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstCCWindow::CCWindowDelete(lua_State *L)
|
int CLuaInstCCWindow::CCWindowDelete(lua_State *L)
|
||||||
{
|
{
|
||||||
LUA_DEBUG("CLuaInstCCWindow::%s %d\n", __func__, lua_gettop(L));
|
LUA_DEBUG("CLuaInstCCWindow::%s %d\n", __func__, lua_gettop(L));
|
||||||
CLuaCCWindow *m = CCWindowCheck(L, 1);
|
CLuaCCWindow *D = CCWindowCheck(L, 1);
|
||||||
if (!m)
|
if (!D) return 0;
|
||||||
return 0;
|
delete D;
|
||||||
|
|
||||||
delete m;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -89,39 +89,39 @@ int CLuaInstConfigFile::LuaConfigFileNew(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstConfigFile::LuaConfigFileLoadConfig(lua_State *L)
|
int CLuaInstConfigFile::LuaConfigFileLoadConfig(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaConfigFile *c = LuaConfigFileCheck(L, 1);
|
CLuaConfigFile *D = LuaConfigFileCheck(L, 1);
|
||||||
if (!c) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
const char *fname = luaL_checkstring(L, 2);
|
const char *fname = luaL_checkstring(L, 2);
|
||||||
bool ret = c->c->loadConfig(fname);
|
bool ret = D->c->loadConfig(fname);
|
||||||
lua_pushboolean(L, ret);
|
lua_pushboolean(L, ret);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstConfigFile::LuaConfigFileSaveConfig(lua_State *L)
|
int CLuaInstConfigFile::LuaConfigFileSaveConfig(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaConfigFile *c = LuaConfigFileCheck(L, 1);
|
CLuaConfigFile *D = LuaConfigFileCheck(L, 1);
|
||||||
if (!c) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
const char *fname = luaL_checkstring(L, 2);
|
const char *fname = luaL_checkstring(L, 2);
|
||||||
bool ret = c->c->saveConfig(fname);
|
bool ret = D->c->saveConfig(fname);
|
||||||
lua_pushboolean(L, ret);
|
lua_pushboolean(L, ret);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstConfigFile::LuaConfigFileClear(lua_State *L)
|
int CLuaInstConfigFile::LuaConfigFileClear(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaConfigFile *c = LuaConfigFileCheck(L, 1);
|
CLuaConfigFile *D = LuaConfigFileCheck(L, 1);
|
||||||
if (!c) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
c->c->clear();
|
D->c->clear();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstConfigFile::LuaConfigFileGetString(lua_State *L)
|
int CLuaInstConfigFile::LuaConfigFileGetString(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaConfigFile *c = LuaConfigFileCheck(L, 1);
|
CLuaConfigFile *D = LuaConfigFileCheck(L, 1);
|
||||||
if (!c) return 0;
|
if (!D) return 0;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
|
|
||||||
std::string ret;
|
std::string ret;
|
||||||
@@ -129,26 +129,26 @@ int CLuaInstConfigFile::LuaConfigFileGetString(lua_State *L)
|
|||||||
const char *defaultVal = "";
|
const char *defaultVal = "";
|
||||||
if (numargs > 2)
|
if (numargs > 2)
|
||||||
defaultVal = luaL_checkstring(L, 3);
|
defaultVal = luaL_checkstring(L, 3);
|
||||||
ret = c->c->getString(key, defaultVal);
|
ret = D->c->getString(key, defaultVal);
|
||||||
lua_pushstring(L, ret.c_str());
|
lua_pushstring(L, ret.c_str());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstConfigFile::LuaConfigFileSetString(lua_State *L)
|
int CLuaInstConfigFile::LuaConfigFileSetString(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaConfigFile *c = LuaConfigFileCheck(L, 1);
|
CLuaConfigFile *D = LuaConfigFileCheck(L, 1);
|
||||||
if (!c) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
const char *key = luaL_checkstring(L, 2);
|
const char *key = luaL_checkstring(L, 2);
|
||||||
const char *val = luaL_checkstring(L, 3);
|
const char *val = luaL_checkstring(L, 3);
|
||||||
c->c->setString(key, val);
|
D->c->setString(key, val);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstConfigFile::LuaConfigFileGetInt32(lua_State *L)
|
int CLuaInstConfigFile::LuaConfigFileGetInt32(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaConfigFile *c = LuaConfigFileCheck(L, 1);
|
CLuaConfigFile *D = LuaConfigFileCheck(L, 1);
|
||||||
if (!c) return 0;
|
if (!D) return 0;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
@@ -156,26 +156,26 @@ int CLuaInstConfigFile::LuaConfigFileGetInt32(lua_State *L)
|
|||||||
int defaultVal = 0;
|
int defaultVal = 0;
|
||||||
if (numargs > 2)
|
if (numargs > 2)
|
||||||
defaultVal = luaL_checkint(L, 3);
|
defaultVal = luaL_checkint(L, 3);
|
||||||
ret = c->c->getInt32(key, defaultVal);
|
ret = D->c->getInt32(key, defaultVal);
|
||||||
lua_pushinteger(L, ret);
|
lua_pushinteger(L, ret);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstConfigFile::LuaConfigFileSetInt32(lua_State *L)
|
int CLuaInstConfigFile::LuaConfigFileSetInt32(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaConfigFile *c = LuaConfigFileCheck(L, 1);
|
CLuaConfigFile *D = LuaConfigFileCheck(L, 1);
|
||||||
if (!c) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
const char *key = luaL_checkstring(L, 2);
|
const char *key = luaL_checkstring(L, 2);
|
||||||
int val = luaL_checkint(L, 3);
|
int val = luaL_checkint(L, 3);
|
||||||
c->c->setInt32(key, val);
|
D->c->setInt32(key, val);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstConfigFile::LuaConfigFileGetBool(lua_State *L)
|
int CLuaInstConfigFile::LuaConfigFileGetBool(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaConfigFile *c = LuaConfigFileCheck(L, 1);
|
CLuaConfigFile *D = LuaConfigFileCheck(L, 1);
|
||||||
if (!c) return 0;
|
if (!D) return 0;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
|
|
||||||
bool ret;
|
bool ret;
|
||||||
@@ -183,37 +183,37 @@ int CLuaInstConfigFile::LuaConfigFileGetBool(lua_State *L)
|
|||||||
bool defaultVal = false;
|
bool defaultVal = false;
|
||||||
if (numargs > 2)
|
if (numargs > 2)
|
||||||
defaultVal = _luaL_checkbool(L, 3);
|
defaultVal = _luaL_checkbool(L, 3);
|
||||||
ret = c->c->getBool(key, defaultVal);
|
ret = D->c->getBool(key, defaultVal);
|
||||||
lua_pushboolean(L, ret);
|
lua_pushboolean(L, ret);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstConfigFile::LuaConfigFileSetBool(lua_State *L)
|
int CLuaInstConfigFile::LuaConfigFileSetBool(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaConfigFile *c = LuaConfigFileCheck(L, 1);
|
CLuaConfigFile *D = LuaConfigFileCheck(L, 1);
|
||||||
if (!c) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
const char *key = luaL_checkstring(L, 2);
|
const char *key = luaL_checkstring(L, 2);
|
||||||
bool val = _luaL_checkbool(L, 3);
|
bool val = _luaL_checkbool(L, 3);
|
||||||
c->c->setBool(key, val);
|
D->c->setBool(key, val);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstConfigFile::LuaConfigFileDeleteKey(lua_State *L)
|
int CLuaInstConfigFile::LuaConfigFileDeleteKey(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaConfigFile *c = LuaConfigFileCheck(L, 1);
|
CLuaConfigFile *D = LuaConfigFileCheck(L, 1);
|
||||||
if (!c) return 0;
|
if (!D) return 0;
|
||||||
|
|
||||||
const char *s1 = luaL_checkstring(L, 2);
|
const char *s1 = luaL_checkstring(L, 2);
|
||||||
std::string key(s1);
|
std::string key(s1);
|
||||||
c->c->deleteKey(key);
|
D->c->deleteKey(key);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstConfigFile::LuaConfigFileDelete(lua_State *L)
|
int CLuaInstConfigFile::LuaConfigFileDelete(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaConfigFile *c = LuaConfigFileCheck(L, 1);
|
CLuaConfigFile *D = LuaConfigFileCheck(L, 1);
|
||||||
if (!c) return 0;
|
if (!D) return 0;
|
||||||
delete c;
|
delete D;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -173,6 +173,8 @@ Example:
|
|||||||
#define CURL_MSG_ERROR "[curl:download \33[1;31mERROR!\33[0m]"
|
#define CURL_MSG_ERROR "[curl:download \33[1;31mERROR!\33[0m]"
|
||||||
|
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
|
CLuaCurl *D = CurlCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
|
||||||
char errMsg[1024];
|
char errMsg[1024];
|
||||||
CURL *curl_handle = curl_easy_init();
|
CURL *curl_handle = curl_easy_init();
|
||||||
@@ -359,6 +361,7 @@ Example:
|
|||||||
int CLuaInstCurl::CurlDelete(lua_State *L)
|
int CLuaInstCurl::CurlDelete(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaCurl *D = CurlCheckData(L, 1);
|
CLuaCurl *D = CurlCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
delete D;
|
delete D;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -100,36 +100,36 @@ int CLuaInstHintbox::HintboxNew(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstHintbox::HintboxDelete(lua_State *L)
|
int CLuaInstHintbox::HintboxDelete(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaHintbox *m = HintboxCheck(L, 1);
|
CLuaHintbox *D = HintboxCheck(L, 1);
|
||||||
delete m;
|
if (!D) return 0;
|
||||||
|
delete D;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstHintbox::HintboxPaint(lua_State *L)
|
int CLuaInstHintbox::HintboxPaint(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaHintbox *m = HintboxCheck(L, 1);
|
CLuaHintbox *D = HintboxCheck(L, 1);
|
||||||
if (!m)
|
if (!D) return 0;
|
||||||
return 0;
|
D->b->paint();
|
||||||
m->b->paint();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstHintbox::HintboxHide(lua_State *L)
|
int CLuaInstHintbox::HintboxHide(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaHintbox *m = HintboxCheck(L, 1);
|
CLuaHintbox *D = HintboxCheck(L, 1);
|
||||||
m->b->hide();
|
if (!D) return 0;
|
||||||
|
D->b->hide();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstHintbox::HintboxExec(lua_State *L)
|
int CLuaInstHintbox::HintboxExec(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaHintbox *m = HintboxCheck(L, 1);
|
CLuaHintbox *D = HintboxCheck(L, 1);
|
||||||
if (!m)
|
if (!D) return 0;
|
||||||
return 0;
|
|
||||||
int timeout = -1;
|
int timeout = -1;
|
||||||
if (lua_isnumber(L, -1))
|
if (lua_isnumber(L, -1))
|
||||||
timeout = (int) lua_tonumber(L, -1);
|
timeout = (int) lua_tonumber(L, -1);
|
||||||
m->b->paint();
|
D->b->paint();
|
||||||
|
|
||||||
// copied from gui/widget/hintbox.cpp
|
// copied from gui/widget/hintbox.cpp
|
||||||
neutrino_msg_t msg;
|
neutrino_msg_t msg;
|
||||||
@@ -149,11 +149,11 @@ int CLuaInstHintbox::HintboxExec(lua_State *L)
|
|||||||
res = messages_return::cancel_info;
|
res = messages_return::cancel_info;
|
||||||
else if (msg == CRCInput::RC_home)
|
else if (msg == CRCInput::RC_home)
|
||||||
res = messages_return::cancel_all;
|
res = messages_return::cancel_all;
|
||||||
else if ((m->b->has_scrollbar()) && ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_down))) {
|
else if ((D->b->has_scrollbar()) && ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_down))) {
|
||||||
if (msg == CRCInput::RC_up)
|
if (msg == CRCInput::RC_up)
|
||||||
m->b->scroll_up();
|
D->b->scroll_up();
|
||||||
else
|
else
|
||||||
m->b->scroll_down();
|
D->b->scroll_down();
|
||||||
} else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) {
|
} else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) {
|
||||||
} else if (msg == CRCInput::RC_mode) {
|
} else if (msg == CRCInput::RC_mode) {
|
||||||
res = messages_return::handled;
|
res = messages_return::handled;
|
||||||
@@ -171,6 +171,6 @@ int CLuaInstHintbox::HintboxExec(lua_State *L)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m->b->hide();
|
D->b->hide();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -292,9 +292,8 @@ int CLuaInstMenu::MenuNew(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMenu::MenuAddKey(lua_State *L)
|
int CLuaInstMenu::MenuAddKey(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMenu *m = MenuCheck(L, 1);
|
CLuaMenu *D = MenuCheck(L, 1);
|
||||||
if (!m)
|
if (!D) return 0;
|
||||||
return 0;
|
|
||||||
lua_assert(lua_istable(L, 2));
|
lua_assert(lua_istable(L, 2));
|
||||||
|
|
||||||
std::string action; tableLookup(L, "action", action);
|
std::string action; tableLookup(L, "action", action);
|
||||||
@@ -302,16 +301,16 @@ int CLuaInstMenu::MenuAddKey(lua_State *L)
|
|||||||
lua_Unsigned directkey = CRCInput::RC_nokey; tableLookup(L, "directkey", directkey);
|
lua_Unsigned directkey = CRCInput::RC_nokey; tableLookup(L, "directkey", directkey);
|
||||||
if ((!action.empty()) && (directkey != CRCInput::RC_nokey)) {
|
if ((!action.empty()) && (directkey != CRCInput::RC_nokey)) {
|
||||||
CLuaMenuForwarder *forwarder = new CLuaMenuForwarder(L, action, id);
|
CLuaMenuForwarder *forwarder = new CLuaMenuForwarder(L, action, id);
|
||||||
m->m->addKey(directkey, forwarder, action);
|
D->m->addKey(directkey, forwarder, action);
|
||||||
m->targets.push_back(forwarder);
|
D->targets.push_back(forwarder);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstMenu::MenuAddItem(lua_State *L)
|
int CLuaInstMenu::MenuAddItem(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMenu *m = MenuCheck(L, 1);
|
CLuaMenu *D = MenuCheck(L, 1);
|
||||||
if (!m) {
|
if (!D) {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -319,25 +318,25 @@ int CLuaInstMenu::MenuAddItem(lua_State *L)
|
|||||||
|
|
||||||
CMenuItem *mi = NULL;
|
CMenuItem *mi = NULL;
|
||||||
CLuaMenuItem i;
|
CLuaMenuItem i;
|
||||||
m->items.push_back(i);
|
D->items.push_back(i);
|
||||||
CLuaMenuItem *b = &m->items.back();
|
CLuaMenuItem *b = &D->items.back();
|
||||||
|
|
||||||
tableLookup(L, "name", b->name);
|
tableLookup(L, "name", b->name);
|
||||||
std::string type; tableLookup(L, "type", type);
|
std::string type; tableLookup(L, "type", type);
|
||||||
if (type == "back") {
|
if (type == "back") {
|
||||||
m->m->addItem(GenericMenuBack);
|
D->m->addItem(GenericMenuBack);
|
||||||
} else if (type == "next") {
|
} else if (type == "next") {
|
||||||
m->m->addItem(GenericMenuNext);
|
D->m->addItem(GenericMenuNext);
|
||||||
} else if (type == "cancel") {
|
} else if (type == "cancel") {
|
||||||
m->m->addItem(GenericMenuCancel);
|
D->m->addItem(GenericMenuCancel);
|
||||||
} else if (type == "separator") {
|
} else if (type == "separator") {
|
||||||
m->m->addItem(GenericMenuSeparator);
|
D->m->addItem(GenericMenuSeparator);
|
||||||
} else if ((type == "separatorline") || (type == "subhead")) {
|
} else if ((type == "separatorline") || (type == "subhead")) {
|
||||||
if (!b->name.empty()) {
|
if (!b->name.empty()) {
|
||||||
int flag = (type == "separatorline") ? CMenuSeparator::LINE : CMenuSeparator::SUB_HEAD;
|
int flag = (type == "separatorline") ? CMenuSeparator::LINE : CMenuSeparator::SUB_HEAD;
|
||||||
m->m->addItem(new CMenuSeparator(CMenuSeparator::STRING | flag, b->name.c_str(), NONEXISTANT_LOCALE));
|
D->m->addItem(new CMenuSeparator(CMenuSeparator::STRING | flag, b->name.c_str(), NONEXISTANT_LOCALE));
|
||||||
} else
|
} else
|
||||||
m->m->addItem(GenericMenuSeparatorLine);
|
D->m->addItem(GenericMenuSeparatorLine);
|
||||||
} else {
|
} else {
|
||||||
std::string right_icon_str; tableLookup(L, "right_icon", right_icon_str);
|
std::string right_icon_str; tableLookup(L, "right_icon", right_icon_str);
|
||||||
std::string action; tableLookup(L, "action", action);
|
std::string action; tableLookup(L, "action", action);
|
||||||
@@ -350,17 +349,17 @@ int CLuaInstMenu::MenuAddItem(lua_State *L)
|
|||||||
char *right_icon = NULL;
|
char *right_icon = NULL;
|
||||||
if (!right_icon_str.empty()) {
|
if (!right_icon_str.empty()) {
|
||||||
right_icon = strdup(right_icon_str.c_str());
|
right_icon = strdup(right_icon_str.c_str());
|
||||||
m->tofree.push_back(right_icon);
|
D->tofree.push_back(right_icon);
|
||||||
}
|
}
|
||||||
char *hint_icon = NULL;
|
char *hint_icon = NULL;
|
||||||
if (!hint_icon_str.empty()) {
|
if (!hint_icon_str.empty()) {
|
||||||
hint_icon = strdup(hint_icon_str.c_str());
|
hint_icon = strdup(hint_icon_str.c_str());
|
||||||
m->tofree.push_back(hint_icon);
|
D->tofree.push_back(hint_icon);
|
||||||
}
|
}
|
||||||
char *icon = NULL;
|
char *icon = NULL;
|
||||||
if (!icon_str.empty()) {
|
if (!icon_str.empty()) {
|
||||||
icon = strdup(icon_str.c_str());
|
icon = strdup(icon_str.c_str());
|
||||||
m->tofree.push_back(icon);
|
D->tofree.push_back(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_Unsigned directkey = CRCInput::RC_nokey; tableLookup(L, "directkey", directkey);
|
lua_Unsigned directkey = CRCInput::RC_nokey; tableLookup(L, "directkey", directkey);
|
||||||
@@ -384,7 +383,7 @@ int CLuaInstMenu::MenuAddItem(lua_State *L)
|
|||||||
mi = new CMenuForwarder(b->name, enabled, b->str_val, forwarder, NULL/*ActionKey*/, directkey, icon, right_icon);
|
mi = new CMenuForwarder(b->name, enabled, b->str_val, forwarder, NULL/*ActionKey*/, directkey, icon, right_icon);
|
||||||
if (!hint.empty() || hint_icon)
|
if (!hint.empty() || hint_icon)
|
||||||
mi->setHint(hint_icon, hint);
|
mi->setHint(hint_icon, hint);
|
||||||
m->targets.push_back(forwarder);
|
D->targets.push_back(forwarder);
|
||||||
} else if (type == "chooser") {
|
} else if (type == "chooser") {
|
||||||
int options_count = 0;
|
int options_count = 0;
|
||||||
lua_pushstring(L, "options");
|
lua_pushstring(L, "options");
|
||||||
@@ -396,13 +395,13 @@ int CLuaInstMenu::MenuAddItem(lua_State *L)
|
|||||||
}
|
}
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
if (options_count == 0) {
|
if (options_count == 0) {
|
||||||
m->m->addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, "ERROR! (options_count)", NONEXISTANT_LOCALE));
|
D->m->addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, "ERROR! (options_count)", NONEXISTANT_LOCALE));
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
CMenuOptionChooser::keyval_ext *kext = (CMenuOptionChooser::keyval_ext *)calloc(options_count, sizeof(CMenuOptionChooser::keyval_ext));
|
CMenuOptionChooser::keyval_ext *kext = (CMenuOptionChooser::keyval_ext *)calloc(options_count, sizeof(CMenuOptionChooser::keyval_ext));
|
||||||
m->tofree.push_back(kext);
|
D->tofree.push_back(kext);
|
||||||
lua_pushstring(L, "options");
|
lua_pushstring(L, "options");
|
||||||
lua_gettable(L, -2);
|
lua_gettable(L, -2);
|
||||||
b->int_val = 0;
|
b->int_val = 0;
|
||||||
@@ -415,38 +414,38 @@ int CLuaInstMenu::MenuAddItem(lua_State *L)
|
|||||||
kext[j].key = atoi(key);
|
kext[j].key = atoi(key);
|
||||||
kext[j].value = NONEXISTANT_LOCALE;
|
kext[j].value = NONEXISTANT_LOCALE;
|
||||||
kext[j].valname = strdup(val);
|
kext[j].valname = strdup(val);
|
||||||
m->tofree.push_back((void *)kext[j].valname);
|
D->tofree.push_back((void *)kext[j].valname);
|
||||||
if (!strcmp(value.c_str(), kext[j].valname))
|
if (!strcmp(value.c_str(), kext[j].valname))
|
||||||
b->int_val = kext[j].key;
|
b->int_val = kext[j].key;
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
mi = new CMenuOptionChooser(b->name.c_str(), &b->int_val, kext, options_count, enabled, m->observ, directkey, icon, pulldown);
|
mi = new CMenuOptionChooser(b->name.c_str(), &b->int_val, kext, options_count, enabled, D->observ, directkey, icon, pulldown);
|
||||||
} else if (type == "numeric") {
|
} else if (type == "numeric") {
|
||||||
b->int_val = range_from;
|
b->int_val = range_from;
|
||||||
sscanf(value.c_str(), "%d", &b->int_val);
|
sscanf(value.c_str(), "%d", &b->int_val);
|
||||||
mi = new CMenuOptionNumberChooser(b->name, &b->int_val, enabled, range_from, range_to, m->observ, 0, 0, NONEXISTANT_LOCALE, pulldown);
|
mi = new CMenuOptionNumberChooser(b->name, &b->int_val, enabled, range_from, range_to, D->observ, 0, 0, NONEXISTANT_LOCALE, pulldown);
|
||||||
} else if (type == "string") {
|
} else if (type == "string") {
|
||||||
b->str_val = value;
|
b->str_val = value;
|
||||||
mi = new CMenuOptionStringChooser(b->name.c_str(), &b->str_val, enabled, m->observ, directkey, icon, pulldown);
|
mi = new CMenuOptionStringChooser(b->name.c_str(), &b->str_val, enabled, D->observ, directkey, icon, pulldown);
|
||||||
} else if (type == "stringinput") {
|
} else if (type == "stringinput") {
|
||||||
b->str_val = value;
|
b->str_val = value;
|
||||||
std::string valid_chars = "abcdefghijklmnopqrstuvwxyz0123456789!\"<EFBFBD>$%&/()=?-. ";
|
std::string valid_chars = "abcdefghijklmnopqrstuvwxyz0123456789!\"<EFBFBD>$%&/()=?-. ";
|
||||||
tableLookup(L, "valid_chars", valid_chars);
|
tableLookup(L, "valid_chars", valid_chars);
|
||||||
lua_Integer sms = 0; tableLookup(L, "sms", sms);
|
lua_Integer sms = 0; tableLookup(L, "sms", sms);
|
||||||
lua_Integer size = 30; tableLookup(L, "size", size);
|
lua_Integer size = 30; tableLookup(L, "size", size);
|
||||||
CLuaMenuStringinput *stringinput = new CLuaMenuStringinput(L, action, id, b->name.c_str(), &b->str_val, size, valid_chars, m->observ, icon, sms);
|
CLuaMenuStringinput *stringinput = new CLuaMenuStringinput(L, action, id, b->name.c_str(), &b->str_val, size, valid_chars, D->observ, icon, sms);
|
||||||
mi = new CMenuForwarder(b->name, enabled, b->str_val, stringinput, NULL/*ActionKey*/, directkey, icon, right_icon);
|
mi = new CMenuForwarder(b->name, enabled, b->str_val, stringinput, NULL/*ActionKey*/, directkey, icon, right_icon);
|
||||||
m->targets.push_back(stringinput);
|
D->targets.push_back(stringinput);
|
||||||
} else if (type == "keyboardinput") {
|
} else if (type == "keyboardinput") {
|
||||||
b->str_val = value;
|
b->str_val = value;
|
||||||
lua_Integer size = 0; tableLookup(L, "size", size);
|
lua_Integer size = 0; tableLookup(L, "size", size);
|
||||||
std::string help = ""; tableLookup(L, "help", help);
|
std::string help = ""; tableLookup(L, "help", help);
|
||||||
std::string help2 = ""; tableLookup(L, "help2", help2);
|
std::string help2 = ""; tableLookup(L, "help2", help2);
|
||||||
CLuaMenuKeyboardinput *keyboardinput = new CLuaMenuKeyboardinput(L, action, id, b->name.c_str(), &b->str_val, size, m->observ, icon, help, help2);
|
CLuaMenuKeyboardinput *keyboardinput = new CLuaMenuKeyboardinput(L, action, id, b->name.c_str(), &b->str_val, size, D->observ, icon, help, help2);
|
||||||
mi = new CMenuForwarder(b->name, enabled, b->str_val, keyboardinput, NULL/*ActionKey*/, directkey, icon, right_icon);
|
mi = new CMenuForwarder(b->name, enabled, b->str_val, keyboardinput, NULL/*ActionKey*/, directkey, icon, right_icon);
|
||||||
m->targets.push_back(keyboardinput);
|
D->targets.push_back(keyboardinput);
|
||||||
} else if (type == "filebrowser") {
|
} else if (type == "filebrowser") {
|
||||||
b->str_val = value;
|
b->str_val = value;
|
||||||
lua_Integer dirMode = 0; tableLookup(L, "dir_mode", dirMode);
|
lua_Integer dirMode = 0; tableLookup(L, "dir_mode", dirMode);
|
||||||
@@ -462,19 +461,19 @@ int CLuaInstMenu::MenuAddItem(lua_State *L)
|
|||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
|
|
||||||
mi = new CMenuForwarder(b->name, enabled, b->str_val, filebrowser, NULL/*ActionKey*/, directkey, icon, right_icon);
|
mi = new CMenuForwarder(b->name, enabled, b->str_val, filebrowser, NULL/*ActionKey*/, directkey, icon, right_icon);
|
||||||
m->targets.push_back(filebrowser);
|
D->targets.push_back(filebrowser);
|
||||||
}
|
}
|
||||||
if (mi) {
|
if (mi) {
|
||||||
mi->setLua(L, action, id);
|
mi->setLua(L, action, id);
|
||||||
if (!hint.empty() || hint_icon)
|
if (!hint.empty() || hint_icon)
|
||||||
mi->setHint(hint_icon, hint);
|
mi->setHint(hint_icon, hint);
|
||||||
m->m->addItem(mi);
|
D->m->addItem(mi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mi) {
|
if (mi) {
|
||||||
lua_Integer id = m->itemmap.size() + 1;
|
lua_Integer id = D->itemmap.size() + 1;
|
||||||
m->itemmap.insert(itemmap_pair_t(id, mi));
|
D->itemmap.insert(itemmap_pair_t(id, mi));
|
||||||
lua_pushinteger(L, id);
|
lua_pushinteger(L, id);
|
||||||
} else
|
} else
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
@@ -484,35 +483,32 @@ int CLuaInstMenu::MenuAddItem(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMenu::MenuExec(lua_State *L)
|
int CLuaInstMenu::MenuExec(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMenu *m = MenuCheck(L, 1);
|
CLuaMenu *D = MenuCheck(L, 1);
|
||||||
if (!m)
|
if (!D) return 0;
|
||||||
return 0;
|
D->m->exec(NULL, "");
|
||||||
m->m->exec(NULL, "");
|
D->m->hide();
|
||||||
m->m->hide();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstMenu::MenuHide(lua_State *L)
|
int CLuaInstMenu::MenuHide(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMenu *m = MenuCheck(L, 1);
|
CLuaMenu *D = MenuCheck(L, 1);
|
||||||
if (!m)
|
if (!D) return 0;
|
||||||
return 0;
|
D->m->hide();
|
||||||
m->m->hide();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstMenu::MenuSetActive(lua_State *L)
|
int CLuaInstMenu::MenuSetActive(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMenu *m = MenuCheck(L, 1);
|
|
||||||
if (!m)
|
|
||||||
return 0;
|
|
||||||
lua_assert(lua_istable(L, 2));
|
lua_assert(lua_istable(L, 2));
|
||||||
|
CLuaMenu *D = MenuCheck(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
|
||||||
lua_Integer id; tableLookup(L, "item", id);
|
lua_Integer id; tableLookup(L, "item", id);
|
||||||
bool activ; tableLookup(L, "activ", activ);
|
bool activ; tableLookup(L, "activ", activ);
|
||||||
|
|
||||||
CMenuItem* item = NULL;
|
CMenuItem* item = NULL;
|
||||||
for (itemmap_iterator_t it = m->itemmap.begin(); it != m->itemmap.end(); ++it) {
|
for (itemmap_iterator_t it = D->itemmap.begin(); it != D->itemmap.end(); ++it) {
|
||||||
if (it->first == id) {
|
if (it->first == id) {
|
||||||
item = it->second;
|
item = it->second;
|
||||||
break;
|
break;
|
||||||
@@ -525,16 +521,15 @@ int CLuaInstMenu::MenuSetActive(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMenu::MenuSetName(lua_State *L)
|
int CLuaInstMenu::MenuSetName(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMenu *m = MenuCheck(L, 1);
|
|
||||||
if (!m)
|
|
||||||
return 0;
|
|
||||||
lua_assert(lua_istable(L, 2));
|
lua_assert(lua_istable(L, 2));
|
||||||
|
CLuaMenu *D = MenuCheck(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
|
||||||
lua_Integer id; tableLookup(L, "item", id);
|
lua_Integer id; tableLookup(L, "item", id);
|
||||||
std::string name; tableLookup(L, "name", name);
|
std::string name; tableLookup(L, "name", name);
|
||||||
|
|
||||||
CMenuItem* item = NULL;
|
CMenuItem* item = NULL;
|
||||||
for (itemmap_iterator_t it = m->itemmap.begin(); it != m->itemmap.end(); ++it) {
|
for (itemmap_iterator_t it = D->itemmap.begin(); it != D->itemmap.end(); ++it) {
|
||||||
if (it->first == id) {
|
if (it->first == id) {
|
||||||
item = it->second;
|
item = it->second;
|
||||||
break;
|
break;
|
||||||
@@ -547,19 +542,18 @@ int CLuaInstMenu::MenuSetName(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMenu::MenuDelete(lua_State *L)
|
int CLuaInstMenu::MenuDelete(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMenu *m = MenuCheck(L, 1);
|
CLuaMenu *D = MenuCheck(L, 1);
|
||||||
if (!m)
|
if (!D) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
while (!m->targets.empty()) {
|
while (!D->targets.empty()) {
|
||||||
delete m->targets.back();
|
delete D->targets.back();
|
||||||
m->targets.pop_back();
|
D->targets.pop_back();
|
||||||
}
|
}
|
||||||
while (!m->tofree.empty()) {
|
while (!D->tofree.empty()) {
|
||||||
free(m->tofree.back());
|
free(D->tofree.back());
|
||||||
m->tofree.pop_back();
|
D->tofree.pop_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
delete m;
|
delete D;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -90,6 +90,8 @@ int CLuaInstMisc::MiscNew(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::strFind(lua_State *L)
|
int CLuaInstMisc::strFind(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs < 3) {
|
if (numargs < 3) {
|
||||||
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 2 (or 3 or 4))\n", __func__, numargs);
|
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 2 (or 3 or 4))\n", __func__, numargs);
|
||||||
@@ -122,6 +124,8 @@ int CLuaInstMisc::strFind(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::strSub(lua_State *L)
|
int CLuaInstMisc::strSub(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs < 3) {
|
if (numargs < 3) {
|
||||||
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 2 (or 3))\n", __func__, numargs);
|
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 2 (or 3))\n", __func__, numargs);
|
||||||
@@ -146,6 +150,8 @@ int CLuaInstMisc::strSub(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::enableInfoClock(lua_State *L)
|
int CLuaInstMisc::enableInfoClock(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
bool enable = true;
|
bool enable = true;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs > 1)
|
if (numargs > 1)
|
||||||
@@ -156,6 +162,8 @@ int CLuaInstMisc::enableInfoClock(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::enableMuteIcon(lua_State *L)
|
int CLuaInstMisc::enableMuteIcon(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
bool enable = true;
|
bool enable = true;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs > 1)
|
if (numargs > 1)
|
||||||
@@ -166,6 +174,8 @@ int CLuaInstMisc::enableMuteIcon(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::setVolume(lua_State *L)
|
int CLuaInstMisc::setVolume(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
lua_Integer vol = luaL_checkint(L, 2);
|
lua_Integer vol = luaL_checkint(L, 2);
|
||||||
if (vol < 0) vol = 0;
|
if (vol < 0) vol = 0;
|
||||||
if (vol > 100) vol = 100;
|
if (vol > 100) vol = 100;
|
||||||
@@ -176,12 +186,16 @@ int CLuaInstMisc::setVolume(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::getVolume(lua_State *L)
|
int CLuaInstMisc::getVolume(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
lua_pushinteger(L, g_settings.current_volume);
|
lua_pushinteger(L, g_settings.current_volume);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstMisc::AudioMute(lua_State *L)
|
int CLuaInstMisc::AudioMute(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs < 2) {
|
if (numargs < 2) {
|
||||||
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 1 (or 2))\n", __func__, numargs);
|
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 1 (or 2))\n", __func__, numargs);
|
||||||
@@ -200,12 +214,16 @@ int CLuaInstMisc::AudioMute(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::isMuted(lua_State *L)
|
int CLuaInstMisc::isMuted(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
lua_pushboolean(L, CNeutrinoApp::getInstance()->isMuted());
|
lua_pushboolean(L, CNeutrinoApp::getInstance()->isMuted());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstMisc::runScriptExt(lua_State *L)
|
int CLuaInstMisc::runScriptExt(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
const char *script = luaL_checkstring(L, 2);
|
const char *script = luaL_checkstring(L, 2);
|
||||||
std::vector<std::string> args;
|
std::vector<std::string> args;
|
||||||
@@ -224,6 +242,8 @@ int CLuaInstMisc::runScriptExt(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::GetRevision(lua_State *L)
|
int CLuaInstMisc::GetRevision(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
unsigned int rev = 0;
|
unsigned int rev = 0;
|
||||||
std::string hw = "";
|
std::string hw = "";
|
||||||
#if HAVE_COOL_HARDWARE
|
#if HAVE_COOL_HARDWARE
|
||||||
@@ -237,6 +257,8 @@ int CLuaInstMisc::GetRevision(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::checkVersion(lua_State *L)
|
int CLuaInstMisc::checkVersion(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs < 3) {
|
if (numargs < 3) {
|
||||||
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 2)\n", __func__, numargs);
|
printf("CLuaInstMisc::%s: not enough arguments (%d, expected 2)\n", __func__, numargs);
|
||||||
@@ -261,6 +283,8 @@ int CLuaInstMisc::checkVersion(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstMisc::postMsg(lua_State *L)
|
int CLuaInstMisc::postMsg(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
lua_Integer msg = 0;
|
lua_Integer msg = 0;
|
||||||
neutrino_msg_t post_msg = 0;
|
neutrino_msg_t post_msg = 0;
|
||||||
msg = luaL_checkint(L, 2);
|
msg = luaL_checkint(L, 2);
|
||||||
@@ -278,6 +302,7 @@ int CLuaInstMisc::postMsg(lua_State *L)
|
|||||||
int CLuaInstMisc::MiscDelete(lua_State *L)
|
int CLuaInstMisc::MiscDelete(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaMisc *D = MiscCheckData(L, 1);
|
CLuaMisc *D = MiscCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
delete D;
|
delete D;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -73,6 +73,7 @@ int CLLThread::l_llthread_new(lua_State *L)
|
|||||||
int CLLThread::l_llthread_start(lua_State *L)
|
int CLLThread::l_llthread_start(lua_State *L)
|
||||||
{
|
{
|
||||||
llthread_t *_this = l_llthread_at(L, 1);
|
llthread_t *_this = l_llthread_at(L, 1);
|
||||||
|
if (!_this) return 0;
|
||||||
int start_detached = lua_toboolean(L, 2);
|
int start_detached = lua_toboolean(L, 2);
|
||||||
int joinable, rc;
|
int joinable, rc;
|
||||||
|
|
||||||
@@ -99,6 +100,7 @@ int CLLThread::l_llthread_start(lua_State *L)
|
|||||||
int CLLThread::l_llthread_cancel(lua_State *L)
|
int CLLThread::l_llthread_cancel(lua_State *L)
|
||||||
{
|
{
|
||||||
llthread_t *_this = l_llthread_at(L, 1);
|
llthread_t *_this = l_llthread_at(L, 1);
|
||||||
|
if (!_this) return 0;
|
||||||
/* llthread_child_t *child = _this->child; */
|
/* llthread_child_t *child = _this->child; */
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@@ -134,6 +136,7 @@ int CLLThread::l_llthread_cancel(lua_State *L)
|
|||||||
int CLLThread::l_llthread_join(lua_State *L)
|
int CLLThread::l_llthread_join(lua_State *L)
|
||||||
{
|
{
|
||||||
llthread_t *_this = l_llthread_at(L, 1);
|
llthread_t *_this = l_llthread_at(L, 1);
|
||||||
|
if (!_this) return 0;
|
||||||
llthread_child_t *child = _this->child;
|
llthread_child_t *child = _this->child;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@@ -191,6 +194,7 @@ int CLLThread::l_llthread_join(lua_State *L)
|
|||||||
int CLLThread::l_llthread_alive(lua_State *L)
|
int CLLThread::l_llthread_alive(lua_State *L)
|
||||||
{
|
{
|
||||||
llthread_t *_this = l_llthread_at(L, 1);
|
llthread_t *_this = l_llthread_at(L, 1);
|
||||||
|
if (!_this) return 0;
|
||||||
/* llthread_child_t *child = _this->child; */
|
/* llthread_child_t *child = _this->child; */
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@@ -234,6 +238,7 @@ int CLLThread::l_llthread_set_logger(lua_State *L)
|
|||||||
int CLLThread::l_llthread_started(lua_State *L)
|
int CLLThread::l_llthread_started(lua_State *L)
|
||||||
{
|
{
|
||||||
llthread_t *_this = l_llthread_at(L, 1);
|
llthread_t *_this = l_llthread_at(L, 1);
|
||||||
|
if (!_this) return 0;
|
||||||
lua_pushboolean(L, IS(_this, STARTED)?1:0);
|
lua_pushboolean(L, IS(_this, STARTED)?1:0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -241,6 +246,7 @@ int CLLThread::l_llthread_started(lua_State *L)
|
|||||||
int CLLThread::l_llthread_detached(lua_State *L)
|
int CLLThread::l_llthread_detached(lua_State *L)
|
||||||
{
|
{
|
||||||
llthread_t *_this = l_llthread_at(L, 1);
|
llthread_t *_this = l_llthread_at(L, 1);
|
||||||
|
if (!_this) return 0;
|
||||||
lua_pushboolean(L, IS(_this, DETACHED)?1:0);
|
lua_pushboolean(L, IS(_this, DETACHED)?1:0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -248,6 +254,7 @@ int CLLThread::l_llthread_detached(lua_State *L)
|
|||||||
int CLLThread::l_llthread_joinable(lua_State *L)
|
int CLLThread::l_llthread_joinable(lua_State *L)
|
||||||
{
|
{
|
||||||
llthread_t *_this = l_llthread_at(L, 1);
|
llthread_t *_this = l_llthread_at(L, 1);
|
||||||
|
if (!_this) return 0;
|
||||||
lua_pushboolean(L, IS(_this, JOINABLE)?1:0);
|
lua_pushboolean(L, IS(_this, JOINABLE)?1:0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -85,6 +85,8 @@ int CLuaInstVideo::VideoNew(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstVideo::setBlank(lua_State *L)
|
int CLuaInstVideo::setBlank(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
bool enable = true;
|
bool enable = true;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs > 1)
|
if (numargs > 1)
|
||||||
@@ -95,19 +97,25 @@ int CLuaInstVideo::setBlank(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstVideo::ShowPicture(lua_State *L)
|
int CLuaInstVideo::ShowPicture(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
const char *fname = luaL_checkstring(L, 2);
|
const char *fname = luaL_checkstring(L, 2);
|
||||||
CFrameBuffer::getInstance()->showFrame(fname);
|
CFrameBuffer::getInstance()->showFrame(fname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstVideo::StopPicture(lua_State */*L*/)
|
int CLuaInstVideo::StopPicture(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
CFrameBuffer::getInstance()->stopFrame();
|
CFrameBuffer::getInstance()->stopFrame();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstVideo::PlayFile(lua_State *L)
|
int CLuaInstVideo::PlayFile(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
LUA_DEBUG("CLuaInstVideo::%s %d\n", __func__, lua_gettop(L));
|
LUA_DEBUG("CLuaInstVideo::%s %d\n", __func__, lua_gettop(L));
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
|
|
||||||
@@ -117,10 +125,8 @@ int CLuaInstVideo::PlayFile(lua_State *L)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool sp = false;
|
bool sp = false;
|
||||||
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) {
|
if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL)
|
||||||
CLuaVideo *D = VideoCheckData(L, 1);
|
|
||||||
sp = D->singlePlay;
|
sp = D->singlePlay;
|
||||||
}
|
|
||||||
if ((sp == false) && (CMoviePlayerGui::getInstance().getBlockedFromPlugin() == false))
|
if ((sp == false) && (CMoviePlayerGui::getInstance().getBlockedFromPlugin() == false))
|
||||||
CMoviePlayerGui::getInstance().setBlockedFromPlugin(true);
|
CMoviePlayerGui::getInstance().setBlockedFromPlugin(true);
|
||||||
|
|
||||||
@@ -149,6 +155,8 @@ int CLuaInstVideo::PlayFile(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstVideo::zapitStopPlayBack(lua_State *L)
|
int CLuaInstVideo::zapitStopPlayBack(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
bool stop = true;
|
bool stop = true;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs > 1)
|
if (numargs > 1)
|
||||||
@@ -162,8 +170,10 @@ int CLuaInstVideo::zapitStopPlayBack(lua_State *L)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstVideo::channelRezap(lua_State */*L*/)
|
int CLuaInstVideo::channelRezap(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
CNeutrinoApp::getInstance()->channelRezap();
|
CNeutrinoApp::getInstance()->channelRezap();
|
||||||
if (CNeutrinoApp::getInstance()->getMode() == CNeutrinoApp::mode_radio)
|
if (CNeutrinoApp::getInstance()->getMode() == CNeutrinoApp::mode_radio)
|
||||||
CFrameBuffer::getInstance()->showFrame("radiomode.jpg");
|
CFrameBuffer::getInstance()->showFrame("radiomode.jpg");
|
||||||
@@ -172,6 +182,8 @@ int CLuaInstVideo::channelRezap(lua_State */*L*/)
|
|||||||
|
|
||||||
int CLuaInstVideo::createChannelIDfromUrl(lua_State *L)
|
int CLuaInstVideo::createChannelIDfromUrl(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs < 2) {
|
if (numargs < 2) {
|
||||||
printf("CLuaInstVideo::%s: no arguments\n", __func__);
|
printf("CLuaInstVideo::%s: no arguments\n", __func__);
|
||||||
@@ -195,18 +207,21 @@ int CLuaInstVideo::createChannelIDfromUrl(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstVideo::getNeutrinoMode(lua_State *L)
|
int CLuaInstVideo::getNeutrinoMode(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
lua_pushinteger(L, (lua_Integer)CNeutrinoApp::getInstance()->getMode());
|
lua_pushinteger(L, (lua_Integer)CNeutrinoApp::getInstance()->getMode());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CLuaInstVideo::setSinglePlay(lua_State *L)
|
int CLuaInstVideo::setSinglePlay(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
bool mode = true;
|
bool mode = true;
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
if (numargs > 1)
|
if (numargs > 1)
|
||||||
mode = _luaL_checkbool(L, 2);
|
mode = _luaL_checkbool(L, 2);
|
||||||
|
|
||||||
CLuaVideo *D = VideoCheckData(L, 1);
|
|
||||||
D->singlePlay = mode;
|
D->singlePlay = mode;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -214,6 +229,7 @@ int CLuaInstVideo::setSinglePlay(lua_State *L)
|
|||||||
int CLuaInstVideo::VideoDelete(lua_State *L)
|
int CLuaInstVideo::VideoDelete(lua_State *L)
|
||||||
{
|
{
|
||||||
CLuaVideo *D = VideoCheckData(L, 1);
|
CLuaVideo *D = VideoCheckData(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
delete D;
|
delete D;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -685,8 +685,7 @@ int CLuaInstance::GetInput(lua_State *L)
|
|||||||
neutrino_msg_t msg;
|
neutrino_msg_t msg;
|
||||||
neutrino_msg_data_t data;
|
neutrino_msg_data_t data;
|
||||||
CLuaData *W = CheckData(L, 1);
|
CLuaData *W = CheckData(L, 1);
|
||||||
if (!W)
|
if (!W) return 0;
|
||||||
return 0;
|
|
||||||
if (numargs > 1)
|
if (numargs > 1)
|
||||||
timeout = luaL_checkint(L, 2);
|
timeout = luaL_checkint(L, 2);
|
||||||
W->rcinput->getMsg_ms(&msg, &data, timeout);
|
W->rcinput->getMsg_ms(&msg, &data, timeout);
|
||||||
@@ -740,8 +739,7 @@ int CLuaInstance::PaintBox(lua_State *L)
|
|||||||
unsigned int c;
|
unsigned int c;
|
||||||
|
|
||||||
CLuaData *W = CheckData(L, 1);
|
CLuaData *W = CheckData(L, 1);
|
||||||
if (!W || !W->fbwin)
|
if (!W || !W->fbwin) return 0;
|
||||||
return 0;
|
|
||||||
x = luaL_checkint(L, 2);
|
x = luaL_checkint(L, 2);
|
||||||
y = luaL_checkint(L, 3);
|
y = luaL_checkint(L, 3);
|
||||||
w = luaL_checkint(L, 4);
|
w = luaL_checkint(L, 4);
|
||||||
@@ -778,8 +776,7 @@ int CLuaInstance::paintHLineRel(lua_State *L)
|
|||||||
unsigned int c;
|
unsigned int c;
|
||||||
|
|
||||||
CLuaData *W = CheckData(L, 1);
|
CLuaData *W = CheckData(L, 1);
|
||||||
if (!W || !W->fbwin)
|
if (!W || !W->fbwin) return 0;
|
||||||
return 0;
|
|
||||||
x = luaL_checkint(L, 2);
|
x = luaL_checkint(L, 2);
|
||||||
dx = luaL_checkint(L, 3);
|
dx = luaL_checkint(L, 3);
|
||||||
y = luaL_checkint(L, 4);
|
y = luaL_checkint(L, 4);
|
||||||
@@ -807,8 +804,7 @@ int CLuaInstance::paintVLineRel(lua_State *L)
|
|||||||
unsigned int c;
|
unsigned int c;
|
||||||
|
|
||||||
CLuaData *W = CheckData(L, 1);
|
CLuaData *W = CheckData(L, 1);
|
||||||
if (!W || !W->fbwin)
|
if (!W || !W->fbwin) return 0;
|
||||||
return 0;
|
|
||||||
x = luaL_checkint(L, 2);
|
x = luaL_checkint(L, 2);
|
||||||
y = luaL_checkint(L, 3);
|
y = luaL_checkint(L, 3);
|
||||||
dy = luaL_checkint(L, 4);
|
dy = luaL_checkint(L, 4);
|
||||||
@@ -845,8 +841,7 @@ int CLuaInstance::RenderString(lua_State *L)
|
|||||||
center = 0;
|
center = 0;
|
||||||
|
|
||||||
CLuaData *W = CheckData(L, 1);
|
CLuaData *W = CheckData(L, 1);
|
||||||
if (!W || !W->fbwin)
|
if (!W || !W->fbwin) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
int step = 0;
|
int step = 0;
|
||||||
bool isDynFont = false;
|
bool isDynFont = false;
|
||||||
@@ -915,8 +910,7 @@ int CLuaInstance::getRenderWidth(lua_State *L)
|
|||||||
LUA_DEBUG("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
LUA_DEBUG("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
||||||
|
|
||||||
CLuaData *W = CheckData(L, 1);
|
CLuaData *W = CheckData(L, 1);
|
||||||
if (!W)
|
if (!W) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
int step = 0;
|
int step = 0;
|
||||||
bool isDynFont = false;
|
bool isDynFont = false;
|
||||||
@@ -959,8 +953,7 @@ int CLuaInstance::FontHeight(lua_State *L)
|
|||||||
LUA_DEBUG("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
LUA_DEBUG("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
||||||
|
|
||||||
CLuaData *W = CheckData(L, 1);
|
CLuaData *W = CheckData(L, 1);
|
||||||
if (!W)
|
if (!W) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
int step = 0;
|
int step = 0;
|
||||||
bool isDynFont = false;
|
bool isDynFont = false;
|
||||||
@@ -999,8 +992,7 @@ int CLuaInstance::getDynFont(lua_State *L)
|
|||||||
{
|
{
|
||||||
int numargs = lua_gettop(L);
|
int numargs = lua_gettop(L);
|
||||||
CLuaData *W = CheckData(L, 1);
|
CLuaData *W = CheckData(L, 1);
|
||||||
if (!W || !W->fbwin)
|
if (!W || !W->fbwin) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (numargs < 3) {
|
if (numargs < 3) {
|
||||||
printf("CLuaInstance::%s: not enough arguments (%d, expected 2)\n", __func__, numargs);
|
printf("CLuaInstance::%s: not enough arguments (%d, expected 2)\n", __func__, numargs);
|
||||||
@@ -1056,8 +1048,7 @@ int CLuaInstance::PaintIcon(lua_State *L)
|
|||||||
const char *fname;
|
const char *fname;
|
||||||
|
|
||||||
CLuaData *W = CheckData(L, 1);
|
CLuaData *W = CheckData(L, 1);
|
||||||
if (!W || !W->fbwin)
|
if (!W || !W->fbwin) return 0;
|
||||||
return 0;
|
|
||||||
fname = luaL_checkstring(L, 2);
|
fname = luaL_checkstring(L, 2);
|
||||||
x = luaL_checkint(L, 3);
|
x = luaL_checkint(L, 3);
|
||||||
y = luaL_checkint(L, 4);
|
y = luaL_checkint(L, 4);
|
||||||
@@ -1069,6 +1060,8 @@ int CLuaInstance::PaintIcon(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstance::DisplayImage(lua_State *L)
|
int CLuaInstance::DisplayImage(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaData *W = CheckData(L, 1);
|
||||||
|
if (!W) return 0;
|
||||||
LUA_DEBUG("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
LUA_DEBUG("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
const char *fname;
|
const char *fname;
|
||||||
@@ -1087,6 +1080,8 @@ int CLuaInstance::DisplayImage(lua_State *L)
|
|||||||
|
|
||||||
int CLuaInstance::GetSize(lua_State *L)
|
int CLuaInstance::GetSize(lua_State *L)
|
||||||
{
|
{
|
||||||
|
CLuaData *W = CheckData(L, 1);
|
||||||
|
if (!W) return 0;
|
||||||
LUA_DEBUG("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
LUA_DEBUG("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
||||||
int w = 0, h = 0;
|
int w = 0, h = 0;
|
||||||
const char *fname;
|
const char *fname;
|
||||||
@@ -1105,8 +1100,7 @@ int CLuaInstance::saveScreen(lua_State *L)
|
|||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
fb_pixel_t* buf;
|
fb_pixel_t* buf;
|
||||||
CLuaData *W = CheckData(L, 1);
|
CLuaData *W = CheckData(L, 1);
|
||||||
if (!W || !W->fbwin)
|
if (!W || !W->fbwin) return 0;
|
||||||
return 0;
|
|
||||||
x = luaL_checkint(L, 2);
|
x = luaL_checkint(L, 2);
|
||||||
y = luaL_checkint(L, 3);
|
y = luaL_checkint(L, 3);
|
||||||
w = luaL_checkint(L, 4);
|
w = luaL_checkint(L, 4);
|
||||||
@@ -1126,8 +1120,7 @@ int CLuaInstance::restoreScreen(lua_State *L)
|
|||||||
fb_pixel_t* buf = NULL;
|
fb_pixel_t* buf = NULL;
|
||||||
bool del;
|
bool del;
|
||||||
CLuaData *W = CheckData(L, 1);
|
CLuaData *W = CheckData(L, 1);
|
||||||
if (!W || !W->fbwin)
|
if (!W || !W->fbwin) return 0;
|
||||||
return 0;
|
|
||||||
x = luaL_checkint(L, 2);
|
x = luaL_checkint(L, 2);
|
||||||
y = luaL_checkint(L, 3);
|
y = luaL_checkint(L, 3);
|
||||||
w = luaL_checkint(L, 4);
|
w = luaL_checkint(L, 4);
|
||||||
@@ -1152,8 +1145,7 @@ int CLuaInstance::deleteSavedScreen(lua_State *L)
|
|||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
CLuaData *W = CheckData(L, 1);
|
CLuaData *W = CheckData(L, 1);
|
||||||
if (!W || !W->fbwin)
|
if (!W || !W->fbwin) return 0;
|
||||||
return 0;
|
|
||||||
id = luaL_checkint(L, 2);
|
id = luaL_checkint(L, 2);
|
||||||
|
|
||||||
for (screenmap_iterator_t it = W->screenmap.begin(); it != W->screenmap.end(); ++it) {
|
for (screenmap_iterator_t it = W->screenmap.begin(); it != W->screenmap.end(); ++it) {
|
||||||
|
Reference in New Issue
Block a user