mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-03 19:01:13 +02:00
Merge branch 'cst-next' of git://coolstreamtech.de/cst-public-gui-neutrino into ni/cst-next
Origin commit data
------------------
Branch: ni/coolstream
Commit: ed9d7b641c
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-08-21 (Sun, 21 Aug 2016)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -170,8 +170,13 @@ void CComponentsWindow::initWindowSize()
|
|||||||
|
|
||||||
if (width == 0)
|
if (width == 0)
|
||||||
width = frameBuffer->getScreenWidth();
|
width = frameBuffer->getScreenWidth();
|
||||||
|
else if ((unsigned)width > frameBuffer->getScreenWidth())
|
||||||
|
width = frameBuffer->getScreenWidth();
|
||||||
|
|
||||||
if (height == 0)
|
if (height == 0)
|
||||||
height = frameBuffer->getScreenHeight();
|
height = frameBuffer->getScreenHeight();
|
||||||
|
else if((unsigned)height > frameBuffer->getScreenHeight())
|
||||||
|
height = frameBuffer->getScreenHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CComponentsWindow::initWindowPos()
|
void CComponentsWindow::initWindowPos()
|
||||||
|
@@ -57,6 +57,8 @@ void CLuaInstCCPicture::CCPictureRegister(lua_State *L)
|
|||||||
{ "hide", CLuaInstCCPicture::CCPictureHide },
|
{ "hide", CLuaInstCCPicture::CCPictureHide },
|
||||||
{ "setPicture", CLuaInstCCPicture::CCPictureSetPicture },
|
{ "setPicture", CLuaInstCCPicture::CCPictureSetPicture },
|
||||||
{ "setCenterPos", CLuaInstCCPicture::CCPictureSetCenterPos },
|
{ "setCenterPos", CLuaInstCCPicture::CCPictureSetCenterPos },
|
||||||
|
{ "getHeight", CLuaInstCCPicture::CCPictureGetHeight },
|
||||||
|
{ "getWidth", CLuaInstCCPicture::CCPictureGetWidth },
|
||||||
{ "__gc", CLuaInstCCPicture::CCPictureDelete },
|
{ "__gc", CLuaInstCCPicture::CCPictureDelete },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
@@ -126,6 +128,26 @@ int CLuaInstCCPicture::CCPictureNew(lua_State *L)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CLuaInstCCPicture::CCPictureGetHeight(lua_State *L)
|
||||||
|
{
|
||||||
|
CLuaCCPicture *D = CCPictureCheck(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
|
||||||
|
int h = D->cp->getHeight();
|
||||||
|
lua_pushinteger(L, h);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CLuaInstCCPicture::CCPictureGetWidth(lua_State *L)
|
||||||
|
{
|
||||||
|
CLuaCCPicture *D = CCPictureCheck(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
|
||||||
|
int w = D->cp->getWidth();
|
||||||
|
lua_pushinteger(L, w);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int CLuaInstCCPicture::CCPicturePaint(lua_State *L)
|
int CLuaInstCCPicture::CCPicturePaint(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
|
@@ -46,6 +46,8 @@ class CLuaInstCCPicture
|
|||||||
static int CCPictureHide(lua_State *L);
|
static int CCPictureHide(lua_State *L);
|
||||||
static int CCPictureSetPicture(lua_State *L);
|
static int CCPictureSetPicture(lua_State *L);
|
||||||
static int CCPictureSetCenterPos(lua_State *L);
|
static int CCPictureSetCenterPos(lua_State *L);
|
||||||
|
static int CCPictureGetHeight(lua_State *L);
|
||||||
|
static int CCPictureGetWidth(lua_State *L);
|
||||||
static int CCPictureDelete(lua_State *L);
|
static int CCPictureDelete(lua_State *L);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -140,14 +140,14 @@ int CLuaInstCCText::CCTextNew(lua_State *L)
|
|||||||
|
|
||||||
CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL;
|
CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL;
|
||||||
if(pw){
|
if(pw){
|
||||||
if(dx == -1)
|
if(dy < 1)
|
||||||
dx = pw->getHeight();
|
dy = pw->getHeight();
|
||||||
if(dy == -1)
|
if(dx < 1)
|
||||||
dy = pw->getWidth();
|
dx = pw->getWidth();
|
||||||
}
|
}
|
||||||
if(dx == -1)
|
if(dx < 1)
|
||||||
dx = 100;
|
dx = 100;
|
||||||
if(dy == -1)
|
if(dy < 1)
|
||||||
dy = 100;
|
dy = 100;
|
||||||
|
|
||||||
CLuaCCText **udata = (CLuaCCText **) lua_newuserdata(L, sizeof(CLuaCCText *));
|
CLuaCCText **udata = (CLuaCCText **) lua_newuserdata(L, sizeof(CLuaCCText *));
|
||||||
|
@@ -56,6 +56,7 @@ void CLuaInstCCWindow::CCWindowRegister(lua_State *L)
|
|||||||
{ "header_height", CLuaInstCCWindow::CCWindowGetHeaderHeight_dep }, /* function 'header_height' is deprecated */
|
{ "header_height", CLuaInstCCWindow::CCWindowGetHeaderHeight_dep }, /* function 'header_height' is deprecated */
|
||||||
{ "footer_height", CLuaInstCCWindow::CCWindowGetFooterHeight_dep }, /* function 'footer_height' is deprecated */
|
{ "footer_height", CLuaInstCCWindow::CCWindowGetFooterHeight_dep }, /* function 'footer_height' is deprecated */
|
||||||
{ "setCenterPos", CLuaInstCCWindow::CCWindowSetCenterPos },
|
{ "setCenterPos", CLuaInstCCWindow::CCWindowSetCenterPos },
|
||||||
|
{ "setDimensionsAll", CLuaInstCCWindow::CCWindowSetDimensionsAll },
|
||||||
{ "__gc", CLuaInstCCWindow::CCWindowDelete },
|
{ "__gc", CLuaInstCCWindow::CCWindowDelete },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
@@ -295,6 +296,28 @@ int CLuaInstCCWindow::CCWindowGetFooterHeight(lua_State *L)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CLuaInstCCWindow::CCWindowSetDimensionsAll(lua_State *L)
|
||||||
|
{
|
||||||
|
CLuaCCWindow *D = CCWindowCheck(L, 1);
|
||||||
|
if (!D) return 0;
|
||||||
|
lua_Integer x = luaL_checkint(L, 2);
|
||||||
|
lua_Integer y = luaL_checkint(L, 3);
|
||||||
|
lua_Integer w = luaL_checkint(L, 4);
|
||||||
|
lua_Integer h = luaL_checkint(L, 5);
|
||||||
|
if(x>-1 && y > -1 && w > 1 && h > 1){
|
||||||
|
if (h > (lua_Integer)CFrameBuffer::getInstance()->getScreenHeight())
|
||||||
|
h = (lua_Integer)CFrameBuffer::getInstance()->getScreenHeight();
|
||||||
|
if (w > (lua_Integer)CFrameBuffer::getInstance()->getScreenWidth())
|
||||||
|
w = (lua_Integer)CFrameBuffer::getInstance()->getScreenWidth();
|
||||||
|
if(x > w)
|
||||||
|
x = 0;
|
||||||
|
if(y > h)
|
||||||
|
y = 0;
|
||||||
|
D->w->setDimensionsAll(x,y,w,h);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int CLuaInstCCWindow::CCWindowSetCenterPos(lua_State *L)
|
int CLuaInstCCWindow::CCWindowSetCenterPos(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_assert(lua_istable(L,1));
|
lua_assert(lua_istable(L,1));
|
||||||
|
@@ -51,6 +51,7 @@ class CLuaInstCCWindow
|
|||||||
static int CCWindowGetFooterHeight_dep(lua_State *L); // function 'footer_height' is deprecated
|
static int CCWindowGetFooterHeight_dep(lua_State *L); // function 'footer_height' is deprecated
|
||||||
static int CCWindowSetCenterPos(lua_State *L);
|
static int CCWindowSetCenterPos(lua_State *L);
|
||||||
static int CCWindowDelete(lua_State *L);
|
static int CCWindowDelete(lua_State *L);
|
||||||
|
static int CCWindowSetDimensionsAll(lua_State *L);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //_LUACCWINDOW_H
|
#endif //_LUACCWINDOW_H
|
||||||
|
Reference in New Issue
Block a user