From 04498b79f4bf3c426438a1c12b7494fb20131cb2 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 20 Aug 2016 09:54:12 +0200 Subject: [PATCH 1/5] supplement to 0dc1041788247d6447bc2e21c81a5f7d8c195334 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/27ddf8935d36ff8a73ee9ac7aa24d41e53c31921 Author: Jacek Jendrzej Date: 2016-08-20 (Sat, 20 Aug 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/lua/lua_cc_text.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index 243aeaf3a..e4c8d637e 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -140,14 +140,14 @@ int CLuaInstCCText::CCTextNew(lua_State *L) CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL; if(pw){ - if(dx == -1) + if(dx < 1) dx = pw->getHeight(); - if(dy == -1) + if(dy < 1) dy = pw->getWidth(); } - if(dx == -1) + if(dx < 1) dx = 100; - if(dy == -1) + if(dy < 1) dy = 100; CLuaCCText **udata = (CLuaCCText **) lua_newuserdata(L, sizeof(CLuaCCText *)); From eb7f2c4fa83f225309834d9c72c3edd528c26e67 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 20 Aug 2016 13:59:15 +0200 Subject: [PATCH 2/5] 2:supplement to 0dc1041788247d6447bc2e21c81a5f7d8c195334 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c37ef21912e77cf5673642c6fabfe46556541d2b Author: Jacek Jendrzej Date: 2016-08-20 (Sat, 20 Aug 2016) Origin message was: ------------------ 2:supplement to 0dc1041788247d6447bc2e21c81a5f7d8c195334 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/lua/lua_cc_text.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index e4c8d637e..60f23f78c 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -140,10 +140,10 @@ int CLuaInstCCText::CCTextNew(lua_State *L) CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL; if(pw){ - if(dx < 1) - dx = pw->getHeight(); if(dy < 1) - dy = pw->getWidth(); + dy = pw->getHeight(); + if(dx < 1) + dx = pw->getWidth(); } if(dx < 1) dx = 100; From f30dc8988da9b674dc927eef9663edd08c4f6f2c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 20 Aug 2016 16:20:16 +0200 Subject: [PATCH 3/5] src/gui/components/cc_frm_window.cpp dont paint over screen size Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/912017621ba3c0a753514fd6c69ea1f3377e8af5 Author: Jacek Jendrzej Date: 2016-08-20 (Sat, 20 Aug 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_window.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 869acd530..e808e28b1 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -170,8 +170,13 @@ void CComponentsWindow::initWindowSize() if (width == 0) width = frameBuffer->getScreenWidth(); + else if ((unsigned)width > frameBuffer->getScreenWidth()) + width = frameBuffer->getScreenWidth(); + if (height == 0) height = frameBuffer->getScreenHeight(); + else if((unsigned)height > frameBuffer->getScreenHeight()) + height = frameBuffer->getScreenHeight(); } void CComponentsWindow::initWindowPos() From f6600ae12753e00fa081be6780827986f3cadfa4 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 21 Aug 2016 16:17:28 +0200 Subject: [PATCH 4/5] lua_cc_picture: add cpicture getHeight / getWidth option Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d5051a100fbc738f344749d30c51a47b6eb551df Author: Jacek Jendrzej Date: 2016-08-21 (Sun, 21 Aug 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/lua/lua_cc_picture.cpp | 22 ++++++++++++++++++++++ src/gui/lua/lua_cc_picture.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/src/gui/lua/lua_cc_picture.cpp b/src/gui/lua/lua_cc_picture.cpp index 926bb520f..b383bd79b 100644 --- a/src/gui/lua/lua_cc_picture.cpp +++ b/src/gui/lua/lua_cc_picture.cpp @@ -57,6 +57,8 @@ void CLuaInstCCPicture::CCPictureRegister(lua_State *L) { "hide", CLuaInstCCPicture::CCPictureHide }, { "setPicture", CLuaInstCCPicture::CCPictureSetPicture }, { "setCenterPos", CLuaInstCCPicture::CCPictureSetCenterPos }, + { "getHeight", CLuaInstCCPicture::CCPictureGetHeight }, + { "getWidth", CLuaInstCCPicture::CCPictureGetWidth }, { "__gc", CLuaInstCCPicture::CCPictureDelete }, { NULL, NULL } }; @@ -126,6 +128,26 @@ int CLuaInstCCPicture::CCPictureNew(lua_State *L) 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) { lua_assert(lua_istable(L,1)); diff --git a/src/gui/lua/lua_cc_picture.h b/src/gui/lua/lua_cc_picture.h index 2fb7c3e14..8bbc697ad 100644 --- a/src/gui/lua/lua_cc_picture.h +++ b/src/gui/lua/lua_cc_picture.h @@ -46,6 +46,8 @@ class CLuaInstCCPicture static int CCPictureHide(lua_State *L); static int CCPictureSetPicture(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); }; From 5ff20dd0fd39a1478aa8f5dc855bf8025869bebe Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 21 Aug 2016 18:29:10 +0200 Subject: [PATCH 5/5] lua_cc_window: add setDimensionsAll option Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5c26de095c29ce2e44243f196e8eac6b8b1b50eb Author: Jacek Jendrzej Date: 2016-08-21 (Sun, 21 Aug 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/lua/lua_cc_window.cpp | 23 +++++++++++++++++++++++ src/gui/lua/lua_cc_window.h | 1 + 2 files changed, 24 insertions(+) diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 9977bfa2b..754a1c16d 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -56,6 +56,7 @@ void CLuaInstCCWindow::CCWindowRegister(lua_State *L) { "header_height", CLuaInstCCWindow::CCWindowGetHeaderHeight_dep }, /* function 'header_height' is deprecated */ { "footer_height", CLuaInstCCWindow::CCWindowGetFooterHeight_dep }, /* function 'footer_height' is deprecated */ { "setCenterPos", CLuaInstCCWindow::CCWindowSetCenterPos }, + { "setDimensionsAll", CLuaInstCCWindow::CCWindowSetDimensionsAll }, { "__gc", CLuaInstCCWindow::CCWindowDelete }, { NULL, NULL } }; @@ -295,6 +296,28 @@ int CLuaInstCCWindow::CCWindowGetFooterHeight(lua_State *L) 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) { lua_assert(lua_istable(L,1)); diff --git a/src/gui/lua/lua_cc_window.h b/src/gui/lua/lua_cc_window.h index 0e32bc386..98cd9ac86 100644 --- a/src/gui/lua/lua_cc_window.h +++ b/src/gui/lua/lua_cc_window.h @@ -51,6 +51,7 @@ class CLuaInstCCWindow static int CCWindowGetFooterHeight_dep(lua_State *L); // function 'footer_height' is deprecated static int CCWindowSetCenterPos(lua_State *L); static int CCWindowDelete(lua_State *L); + static int CCWindowSetDimensionsAll(lua_State *L); }; #endif //_LUACCWINDOW_H