From e3dbb16059cd059e77e768fcbc044afe14c4b54e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 21 Jan 2016 08:24:21 +0100 Subject: [PATCH 01/14] infoviewer_bb: make showIcon_DD() public Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1a290fb0cccd6e38a31c28635469e967a6156aff Author: vanhofen Date: 2016-01-21 (Thu, 21 Jan 2016) Origin message was: ------------------ - infoviewer_bb: make showIcon_DD() public ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer_bb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/infoviewer_bb.h b/src/gui/infoviewer_bb.h index 4a7944028..1c690a677 100644 --- a/src/gui/infoviewer_bb.h +++ b/src/gui/infoviewer_bb.h @@ -113,7 +113,6 @@ class CInfoViewerBB void showBBIcons(const int modus, const std::string & icon); void getBBIconInfo(void); bool checkBBIcon(const char * const icon, int *w, int *h); - void showIcon_DD(void); void paint_ca_icons(int, const char*, int&); void paintCA_bar(int,int); @@ -143,6 +142,7 @@ class CInfoViewerBB void showIcon_SubT(); void showIcon_Resolution(); void showIcon_Tuner(void); + void showIcon_DD(void); void showBBButtons(const int modus=-1); void paintshowButtonBar(); void getBBButtonInfo(void); From a200d57ccfadb3313a06f9cbafb540b4dbef6088 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 21 Jan 2016 08:25:18 +0100 Subject: [PATCH 02/14] infoviewer: fix display of DolbyDigital icon Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2694b87d0806d8120562673dd246a89c81694aa9 Author: vanhofen Date: 2016-01-21 (Thu, 21 Jan 2016) Origin message was: ------------------ - infoviewer: fix display of DolbyDigital icon ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 16 ++++++---------- src/gui/infoviewer_bb.cpp | 3 --- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index f28909a5f..f1eeddc74 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1366,20 +1366,18 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) if (is_visible) showRecordIcon(true); } else if (msg == NeutrinoMessages::EVT_ZAP_GOTAPIDS) { if ((*(t_channel_id *) data) == current_channel_id) { -#if 0 - if (is_visible && showButtonBar) - infoViewerBB->showBBButtons(CInfoViewerBB::BUTTON_GREEN); -#endif + if (is_visible && showButtonBar) { + infoViewerBB->showIcon_DD(); + infoViewerBB->showBBButtons(); // in case button text has changed + } if (g_settings.radiotext_enable && g_Radiotext && !g_RemoteControl->current_PIDs.APIDs.empty() && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoMessages::mode_radio)) g_Radiotext->setPid(g_RemoteControl->current_PIDs.APIDs[g_RemoteControl->current_PIDs.PIDs.selected_apid].pid); } return messages_return::handled; } else if (msg == NeutrinoMessages::EVT_ZAP_GOT_SUBSERVICES) { if ((*(t_channel_id *) data) == current_channel_id) { -#if 0 if (is_visible && showButtonBar) - infoViewerBB->showBBButtons(CInfoViewerBB::BUTTON_YELLOW); -#endif + infoViewerBB->showBBButtons(); // in case button text has changed } return messages_return::handled; } else if (msg == NeutrinoMessages::EVT_ZAP_SUB_COMPLETE) { @@ -1784,9 +1782,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) frameBuffer->paintBackgroundBoxRel (BoxEndX - 108, posy, 112, height2); } #endif - infoViewerBB->showBBButtons(CInfoViewerBB::BUTTON_RED); - infoViewerBB->showBBButtons(CInfoViewerBB::BUTTON_GREEN); - infoViewerBB->showBBButtons(CInfoViewerBB::BUTTON_YELLOW); + infoViewerBB->showBBButtons(); } if ((info_CurrentNext.flags & CSectionsdClient::epgflags::not_broadcast) || diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 33d1f669a..b6c766264 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -439,9 +439,6 @@ void CInfoViewerBB::showBBButtons(const int modus) } } - if (modus == CInfoViewerBB::BUTTON_GREEN) - showIcon_DD(); - for (i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) { tmp_bbButtonInfoText[i] = bbButtonInfo[i].text; } From 4266468a0613e7b68bd60689cba5512b7dad7e33 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 10 Jan 2016 17:12:02 +0100 Subject: [PATCH 03/14] CComponentsItem: remove clean up from kill() It is not always useful to clean up everything with kill(). For more control in some cases an separate clean up should be better. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/695f8459070e961a6ed4460e37ec14fed7e79dcd Author: Thilo Graf Date: 2016-01-10 (Sun, 10 Jan 2016) ------------------ This commit was generated by Migit --- src/gui/components/cc_item.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 9c938167c..4f9b242c4 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -135,7 +135,6 @@ void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent) else CComponents::kill(cc_parent->getColorBody(), cc_parent->getCornerRadius()); } - clearScreenBuffer(); } //synchronize colors for forms From b10a1096c3455274cf9443fde591667e5ee0cfd3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 21 Jan 2016 10:24:58 +0100 Subject: [PATCH 04/14] CCDraw: remove clean up after restored screen It seems not always useful to clean up everything after hide(). For more control in some cases an separate clean up with clearSavedScreen() should be more flexible. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b701c345fb49090917c3f98af0c6fb1e67bbd84a Author: Thilo Graf Date: 2016-01-21 (Thu, 21 Jan 2016) ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index a43e0e461..0b2a4456e 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -620,8 +620,6 @@ void CCDraw::paintFbItems(bool do_save_bg) void CCDraw::hide() { - bool restored = false; - //restore saved screen background of item if available for(size_t i =0; i< v_fbdata.size() ;i++) { if (v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BGSCREEN){ @@ -629,14 +627,9 @@ void CCDraw::hide() //restore screen from backround layer frameBuffer->waitForIdle("CCDraw::hide()"); frameBuffer->RestoreScreen(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].pixbuf); - restored = true; } } } - //cleanup background layer, but only if restore was required - if (restored) - clearSavedScreen(); - is_painted = false; firstPaint = true; } From 46948c2d2722a97b034e0a3c7c5f8cbfc2180274 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 11 Jan 2016 16:40:38 +0100 Subject: [PATCH 05/14] CComponentsText: try to fix mismatching calculation of y pos inside form Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/60c9dc843225c7e465cdc272d243a7c0e70c5789 Author: Thilo Graf Date: 2016-01-11 (Mon, 11 Jan 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item_text.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index bfe7a622a..3707dfd85 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -133,7 +133,7 @@ void CComponentsText::initCCText() if (cc_parent){ int th_parent_fr = cc_parent->getFrameThickness(); iX = cc_xr + (x <= th_parent_fr ? th_parent_fr : 0); - iY = cc_yr + (y <= th_parent_fr ? th_parent_fr : 0); + iY = cc_yr - (y <= th_parent_fr ? th_parent_fr : 0); } //init textbox From db6be29b3f7d587fb5a1679dd00d27bcafc452be Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 12 Jan 2016 19:46:08 +0100 Subject: [PATCH 06/14] CInfoViewer: use different modes with enums for virtual zap and number input mode This should fix missing rounded corners in numbaur input mode too. Thx defans for input ! Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/98b73c0d092064304c1aa4b83b347f387b886876 Author: Thilo Graf Date: 2016-01-12 (Tue, 12 Jan 2016) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 2 +- src/gui/infoviewer.cpp | 20 ++++++++++---------- src/gui/infoviewer.h | 26 ++++++++++++++++++++++++-- src/neutrino.cpp | 3 ++- 4 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index c0b4df985..d3b51f91f 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1461,7 +1461,7 @@ void CChannelList::virtual_zap_mode(bool up) break; } } - g_InfoViewer->clearVirtualZapMode(); + g_InfoViewer->resetSwitchMode(); //disable virtual_zap_mode if (doZap) { if(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] == 0) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index f1eeddc74..0b43be313 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -142,7 +142,7 @@ void CInfoViewer::Init() showButtonBar = false; //gotTime = g_Sectionsd->getIsTimeSet (); gotTime = timeset; - virtual_zap_mode = false; + zap_mode = IV_MODE_DEFAULT; newfreq = true; chanready = 1; fileplay = 0; @@ -431,7 +431,7 @@ void CInfoViewer::paintBody() { int h_body = InfoHeightY - header_height + (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); - if(virtual_zap_mode) + if(zap_mode) h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); if (body == NULL) @@ -440,8 +440,8 @@ void CInfoViewer::paintBody() body->setDimensionsAll(ChanInfoX, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body); //set corner and shadow modes, consider virtual zap mode - body->setCorner(RADIUS_LARGE, virtual_zap_mode ? CORNER_BOTTOM : CORNER_NONE); - body->enableShadow(virtual_zap_mode ? CC_SHADOW_ON : CC_SHADOW_RIGHT); + body->setCorner(RADIUS_LARGE, (zap_mode) ? CORNER_BOTTOM : CORNER_NONE); + body->enableShadow(zap_mode ? CC_SHADOW_ON : CC_SHADOW_RIGHT); body->setColorBody(g_settings.theme.infobar_gradient_body ? COL_MENUHEAD_PLUS_0 : COL_INFOBAR_PLUS_0); body->enableColBodyGradient(g_settings.theme.infobar_gradient_body, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_body_direction); @@ -702,7 +702,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap ChannelName = Channel; bool new_chan = false; - if (virtual_zap_mode) { + if (zap_mode & IV_MODE_VIRTUAL_ZAP) { if (g_RemoteControl->current_channel_id != new_channel_id) { col_NumBoxText = COL_MENUHEAD_TEXT; } @@ -895,7 +895,7 @@ void CInfoViewer::setInfobarTimeout(int timeout_ext) void CInfoViewer::loop(bool show_dot) { bool hideIt = true; - virtual_zap_mode = false; + resetSwitchMode(); //no virtual zap //bool fadeOut = false; timeoutEnd=0;; setInfobarTimeout(); @@ -950,7 +950,7 @@ void CInfoViewer::loop(bool show_dot) //infoViewerBB->showIcon_CA_Status(0); infoViewerBB->showIcon_Resolution(); } else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) { - virtual_zap_mode = true; + setSwitchMode(IV_MODE_VIRTUAL_ZAP); res = messages_return::cancel_all; hideIt = true; } else if ((msg == NeutrinoMessages::EVT_RECORDMODE) && @@ -1029,7 +1029,7 @@ void CInfoViewer::loop(bool show_dot) g_RCInput->killTimer (sec_timer_id); fader.StopFade(); - if (virtual_zap_mode) { + if (zap_mode & IV_MODE_VIRTUAL_ZAP) { /* if bouquet cycle set, do virtual over current bouquet */ if (/*g_settings.zap_cycle && */ /* (bouquetList != NULL) && */ !(bouquetList->Bouquets.empty())) bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->virtual_zap_mode(msg == CRCInput::RC_right); @@ -1444,7 +1444,7 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) void CInfoViewer::sendNoEpg(const t_channel_id for_channel_id) { - if (!virtual_zap_mode) { + if (!zap_mode/* & IV_MODE_DEFAULT*/) { char *p = new char[sizeof(t_channel_id)]; memcpy(p, &for_channel_id, sizeof(t_channel_id)); g_RCInput->postMsg (NeutrinoMessages::EVT_NOEPG_YET, (const neutrino_msg_data_t) p, false); @@ -1968,7 +1968,7 @@ void CInfoViewer::showInfoFile() //paint info, don't save background, if already painted, global hide is also done by killTitle() bool save_bg = !infobar_txt->isPainted(); - if (new_text || virtual_zap_mode) + if (new_text || (zap_mode & IV_MODE_VIRTUAL_ZAP)) infobar_txt->paint(save_bg); } diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index a7300a7d6..6fe7044a9 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -57,6 +57,7 @@ class CInfoViewer bool gotTime; bool recordModeActive; + #ifndef SKIP_CA_STATUS bool CA_Status; #endif @@ -110,6 +111,7 @@ class CInfoViewer bool casysChange; bool channellogoChange; uint32_t lcdUpdateTimer; + int zap_mode; void paintBackground(int col_Numbox); void paintHead(); @@ -147,7 +149,7 @@ class CInfoViewer public: bool chanready; bool is_visible; - bool virtual_zap_mode; + char aspectRatio; uint32_t sec_timer_id; @@ -178,7 +180,27 @@ class CInfoViewer //void Set_CA_Status(int Status); int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data); - void clearVirtualZapMode() {virtual_zap_mode = false;} + + enum{ + IV_MODE_DEFAULT = 0, + IV_MODE_VIRTUAL_ZAP = 1, + IV_MODE_NUMBER_ZAP = 2 + };/*iv_switch_mode_t*/ + /**sets mode for infoviewer. + * @param[in] mode + * @li IV_MODE_DEFAULT + * @li IV_MODE_VIRTUAL_ZAP means the virtual zap mode, user is typing keys for virtual channel switch + * @li IV_MODE_NUMBER_ZAP means number mode, user is typing number keys into screen + * @return + * void + * @see + * resetSwitchMode() + * getSwitchMode() + */ + void setSwitchMode(const int& mode) {zap_mode = mode;} + int getSwitchMode() {return zap_mode;} + void resetSwitchMode() {setSwitchMode(IV_MODE_DEFAULT);} + void changePB(); void ResetPB(); void showSNR(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d5f39d074..1dd14710d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2135,6 +2135,7 @@ void CNeutrinoApp::quickZap(int msg) void CNeutrinoApp::numericZap(int msg) { StopSubtitles(); + g_InfoViewer->setSwitchMode(CInfoViewer::IV_MODE_NUMBER_ZAP); int res = channelList->numericZap( msg ); StartSubtitles(res < 0); if (res >= 0 && CRCInput::isNumeric(msg)) { @@ -2771,7 +2772,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } /* ================================== KEYS ================================================ */ - if( msg == CRCInput::RC_ok || (!g_InfoViewer->virtual_zap_mode && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites))) { + if( msg == CRCInput::RC_ok || (!g_InfoViewer->getSwitchMode() && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites))) { if( (mode == mode_tv) || (mode == mode_radio) || (mode == mode_ts) || (mode == mode_webtv)) { showChannelList(msg); return messages_return::handled; From 730adcdfb097e9c90f91c3458febe381407a46bd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 21 Jan 2016 10:27:22 +0100 Subject: [PATCH 07/14] CScreenSaver: fix possible render of clock over screen size check position and size use only possible available screen size Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/387d96d2f5dfa23f3c38ce4b1ba8e405cacd0f15 Author: Thilo Graf Date: 2016-01-21 (Thu, 21 Jan 2016) ------------------ This commit was generated by Migit --- src/gui/screensaver.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 0235a9358..05c7396e5 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -271,7 +271,7 @@ void CScreenSaver::paint() if (!scr_clock){ scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H.%M:%S", "%H.%M %S", true); scr_clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]); - scr_clock->enableSaveBg(); + scr_clock->disableSaveBg(); scr_clock->doPaintBg(false); } if (scr_clock->isPainted()) @@ -279,7 +279,17 @@ void CScreenSaver::paint() scr_clock->kill(); scr_clock->setTextColor(clr.i_color); - scr_clock->setPosP(rand() % 80, rand() % 90); + + //check position and size use only possible available screen size + int x_cl, y_cl, w_cl, h_cl; + scr_clock->getDimensions( &x_cl, &y_cl, &w_cl, &h_cl); + bool unchecked = true; + while(unchecked){ + scr_clock->setPosP(uint8_t(rand() % 100),uint8_t(rand() % 100)); + scr_clock->getDimensions( &x_cl, &y_cl, &w_cl, &h_cl); + if (x_cl+w_cl < g_settings.screen_EndX && y_cl+h_cl < g_settings.screen_EndY) + unchecked = false; + } scr_clock->Start(); if (g_settings.screensaver_mode == SCR_MODE_CLOCK_COLOR) { From cd9ad09b83c0c322474663f3d7b94331cb578bac Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 21 Jan 2016 10:49:10 +0100 Subject: [PATCH 08/14] cc_types: add missing item type to signalbar Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9775f1f43af5973e7a26ec8871c83ab5551232ff Author: Thilo Graf Date: 2016-01-21 (Thu, 21 Jan 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_types.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 8636ab679..cb135fe6a 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -63,6 +63,7 @@ typedef enum CC_ITEMTYPE_BUTTON_BLUE, CC_ITEMTYPE_SLIDER, CC_ITEMTYPE_FRM_SCROLLBAR, + CC_ITEMTYPE_FRM_SIGNALBAR, CC_ITEMTYPES }CC_ITEMTYPES_T; From a9aa78ca3e74fdb403ea51d8cf9011d1ebd8fe87 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 21 Jan 2016 10:56:30 +0100 Subject: [PATCH 09/14] text screen save: try to rework screen save behavior for textbox objects Screen save now always disabled by default and can be controlled outside of relevant objects. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9d72b086a2558876f6c0d27eeb1373015dfb5542 Author: Thilo Graf Date: 2016-01-21 (Thu, 21 Jan 2016) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 6 ++- src/gui/components/cc_frm_button.cpp | 1 + src/gui/components/cc_frm_button.h | 21 ++++++++++ src/gui/components/cc_frm_clock.cpp | 5 +-- src/gui/components/cc_frm_clock.h | 14 ++++++- src/gui/components/cc_frm_ext_text.cpp | 8 ++-- src/gui/components/cc_frm_ext_text.h | 18 +++++++++ src/gui/components/cc_frm_header.cpp | 2 +- src/gui/components/cc_frm_header.h | 17 ++++++++ src/gui/components/cc_frm_signalbars.cpp | 21 ++++++---- src/gui/components/cc_frm_signalbars.h | 49 ++++++++++++++++++++++-- src/gui/components/cc_item_text.cpp | 4 +- src/gui/components/cc_item_text.h | 16 ++++++-- src/gui/components/cc_text_screen.h | 21 +++++++++- src/gui/infoviewer.cpp | 6 ++- src/gui/widget/textbox.cpp | 4 +- 16 files changed, 177 insertions(+), 36 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index d3b51f91f..17655dc91 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2060,8 +2060,10 @@ void CChannelList::paint() void CChannelList::paintHead() { - if (header == NULL) + if (header == NULL){ header = new CComponentsHeader(); + header->getTextObject()->enableTboxSaveScreen(g_settings.theme.menu_Head_gradient);//enable screen save for title text if color gradient is in use + } header->setDimensionsAll(x, y, full_width, theight); @@ -2098,7 +2100,7 @@ void CChannelList::paintHead() else logo_off = 10; - header->paint(CC_SAVE_SCREEN_NO); + header->paint(CC_SAVE_SCREEN_NO); //TODO: paint title only, currently paint() does paint all enabled header items at once and causes flicker effects in unchanged items (e.g. clock) } CComponentsHeader* CChannelList::getHeaderObject() diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 38087c79a..403418664 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -174,6 +174,7 @@ void CComponentsButton::initCaption() if (cc_btn_capt_obj == NULL){ cc_btn_capt_obj = new CComponentsLabel(); cc_btn_capt_obj->doPaintBg(false); + cc_btn_capt_obj->doPaintTextBoxBg(false); cc_btn_capt_obj->enableTboxSaveScreen(cc_txt_save_screen); addCCItem(cc_btn_capt_obj); } diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 44a688b32..d665ac6ce 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -135,6 +135,27 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen ///set text color virtual void setButtonTextColor(fb_pixel_t text_color, fb_pixel_t text_color_disabled = COL_MENUCONTENTINACTIVE_TEXT){cc_btn_capt_col = text_color; cc_btn_capt_disable_col = text_color_disabled;} + /**Member to modify background behavior of embeded caption object. + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + virtual void enableTboxSaveScreen(bool mode) + { + if (cc_txt_save_screen == mode) + return; + cc_txt_save_screen = mode; + for(size_t i=0; igetItemType() == CC_ITEMTYPE_LABEL) + static_cast(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen); + } + }; + ///set caption: parameter as string virtual void setCaption(const std::string& text); ///set caption: parameter as locale diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 313b05cc2..e20ef0916 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -402,16 +402,13 @@ void CComponentsFrmClock::kill(const fb_pixel_t& bg_color, bool ignore_parent) CComponentsForm::kill(bg_color, ignore_parent); } -void CComponentsFrmClock::enableSegmentSaveScreen(bool mode) +void CComponentsFrmClock::enableTboxSaveScreen(bool mode) { if (cc_txt_save_screen == mode || v_cc_items.empty()) return; - cc_txt_save_screen = mode; - for (size_t i = 0; i < v_cc_items.size(); i++){ CComponentsLabel *seg = static_cast (v_cc_items[i]); - //seg->clearSavedScreen(); seg->enableTboxSaveScreen(cc_txt_save_screen); } } diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index 6b91c836f..8f5fe47b4 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -158,8 +158,18 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen ///reinitialize clock contents virtual void refresh() { initCCLockItems(); } - ///allows to save bg screen behind text within segment objects, see also cl_save_segment_screen - void enableSegmentSaveScreen(bool mode); + + /**Member to modify background behavior of embeded segment objects + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + void enableTboxSaveScreen(bool mode); ///set color gradient on/off, returns true if gradient mode was changed virtual bool enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color = 255 /*=COL_BACKGROUND*/); diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 5d24e7d58..97b798795 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -104,7 +104,8 @@ void CComponentsExtTextForm::initLabel() //initialize label object if (ccx_label_obj == NULL){ ccx_label_obj = new CComponentsLabel(); - ccx_label_obj->doPaintBg(false); + ccx_label_obj->doPaintBg(!cc_txt_save_screen); + ccx_label_obj->doPaintTextBoxBg(false); ccx_label_obj->enableTboxSaveScreen(cc_txt_save_screen); } @@ -117,7 +118,7 @@ void CComponentsExtTextForm::initLabel() ccx_label_width = (ccx_percent_label_w * width/100); ccx_label_obj->setText(ccx_label_text, ccx_label_align, ccx_font); ccx_label_obj->setTextColor(ccx_label_color); - ccx_label_obj->setDimensionsAll(fr_thickness, 0, ccx_label_width-fr_thickness, height-2*fr_thickness); + ccx_label_obj->setDimensionsAll(0, 0, ccx_label_width-2*fr_thickness, height-2*fr_thickness); ccx_label_obj->setCorner(this->corner_rad, CORNER_LEFT); } } @@ -127,7 +128,8 @@ void CComponentsExtTextForm::initText() //initialize text object if (ccx_text_obj == NULL){ ccx_text_obj = new CComponentsText(); - ccx_text_obj->doPaintBg(false); + ccx_text_obj->doPaintBg(!cc_txt_save_screen); + ccx_text_obj->doPaintTextBoxBg(false); ccx_text_obj->enableTboxSaveScreen(cc_txt_save_screen); } diff --git a/src/gui/components/cc_frm_ext_text.h b/src/gui/components/cc_frm_ext_text.h index 007680dea..0bf45f508 100644 --- a/src/gui/components/cc_frm_ext_text.h +++ b/src/gui/components/cc_frm_ext_text.h @@ -110,6 +110,24 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen ///returns a pointer to the internal text object, use this to get access to its most properties CComponentsText*getTextObject(){return ccx_text_obj;}; + /**Member to modify background behavior of embeded label and text objects + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + void enableTboxSaveScreen(bool mode){ + if (cc_txt_save_screen == mode) + return; + cc_txt_save_screen = mode; + for(size_t i=0; i(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen); + }; + ///sets the text modes (mainly text alignment) to the label and text object, see /gui/widget/textbox.h for possible modes void setTextModes(const int& label_mode, const int& text_mode); diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index f26bc4132..4a69827f7 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -86,7 +86,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const fb_pixel_t color_shadow) { cc_item_type = CC_ITEMTYPE_FRM_HEADER; - cc_txt_save_screen = true; + cc_txt_save_screen = false; x = x_old = x_pos; y = y_old = y_pos; diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 56eb3e38d..45354ca2e 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -211,6 +211,23 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen ///returns the text object virtual CComponentsText* getTextObject(){return cch_text_obj;} + /**Member to modify background behavior of embeded title + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + void enableTboxSaveScreen(bool mode) + { + cc_txt_save_screen = mode; + if (cch_text_obj->getCTextBoxObject()) + cch_text_obj->getCTextBoxObject()->enableSaveScreen(cc_txt_save_screen); + } + ///returns the clock object virtual CComponentsFrmClock* getClockObject(){return cch_cl_obj;} diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index 5bea94103..27061c8b8 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -106,7 +106,7 @@ void CSignalBar::initVarSigBar() append_x_offset = 2; append_y_offset = 2; height = SB_MIN_HEIGHT; - + cc_item_type = CC_ITEMTYPE_FRM_SIGNALBAR; sb_scale_height = -1; dy_font = CNeutrinoFonts::getInstance(); @@ -144,12 +144,13 @@ void CSignalBar::initSBarValue() //create value label object with basic properties if (sb_vlbl == NULL){ sb_vlbl = new CComponentsLabel(); - sb_vlbl->doPaintBg(false); - sb_vlbl->doPaintTextBoxBg(false); - sb_vlbl->enableTboxSaveScreen(true); sb_vlbl->setText(REF_PERCENT_TXT, sb_val_mode, sb_font); } + sb_vlbl->doPaintBg(false); + sb_vlbl->doPaintTextBoxBg(!cc_txt_save_screen); + sb_vlbl->enableTboxSaveScreen(cc_txt_save_screen); + //move and set dimensions int vlbl_x = sb_scale->getXPos() + sb_scale_width + append_y_offset; int vlbl_h = sb_scale->getHeight(); @@ -169,12 +170,14 @@ void CSignalBar::initSBarName() //create name label object with basic properties if (sb_lbl == NULL){ sb_lbl = new CComponentsLabel(); - sb_lbl->doPaintBg(false); - sb_lbl->doPaintTextBoxBg(false); - sb_lbl->enableTboxSaveScreen(true); - sb_lbl->setText(sb_name, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, sb_font); } + sb_lbl->doPaintBg(false); + sb_lbl->doPaintTextBoxBg(!cc_txt_save_screen); + sb_lbl->enableTboxSaveScreen(cc_txt_save_screen); + + sb_lbl->setText(sb_name, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, sb_font); + //move and set dimensions int lbl_x = sb_vlbl->getXPos()+ sb_vlbl->getWidth(); int lbl_h = sb_vlbl->getHeight(); @@ -316,11 +319,13 @@ void CSignalBox::initSignalItems() sbar->setFrontEnd(sbx_frontend); sbar->setCorner(0); sbar->setScaleHeight(scale_h); + sbar->enableTboxSaveScreen(cc_txt_save_screen); snrbar->setDimensionsAll(vertical ? sbar_x : CC_APPEND, vertical ? CC_APPEND : 1, sbar_w, sbar_h); snrbar->setFrontEnd(sbx_frontend); snrbar->setCorner(0); snrbar->setScaleHeight(scale_h); + snrbar->enableTboxSaveScreen(cc_txt_save_screen); } void CSignalBox::paintScale() diff --git a/src/gui/components/cc_frm_signalbars.h b/src/gui/components/cc_frm_signalbars.h index e78de5353..216b221af 100644 --- a/src/gui/components/cc_frm_signalbars.h +++ b/src/gui/components/cc_frm_signalbars.h @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -47,7 +48,7 @@ CSignalBar() and their sub classes based up CComponentsForm() and are usable lik CSignalBar() is intended to show signal rate. */ -class CSignalBar : public CComponentsForm +class CSignalBar : public CComponentsForm, public CCTextScreen { public: ///refresh current item properties, use this before paintScale(). @@ -141,6 +142,27 @@ class CSignalBar : public CComponentsForm //returns the current signal value uint16_t getValue(void) { return sb_signal; } + + /**Member to modify background behavior of embeded caption objects (value, name) + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + void enableTboxSaveScreen(bool mode) + { + if (cc_txt_save_screen == mode) + return; + cc_txt_save_screen = mode; + for(size_t i=0; igetItemType() == CC_ITEMTYPE_LABEL) + static_cast(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen); + } + } }; /// Sub class of CSignalBar() @@ -237,7 +259,7 @@ void CSampleClass::hide () */ -class CSignalBox : public CComponentsForm +class CSignalBox : public CComponentsForm, public CCTextScreen { private: ///object: current frontend @@ -289,8 +311,27 @@ class CSignalBox : public CComponentsForm ///return current snr value uint16_t getSNRValue(void) { return snrbar->getValue();} - - ///return current snr value + + /**Member to modify background behavior of embeded caption objects (value, name) + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + void enableTboxSaveScreen(bool mode) + { + if (cc_txt_save_screen == mode) + return; + cc_txt_save_screen = mode; + for(size_t i=0; igetItemType() == CC_ITEMTYPE_FRM_SIGNALBAR) + static_cast(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen); + } + }; }; #endif diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index 3707dfd85..c554f1123 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -145,13 +145,13 @@ void CComponentsText::initCCText() ct_textbox->setTextMode(ct_text_mode); ct_textbox->setWindowPos(this); ct_textbox->setTextBorderWidth(ct_text_Hborder, ct_text_Vborder); - ct_textbox->enableBackgroundPaint(ct_paint_textbg); + ct_textbox->enableBackgroundPaint(ct_paint_textbg && !cc_txt_save_screen); ct_textbox->setBackGroundColor(col_body); ct_textbox->setBackGroundRadius(corner_rad-fr_thickness, corner_type); ct_textbox->setTextColor(ct_col_text); ct_textbox->setWindowMaxDimensions(iWidth, iHeight); ct_textbox->setWindowMinDimensions(iWidth, iHeight); - ct_textbox->enableSaveScreen(cc_txt_save_screen); + ct_textbox->enableSaveScreen(cc_txt_save_screen && !ct_paint_textbg); ct_textbox->enableUTF8(ct_utf8_encoded); //observe behavior of parent form if available diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index af36d128b..5bf297212 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -177,14 +177,22 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox ///returns count of lines from a text box page virtual int getTextLinesAutoHeight(const int& textMaxHeight, const int& textWidth, const int& mode); - ///allows to save bg screen behind text within CTextBox object, see also cc_txt_save_screen + + /**Member to modify background behavior of textbox object + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ void enableTboxSaveScreen(bool mode) { - if (cc_txt_save_screen == mode) - return; cc_txt_save_screen = mode; if (ct_textbox) - ct_textbox->enableSaveScreen(mode); + ct_textbox->enableSaveScreen(cc_txt_save_screen); } ///enable/disable utf8 encoding void enableUTF8(bool enable = true){ct_utf8_encoded = enable;} diff --git a/src/gui/components/cc_text_screen.h b/src/gui/components/cc_text_screen.h index afdbe9024..07f7e05e6 100644 --- a/src/gui/components/cc_text_screen.h +++ b/src/gui/components/cc_text_screen.h @@ -24,7 +24,6 @@ #ifndef __CC_TXT_SCREEN__ #define __CC_TXT_SCREEN__ - //! Sub class for CTextBox using CComponent classes. /*! This class contains flags or helpers to control CTextBox screen and paint handling and mostly used by @@ -38,7 +37,25 @@ class CCTextScreen bool cc_txt_save_screen; public: - CCTextScreen(){cc_txt_save_screen = false;}; + CCTextScreen(){cc_txt_save_screen = false;} + + /**Abstract member to modify background behavior of embeded textbox object + * @param[in] mode + * @li bool, default = true, enables backround saving of textbox object. This causes painting of backround from saved screen instead simple backround (if enabled) + * This is usefull if text should be paint on transparent background or background with color gradient. + * @return + * void + * @see + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + virtual void enableTboxSaveScreen(bool mode) = 0; + + /**member to disable background behavior of embeded textbox object. + * @see + * disableTboxSaveScreen() + */ + virtual void disableTboxSaveScreen(){enableTboxSaveScreen(false);} }; #endif diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 0b43be313..b326b7dca 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -252,10 +252,10 @@ void CInfoViewer::initClock() InfoClock->getInstance()->disableInfoClock(); clock->enableColBodyGradient(gradient_top, COL_INFOBAR_PLUS_0); - clock->enableSegmentSaveScreen(gradient_top); + clock->doPaintBg(!gradient_top); + clock->enableTboxSaveScreen(gradient_top); clock->setColorBody(COL_INFOBAR_PLUS_0); clock->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); - clock->doPaintBg(!gradient_top); clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]); clock->setPos(BoxEndX - 10 - clock->getWidth(), ChanNameY); clock->setTextColor(COL_INFOBAR_TEXT); @@ -1523,7 +1523,9 @@ void CInfoViewer::showSNR () int sigbox_offset = ChanWidth *10/100; sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox+ChanHeight/2, ChanWidth - 2*sigbox_offset, ChanHeight/2, CFEManager::getInstance()->getLiveFE(), true, NULL, "S", "Q"); sigbox->setTextColor(COL_INFOBAR_TEXT); + sigbox->setColorBody(numbox->getColorBody()); sigbox->doPaintBg(false); + sigbox->enableTboxSaveScreen(numbox->getColBodyGradientMode()); } sigbox->paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 18205ea50..5f33a725e 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -588,8 +588,8 @@ void CTextBox::refreshText(void) //save screen only if no paint of background required if (!m_nPaintBackground && m_SaveScreen) { if (m_bgpixbuf == NULL){ - //TRACE("[CTextBox] %s save bg %d\r\n", __FUNCTION__, __LINE__); if ((dx * dy) >0){ +// TRACE("[CTextBox] [%s - %d] save bg for use as transparent background [%s]\n", __func__, __LINE__, m_cText.c_str()); m_bgpixbuf= new fb_pixel_t[dx * dy]; frameBuffer->SaveScreen(ax, ay, dx, dy, m_bgpixbuf); } @@ -598,7 +598,7 @@ void CTextBox::refreshText(void) //Paint Text Background bool allow_paint_bg = (m_old_cText != m_cText || has_changed || m_has_scrolled); - if (m_nPaintBackground){ + if (m_nPaintBackground && !m_SaveScreen){ clearScreenBuffer(); if (allow_paint_bg){ //TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__); From 9d53bab174b6958e7c7202ad86b0321f65c86955 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 21 Jan 2016 11:17:05 +0100 Subject: [PATCH 10/14] controlapi: add possibility to check status of remote control Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3553030bce420e7494b9949583ba077bca724586 Author: vanhofen Date: 2016-01-21 (Thu, 21 Jan 2016) Origin message was: ------------------ - controlapi: add possibility to check status of remote control ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/doc/nhttpd_controlapi.html | 11 ++++++++++- src/nhttpd/tuxboxapi/controlapi.cpp | 25 ++++++++++++++++++------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index 8cedb54d7..4a215504f 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -1655,6 +1655,16 @@ ok
Fernbedienung
Handler: http://box_ip/control/rc

+Parameter:keine/status
+Rückgabe:on/off
+
+Zeigt den Status der Fernbedienung
+
+Beispiel:
+
+http://box_ip/control/rc?status
+on
+
Parameter: lock
Rückgabe: ok

@@ -1674,7 +1684,6 @@ Beispiel:

http://box_ip/control/rc?unlock
ok
-
diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index e61f19c61..093b9d1cf 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -496,23 +496,34 @@ void CControlAPI::StandbyCGI(CyhookHandler *hh) //----------------------------------------------------------------------------- void CControlAPI::RCCGI(CyhookHandler *hh) { - if (!(hh->ParamList.empty())) - { - bool locked = CRCLock::getInstance()->isLocked(); + bool locked = CRCLock::getInstance()->isLocked(); - if (hh->ParamList["1"] == "lock"){ // lock remote control + if (hh->ParamList.empty() || hh->ParamList["1"] == "status") + { + if (locked) + hh->WriteLn("off"); + else + hh->WriteLn("on"); + } + else + { + if (hh->ParamList["1"] == "lock") + { if (!locked) NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD); } - else if (hh->ParamList["1"] == "unlock"){// unlock remote control + else if (hh->ParamList["1"] == "unlock") + { if (locked) NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD); } - else{ + else + { hh->SendError(); + return; } + hh->SendOk(); } - hh->SendOk(); } //----------------------------------------------------------------------------- From 1776a904b680389b431f723f386d8e8af53455b8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 21 Jan 2016 11:18:53 +0100 Subject: [PATCH 11/14] yWeb: add button to check status of remote control Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a2ba19459704893c261336d73cabbb777e5f79b9 Author: vanhofen Date: 2016-01-21 (Thu, 21 Jan 2016) Origin message was: ------------------ - yWeb: add button to check status of remote control ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/web/Y_Tools_Boxcontrol.yhtm | 1 + src/nhttpd/web/Y_Version.txt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm b/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm index ade978061..200ad4064 100644 --- a/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm +++ b/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm @@ -73,6 +73,7 @@ function standby(_standby){ + diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index ecf60e920..ad8537925 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.24 -date=28.12.2015 +version=2.9.0.25 +date=21.01.2016 type=Release info=Port CST From 2793cfdc72a17c5ddd489726ce9cca2bdd3caf99 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 21 Jan 2016 16:38:59 +0100 Subject: [PATCH 12/14] yWeb: remove hardcoded css from textareas Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2738f70f38289bd3a2875eb8ea8f85a66548bdc2 Author: vanhofen Date: 2016-01-21 (Thu, 21 Jan 2016) Origin message was: ------------------ - yWeb: remove hardcoded css from textareas ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/web/Y_Ext_Settings.yhtm | 2 +- src/nhttpd/web/Y_Ext_Uninstall.yhtm | 2 +- src/nhttpd/web/Y_Ext_Update.yhtm | 2 +- src/nhttpd/web/Y_Filemgr_Edit.yhtm | 2 +- src/nhttpd/web/Y_Main.css | 5 +++++ src/nhttpd/web/Y_Settings_Timer.yhtm | 2 +- src/nhttpd/web/Y_Tools_Cmd.yhtm | 2 +- src/nhttpd/web/Y_Version.txt | 2 +- 8 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/nhttpd/web/Y_Ext_Settings.yhtm b/src/nhttpd/web/Y_Ext_Settings.yhtm index f9a9f906d..ae3d6a290 100644 --- a/src/nhttpd/web/Y_Ext_Settings.yhtm +++ b/src/nhttpd/web/Y_Ext_Settings.yhtm @@ -23,7 +23,7 @@ function do_submit(){ - +
 

diff --git a/src/nhttpd/web/Y_Ext_Uninstall.yhtm b/src/nhttpd/web/Y_Ext_Uninstall.yhtm index 8bdc1c748..4ce14288f 100644 --- a/src/nhttpd/web/Y_Ext_Uninstall.yhtm +++ b/src/nhttpd/web/Y_Ext_Uninstall.yhtm @@ -63,7 +63,7 @@ function init(){
- +

diff --git a/src/nhttpd/web/Y_Ext_Update.yhtm b/src/nhttpd/web/Y_Ext_Update.yhtm index eff7c7ee0..e42e9d6f4 100644 --- a/src/nhttpd/web/Y_Ext_Update.yhtm +++ b/src/nhttpd/web/Y_Ext_Update.yhtm @@ -54,7 +54,7 @@ - +

diff --git a/src/nhttpd/web/Y_Filemgr_Edit.yhtm b/src/nhttpd/web/Y_Filemgr_Edit.yhtm index 53c920441..ed52365e5 100644 --- a/src/nhttpd/web/Y_Filemgr_Edit.yhtm +++ b/src/nhttpd/web/Y_Filemgr_Edit.yhtm @@ -56,7 +56,7 @@ function ni(){ - +
diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index 2a4142672..6c975bd3f 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -95,6 +95,11 @@ input[type="text"],input[type="password"],select{ margin: 0px; } +textarea { + font: monospace medium 'Courier New', sans-serif; + background: #ffffff; + color: #436976; +} * html .boxhead h2 {height: 1%;} /* For IE 5 PC */ a { color: #555555; diff --git a/src/nhttpd/web/Y_Settings_Timer.yhtm b/src/nhttpd/web/Y_Settings_Timer.yhtm index e7897b78c..772812db3 100644 --- a/src/nhttpd/web/Y_Settings_Timer.yhtm +++ b/src/nhttpd/web/Y_Settings_Timer.yhtm @@ -50,7 +50,7 @@ function do_submit() {   - +
diff --git a/src/nhttpd/web/Y_Tools_Cmd.yhtm b/src/nhttpd/web/Y_Tools_Cmd.yhtm index 5eea1491b..511646fc4 100644 --- a/src/nhttpd/web/Y_Tools_Cmd.yhtm +++ b/src/nhttpd/web/Y_Tools_Cmd.yhtm @@ -51,7 +51,7 @@ function doUpload() {=var-set:help_url=Help-Tools-Command_Shell=}{=var-set:menu={=L:tools.command_shell=}=}{=include-block:Y_Blocks.txt;work_menu=}
- +
diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index ad8537925..691238b8c 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.25 +version=2.9.0.26 date=21.01.2016 type=Release info=Port CST From 2b49e84c77e21b4b601292ba7bd4ef5a51650e28 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 21 Jan 2016 09:09:30 +0100 Subject: [PATCH 13/14] CLuaInstance: Add some CComponentsHeader functions - Set Lua api version to 1.38 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8a61c3bfcd1235ff4585a894956d29763a20660e Author: Michael Liebmann Date: 2016-01-21 (Thu, 21 Jan 2016) ------------------ This commit was generated by Migit --- src/gui/lua/Makefile.am | 1 + src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_cc_header.cpp | 138 ++++++++++++++++++++++++++++++ src/gui/lua/lua_cc_header.h | 49 +++++++++++ src/gui/lua/luainstance.cpp | 2 + src/gui/lua/luainstance_helpers.h | 1 + 6 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 src/gui/lua/lua_cc_header.cpp create mode 100644 src/gui/lua/lua_cc_header.h diff --git a/src/gui/lua/Makefile.am b/src/gui/lua/Makefile.am index 4cf5c50aa..e3861cb76 100644 --- a/src/gui/lua/Makefile.am +++ b/src/gui/lua/Makefile.am @@ -25,6 +25,7 @@ noinst_LIBRARIES = libneutrino_gui_lua.a libneutrino_gui_lua_a_SOURCES = \ luainstance.cpp \ luainstance_helpers.cpp \ + lua_cc_header.cpp \ lua_cc_picture.cpp \ lua_cc_signalbox.cpp \ lua_cc_text.cpp \ diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index c5a53aad9..9fe6f1a67 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 37 +#define LUA_API_VERSION_MINOR 38 diff --git a/src/gui/lua/lua_cc_header.cpp b/src/gui/lua/lua_cc_header.cpp new file mode 100644 index 000000000..c2273cde5 --- /dev/null +++ b/src/gui/lua/lua_cc_header.cpp @@ -0,0 +1,138 @@ +/* + * lua components header + * + * (C) 2016 M. Liebmann (micha-bbg) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "luainstance.h" +#include "lua_cc_window.h" +#include "lua_cc_header.h" + + +CLuaInstCCHeader* CLuaInstCCHeader::getInstance() +{ + static CLuaInstCCHeader* LuaInstCCHeader = NULL; + + if(!LuaInstCCHeader) + LuaInstCCHeader = new CLuaInstCCHeader(); + return LuaInstCCHeader; +} + +CLuaCCHeader *CLuaInstCCHeader::CCHeaderCheck(lua_State *L, int n) +{ + return *(CLuaCCHeader **) luaL_checkudata(L, n, LUA_HEADER_CLASSNAME); +} + +void CLuaInstCCHeader::CCHeaderRegister(lua_State *L) +{ + luaL_Reg meth[] = { + { "new", CLuaInstCCHeader::CCHeaderNew }, + { "paint", CLuaInstCCHeader::CCHeaderPaint }, + { "hide", CLuaInstCCHeader::CCHeaderHide }, + { "__gc", CLuaInstCCHeader::CCHeaderDelete }, + { NULL, NULL } + }; + + luaL_newmetatable(L, LUA_HEADER_CLASSNAME); + luaL_setfuncs(L, meth, 0); + lua_pushvalue(L, -1); + lua_setfield(L, -1, "__index"); + lua_setglobal(L, LUA_HEADER_CLASSNAME); +} + + +int CLuaInstCCHeader::CCHeaderNew(lua_State *L) +{ + lua_assert(lua_istable(L,1)); + + CLuaCCWindow* parent = NULL; + lua_Integer x=10, y=10, dx=100, dy=100; + lua_Integer buttons = 0; + lua_Integer shadow_mode = CC_SHADOW_OFF; + + std::string caption, icon; + lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; + lua_Unsigned color_body = (lua_Unsigned)COL_MENUCONTENT_PLUS_0; + lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0; + + tableLookup(L, "parent", (void**)&parent); + tableLookup(L, "x", x); + tableLookup(L, "y", y); + tableLookup(L, "dx", dx); + tableLookup(L, "dy", dy); + tableLookup(L, "caption", caption); + tableLookup(L, "icon", icon); + tableLookup(L, "shadow_mode", shadow_mode); + tableLookup(L, "color_frame", color_frame); + tableLookup(L, "color_body" , color_body); + tableLookup(L, "color_shadow", color_shadow); + + color_frame = checkMagicMask(color_frame); + color_body = checkMagicMask(color_body); + color_shadow = checkMagicMask(color_shadow); + + CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL; + CLuaCCHeader **udata = (CLuaCCHeader **) lua_newuserdata(L, sizeof(CLuaCCHeader *)); + *udata = new CLuaCCHeader(); + (*udata)->ch = new CComponentsHeader((const int&)x, (const int&)y, (const int&)dx, (const int&)dy, + caption, (std::string)"", (const int&)buttons, + (CComponentsForm*)parent, (int)shadow_mode, + (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow); + (*udata)->parent = pw; + luaL_getmetatable(L, LUA_HEADER_CLASSNAME); + lua_setmetatable(L, -2); + return 1; +} + +int CLuaInstCCHeader::CCHeaderPaint(lua_State *L) +{ + lua_assert(lua_istable(L,1)); + CLuaCCHeader *D = CCHeaderCheck(L, 1); + if (!D) return 0; + + bool do_save_bg = true; + tableLookup(L, "do_save_bg", do_save_bg); + + D->ch->paint(do_save_bg); + return 0; +} + +int CLuaInstCCHeader::CCHeaderHide(lua_State *L) +{ + CLuaCCHeader *D = CCHeaderCheck(L, 1); + if (!D) return 0; + + D->ch->hide(); + return 0; +} + +int CLuaInstCCHeader::CCHeaderDelete(lua_State *L) +{ + CLuaCCHeader *D = CCHeaderCheck(L, 1); + if (!D) return 0; + delete D; + return 0; +} diff --git a/src/gui/lua/lua_cc_header.h b/src/gui/lua/lua_cc_header.h new file mode 100644 index 000000000..bea6bf72f --- /dev/null +++ b/src/gui/lua/lua_cc_header.h @@ -0,0 +1,49 @@ +/* + * lua components header + * + * (C) 2016 M. Liebmann (micha-bbg) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef _LUACCHEADER_H +#define _LUACCHEADER_H + +class CLuaCCHeader +{ + public: + CComponentsHeader *ch; + CComponentsForm *parent; + CLuaCCHeader() { ch = NULL; parent = NULL; } + ~CLuaCCHeader() { if (parent == NULL) delete ch; } +}; + +class CLuaInstCCHeader +{ + public: + CLuaInstCCHeader() {}; + ~CLuaInstCCHeader() {}; + static CLuaInstCCHeader* getInstance(); + static void CCHeaderRegister(lua_State *L); + + private: + static CLuaCCHeader *CCHeaderCheck(lua_State *L, int n); + static int CCHeaderNew(lua_State *L); + static int CCHeaderPaint(lua_State *L); + static int CCHeaderHide(lua_State *L); + static int CCHeaderDelete(lua_State *L); + +}; + +#endif //_LUACCHEADER_H diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index f02cea774..f3bf6b45f 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -37,6 +37,7 @@ #include #include "luainstance.h" +#include "lua_cc_header.h" #include "lua_cc_picture.h" #include "lua_cc_signalbox.h" #include "lua_cc_text.h" @@ -605,6 +606,7 @@ void LuaInstRegisterFunctions(lua_State *L, bool fromThreads/*=false*/) lua_settop(L, top); // ------------------------------------------ CLuaInstCCPicture::getInstance()->CCPictureRegister(L); + CLuaInstCCHeader::getInstance()->CCHeaderRegister(L); CLuaInstCCSignalbox::getInstance()->CCSignalBoxRegister(L); CLuaInstCCText::getInstance()->CCTextRegister(L); CLuaInstCCWindow::getInstance()->CCWindowRegister(L); diff --git a/src/gui/lua/luainstance_helpers.h b/src/gui/lua/luainstance_helpers.h index bd4eb571f..5b6dfb141 100644 --- a/src/gui/lua/luainstance_helpers.h +++ b/src/gui/lua/luainstance_helpers.h @@ -29,6 +29,7 @@ #define LUA_VIDEO_CLASSNAME "video" #define LUA_MISC_CLASSNAME "misc" #define LUA_CURL_CLASSNAME "curl" +#define LUA_HEADER_CLASSNAME "header" //#define LUA_WIKI "http://wiki.tuxbox.org/....." #define LUA_WIKI "https://slknet.de/wiki/w" From b0ca9a30cd717be58a2dc754a13116e3defed8b0 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 21 Jan 2016 09:09:33 +0100 Subject: [PATCH 14/14] CLuaInstMisc: Add getTimeOfDay() script function - Set Lua api version to 1.39 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cb7895d981d4d394c604da0fe755edfe31c9f007 Author: Michael Liebmann Date: 2016-01-21 (Thu, 21 Jan 2016) ------------------ This commit was generated by Migit --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_misc.cpp | 15 +++++++++++++++ src/gui/lua/lua_misc.h | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 9fe6f1a67..f95bdbc54 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 38 +#define LUA_API_VERSION_MINOR 39 diff --git a/src/gui/lua/lua_misc.cpp b/src/gui/lua/lua_misc.cpp index 2c173fe0f..3514f19c8 100644 --- a/src/gui/lua/lua_misc.cpp +++ b/src/gui/lua/lua_misc.cpp @@ -71,6 +71,7 @@ void CLuaInstMisc::LuaMiscRegister(lua_State *L) { "GetRevision", CLuaInstMisc::GetRevision }, { "checkVersion", CLuaInstMisc::checkVersion }, { "postMsg", CLuaInstMisc::postMsg }, + { "getTimeOfDay", CLuaInstMisc::getTimeOfDay }, { "__gc", CLuaInstMisc::MiscDelete }, { NULL, NULL } }; @@ -338,6 +339,20 @@ int CLuaInstMisc::postMsg(lua_State *L) return 0; } +int CLuaInstMisc::getTimeOfDay(lua_State *L) +{ + CLuaMisc *D = MiscCheckData(L, 1); + if (!D) return 0; + + struct timeval t1; + double dt; + gettimeofday(&t1, NULL); + dt = (double)t1.tv_sec + ((double)t1.tv_usec)/1000000ULL; + + lua_pushnumber(L, (lua_Number)dt); + return 1; +} + int CLuaInstMisc::MiscDelete(lua_State *L) { CLuaMisc *D = MiscCheckData(L, 1); diff --git a/src/gui/lua/lua_misc.h b/src/gui/lua/lua_misc.h index 0d4969be7..56ea4023f 100644 --- a/src/gui/lua/lua_misc.h +++ b/src/gui/lua/lua_misc.h @@ -63,6 +63,7 @@ class CLuaInstMisc static int GetRevision(lua_State *L); static int checkVersion(lua_State *L); static int postMsg(lua_State *L); + static int getTimeOfDay(lua_State *L); static int MiscDelete(lua_State *L); static void miscFunctionDeprecated(lua_State *L, std::string oldFunc);