mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 09:21:18 +02:00
CLuaInstance::CPictureNew: Add parameter 'transparent' for cpicture.new
- Default is CFrameBuffer::TM_NONE (No 'pseudo' transparency)
This commit is contained in:
@@ -1896,6 +1896,12 @@ int CLuaInstance::CPictureNew(lua_State *L)
|
|||||||
lua_Integer color_background = (lua_Integer)COL_MENUCONTENT_PLUS_0;
|
lua_Integer color_background = (lua_Integer)COL_MENUCONTENT_PLUS_0;
|
||||||
lua_Integer color_shadow = (lua_Integer)COL_MENUCONTENTDARK_PLUS_0;
|
lua_Integer color_shadow = (lua_Integer)COL_MENUCONTENTDARK_PLUS_0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
transparency = CFrameBuffer::TM_BLACK (2): Transparency when black content ('pseudo' transparency)
|
||||||
|
transparency = CFrameBuffer::TM_NONE (1): No 'pseudo' transparency
|
||||||
|
*/
|
||||||
|
lua_Integer transparency = CFrameBuffer::TM_NONE;
|
||||||
|
|
||||||
tableLookup(L, "parent" , (void**)&parent);
|
tableLookup(L, "parent" , (void**)&parent);
|
||||||
tableLookup(L, "x" , x);
|
tableLookup(L, "x" , x);
|
||||||
tableLookup(L, "y" , y);
|
tableLookup(L, "y" , y);
|
||||||
@@ -1912,12 +1918,13 @@ int CLuaInstance::CPictureNew(lua_State *L)
|
|||||||
tableLookup(L, "color_frame" , color_frame);
|
tableLookup(L, "color_frame" , color_frame);
|
||||||
tableLookup(L, "color_background" , color_background);
|
tableLookup(L, "color_background" , color_background);
|
||||||
tableLookup(L, "color_shadow" , color_shadow);
|
tableLookup(L, "color_shadow" , color_shadow);
|
||||||
|
tableLookup(L, "transparency" , transparency);
|
||||||
|
|
||||||
CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL;
|
CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL;
|
||||||
|
|
||||||
CLuaPicture **udata = (CLuaPicture **) lua_newuserdata(L, sizeof(CLuaPicture *));
|
CLuaPicture **udata = (CLuaPicture **) lua_newuserdata(L, sizeof(CLuaPicture *));
|
||||||
*udata = new CLuaPicture();
|
*udata = new CLuaPicture();
|
||||||
(*udata)->cp = new CComponentsPicture(x, y, dx, dy, image_name, pw, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_background, (fb_pixel_t)color_shadow);
|
(*udata)->cp = new CComponentsPicture(x, y, dx, dy, image_name, pw, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_background, (fb_pixel_t)color_shadow, transparency);
|
||||||
(*udata)->parent = pw;
|
(*udata)->parent = pw;
|
||||||
luaL_getmetatable(L, "cpicture");
|
luaL_getmetatable(L, "cpicture");
|
||||||
lua_setmetatable(L, -2);
|
lua_setmetatable(L, -2);
|
||||||
|
Reference in New Issue
Block a user