mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
lua: pictureviewer support
Origin commit data
------------------
Commit: 007d700d53
Author: martii <m4rtii@gmx.de>
Date: 2013-05-17 (Fri, 17 May 2013)
This commit is contained in:
@@ -28,6 +28,7 @@
|
|||||||
#include <gui/widget/msgbox.h>
|
#include <gui/widget/msgbox.h>
|
||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
#include <gui/filebrowser.h>
|
#include <gui/filebrowser.h>
|
||||||
|
#include <driver/pictureviewer/pictureviewer.h>
|
||||||
#endif
|
#endif
|
||||||
#include <neutrino.h>
|
#include <neutrino.h>
|
||||||
|
|
||||||
@@ -346,6 +347,8 @@ const luaL_Reg CLuaInstance::methods[] =
|
|||||||
{ "GetInput", CLuaInstance::GetInput },
|
{ "GetInput", CLuaInstance::GetInput },
|
||||||
{ "FontHeight", CLuaInstance::FontHeight },
|
{ "FontHeight", CLuaInstance::FontHeight },
|
||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
|
{ "GetSize", CLuaInstance::GetSize },
|
||||||
|
{ "DisplayImage", CLuaInstance::DisplayImage },
|
||||||
{ "Blit", CLuaInstance::Blit },
|
{ "Blit", CLuaInstance::Blit },
|
||||||
{ "GetLanguage", CLuaInstance::GetLanguage },
|
{ "GetLanguage", CLuaInstance::GetLanguage },
|
||||||
#endif
|
#endif
|
||||||
@@ -513,6 +516,41 @@ int CLuaInstance::PaintIcon(lua_State *L)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MARTII
|
||||||
|
extern CPictureViewer * g_PicViewer;
|
||||||
|
|
||||||
|
int CLuaInstance::DisplayImage(lua_State *L)
|
||||||
|
{
|
||||||
|
DBG("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
||||||
|
int x, y, w, h;
|
||||||
|
const char *fname;
|
||||||
|
|
||||||
|
fname = luaL_checkstring(L, 2);
|
||||||
|
x = luaL_checkint(L, 3);
|
||||||
|
y = luaL_checkint(L, 4);
|
||||||
|
w = luaL_checkint(L, 5);
|
||||||
|
h = luaL_checkint(L, 6);
|
||||||
|
int trans = 0;
|
||||||
|
if (lua_isnumber(L, 7))
|
||||||
|
trans = luaL_checkint(L, 7);
|
||||||
|
g_PicViewer->DisplayImage(fname, x, y, w, h, trans);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CLuaInstance::GetSize(lua_State *L)
|
||||||
|
{
|
||||||
|
DBG("CLuaInstance::%s %d\n", __func__, lua_gettop(L));
|
||||||
|
int w = 0, h = 0;
|
||||||
|
const char *fname;
|
||||||
|
|
||||||
|
fname = luaL_checkstring(L, 2);
|
||||||
|
g_PicViewer->getSize(fname, &w, &h);
|
||||||
|
lua_pushinteger(L, w);
|
||||||
|
lua_pushinteger(L, h);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int CLuaInstance::RenderString(lua_State *L)
|
int CLuaInstance::RenderString(lua_State *L)
|
||||||
{
|
{
|
||||||
int x, y, w, boxh, f, center;
|
int x, y, w, boxh, f, center;
|
||||||
|
@@ -152,6 +152,8 @@ private:
|
|||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
static int Blit(lua_State *L);
|
static int Blit(lua_State *L);
|
||||||
static int GetLanguage(lua_State *L);
|
static int GetLanguage(lua_State *L);
|
||||||
|
static int GetSize(lua_State *L);
|
||||||
|
static int DisplayImage(lua_State *L);
|
||||||
|
|
||||||
void MenueRegister(lua_State *L);
|
void MenueRegister(lua_State *L);
|
||||||
static int MenueNew(lua_State *L);
|
static int MenueNew(lua_State *L);
|
||||||
|
Reference in New Issue
Block a user