From c94d0ed7c4e9715a76483dad12a38b954a7341a5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 21 Jan 2017 20:42:58 +0100 Subject: [PATCH 01/47] CComponentsHeader: fix order inside overloaded methode setCaption() Stop() was never touched with string version of setCaption() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/58316d20912b53e7efa3818ca605840c8be7d78d Author: Thilo Graf Date: 2017-01-21 (Sat, 21 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 7f36522c4..faef78453 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -146,6 +146,8 @@ CComponentsHeader::~CComponentsHeader() void CComponentsHeader::setCaption(const std::string& caption, const int& align_mode, const fb_pixel_t& text_color) { + if (cch_cl_obj) + cch_cl_obj->Stop(); cch_text = caption; cch_caption_align = align_mode; cch_col_text = text_color; @@ -153,8 +155,6 @@ void CComponentsHeader::setCaption(const std::string& caption, const int& align_ void CComponentsHeader::setCaption(neutrino_locale_t caption_locale, const int& align_mode, const fb_pixel_t& text_color) { - if (cch_cl_obj) - cch_cl_obj->Stop(); setCaption(string(g_Locale->getText(caption_locale)), align_mode, text_color); } From e40c90fddfb25f5146dc884d72475d69a8a38f06 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 23 Jan 2017 15:54:53 +0100 Subject: [PATCH 02/47] CComponentsText: fix wrong item type Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c42f1240f0772f4d6ad98e41eb4114b4f72c83e5 Author: Thilo Graf Date: 2017-01-23 (Mon, 23 Jan 2017) ------------------ 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 f56733584..828b0033f 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -78,7 +78,7 @@ void CComponentsText::initVarText( const int x_pos, const int y_pos, const int w int shadow_mode, fb_pixel_t color_text, fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) { - cc_item_type = CC_ITEMBOX_TEXT; + cc_item_type = CC_ITEMTYPE_TEXT; ct_font = font_text; ct_textbox = NULL; ct_text = text; From 1b2eea185fc3a50a027d7834c340a184b1eb62e4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 23 Jan 2017 15:55:38 +0100 Subject: [PATCH 03/47] cc_types.h: remove obsolete type enums Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2e24663a3f676d4a0a9684748b1cf726bda6c3a6 Author: Thilo Graf Date: 2017-01-23 (Mon, 23 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_types.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 5fc909f0e..12a42cf7c 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -147,14 +147,6 @@ enum CC_ALONG_Y = 2 }; -enum -{ - CC_ITEMBOX_ICON, - CC_ITEMBOX_PICTURE, - CC_ITEMBOX_TEXT, - CC_ITEMBOX_CLOCK -}; - typedef struct cc_element_data_t { int type; From 2d6b172e5c3ee7881dffcd969d17524dc22f89ae Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 23 Jan 2017 19:24:17 +0100 Subject: [PATCH 04/47] CComponentsLabel: Added missing overloaded counterpart to CComponentsText(parent) constructor. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cced4eba9ab1963e71296b95a4e9c57eebca025a Author: Thilo Graf Date: 2017-01-23 (Mon, 23 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item_text.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index 7bd5f6372..a8105e1a0 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -277,6 +277,22 @@ class CComponentsLabel : public CComponentsText { cc_item_type = CC_ITEMTYPE_LABEL; }; + + CComponentsLabel( CComponentsForm *parent, + const int x_pos = 10, const int y_pos = 10, const int w = 150, const int h = 50, + std::string text = "", + const int mode = CTextBox::AUTO_WIDTH, + Font* font_text = NULL, + const int& font_style = CComponentsText::FONT_STYLE_REGULAR, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t color_text = COL_MENUCONTENTINACTIVE_TEXT, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + :CComponentsText(x_pos, y_pos, w, h, text, mode, font_text, font_style, parent, shadow_mode, color_text, color_frame, color_body, color_shadow) + { + cc_item_type = CC_ITEMTYPE_LABEL; + }; }; #endif From 3735283f2390dddc603b36450d5ed37f5ca2c838 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 23 Jan 2017 20:34:54 +0100 Subject: [PATCH 05/47] CCDraw: simplified statement for blink init Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/44eebba080589378b584e4c1bba1bceae35a95ff Author: Thilo Graf Date: 2017-01-23 (Mon, 23 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 54acff507..10f00d890 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -732,10 +732,10 @@ void CCDraw::enableShadow(int mode, const int& shadow_width, bool force_paint) void CCDraw::paintTrigger() { - if (!is_painted) - paint1(); - else + if (is_painted) hide(); + else + paint(); } bool CCDraw::paintBlink(CComponentsTimer* Timer) From c9d058153f22f5140fb37a348f875c908f78ae7b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 23 Jan 2017 21:58:42 +0100 Subject: [PATCH 06/47] CBuildInfo: move InitInfoItems() into exec() ensures paint of data on each repaint. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9df86b6c379a89f2fc80971345585301d6562b99 Author: Thilo Graf Date: 2017-01-23 (Mon, 23 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/buildinfo.cpp | 11 ++++++++--- src/gui/buildinfo.h | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 782edc07e..23f81f85b 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -35,9 +35,13 @@ using namespace std; -CBuildInfo::CBuildInfo() : CComponentsWindow(0, 0, 700, 500, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) +CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, 700, 500, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) { initVarBuildInfo(); + if (show) + exec(NULL, ""); + else + InitInfoItems(); } //init all var members @@ -47,7 +51,6 @@ void CBuildInfo::initVarBuildInfo() font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]; setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); - InitInfoItems(); shadow = true; @@ -60,7 +63,9 @@ int CBuildInfo::exec(CMenuTarget* parent, const string & /*actionKey*/) if (parent) parent->hide(); - + + InitInfoItems(); + //exit if no informations available if (!HasData()){ return res; diff --git a/src/gui/buildinfo.h b/src/gui/buildinfo.h index 3ef9377dc..154cba8bb 100644 --- a/src/gui/buildinfo.h +++ b/src/gui/buildinfo.h @@ -69,7 +69,7 @@ class CBuildInfo : public CMenuTarget, public CComponentsWindow BI_TYPE_IDS }; - CBuildInfo(); + CBuildInfo(bool show = false); ///assigns text Font type void setFontType(Font* font_text); From f0979b290e7c1d2a1803cc316deca471088b7c67 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 23 Jan 2017 21:59:29 +0100 Subject: [PATCH 07/47] CTestMenu: fix blink of extended text sample Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4a288240f2c7116d2768de49a95c811434fe8790 Author: Thilo Graf Date: 2017-01-23 (Mon, 23 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/test_menu.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index bdaa04996..7afb93eb4 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -560,7 +560,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) else if (actionKey == "text_ext"){ if (text_ext == NULL) text_ext = new CComponentsExtTextForm(); - text_ext->setDimensionsAll(10, 20, 300, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); + text_ext->setDimensionsAll(10, 20, 300, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()+2*2); text_ext->setLabelAndText("Label", "Text for demo", g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); text_ext->setFrameThickness(2); // text_ext->setLabelWidthPercent(15/*%*/); @@ -577,15 +577,12 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) text_ext->setDimensionsAll(10, 20, 300, 48); text_ext->setLabelAndText("Label", "Text for demo", g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); text_ext->setFrameThickness(2); - // text_ext->setLabelWidthPercent(15/*%*/); - text_ext->paint0(); - static_cast(text_ext->getCCItem(1))->kill(); } - if (static_cast(text_ext->getCCItem(1))-> paintBlink(500000, true)){ + if (text_ext->paintBlink(500000, true)){ ShowHint("Testmenu: Blink","Testmenu: Blinking extended text is running ...", 700, 10); } - if (text_ext->getTextObject()->cancelBlink()){ + if (text_ext->cancelBlink()){ ShowHint("Testmenu: Blink","Testmenu: Blinking extended text stopped ...", 700, 2); } return res; From 2ad657c74dd7775a30eff57a34b7849a99e8a659 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 24 Jan 2017 22:33:20 +0100 Subject: [PATCH 08/47] fontrenderer: Rework rendering for better font presentation - For the correct use of the changes should be built freetype with the following settings: #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING #define TT_CONFIG_OPTION_SUBPIXEL_HINTING BS-Patch for freetype 2.5-2.7 ----------------------------- ** include/freetype/config/ftoption.h ** -/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ +#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING -/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */ +#define TT_CONFIG_OPTION_SUBPIXEL_HINTING BS-Patch for freetype 2.7.1 --------------------------- ** include/freetype/config/ftoption.h ** -/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ +#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/97d1d93c930278fd06a3e2d99c94022146e375b2 Author: Michael Liebmann Date: 2017-01-24 (Tue, 24 Jan 2017) Origin message was: ------------------ fontrenderer: Rework rendering for better font presentation - For the correct use of the changes should be built freetype with the following settings: #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING #define TT_CONFIG_OPTION_SUBPIXEL_HINTING BS-Patch for freetype 2.5-2.7 ----------------------------- ** include/freetype/config/ftoption.h ** -/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ +#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING -/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */ +#define TT_CONFIG_OPTION_SUBPIXEL_HINTING BS-Patch for freetype 2.7.1 --------------------------- ** include/freetype/config/ftoption.h ** -/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ +#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING ------------------ This commit was generated by Migit --- src/driver/fontrenderer.cpp | 157 +++++++++++++++++------------------- src/driver/fontrenderer.h | 7 +- src/gui/widget/textbox.cpp | 2 +- 3 files changed, 79 insertions(+), 87 deletions(-) diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index d43684626..a9a547cdb 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -3,6 +3,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2003 thegoodguy + Copyright (C) 2013-2017 M. Liebmann (micha-bbg) License: GPL @@ -240,6 +241,9 @@ Font::Font(FBFontRenderClass *render, FTC_FaceID faceid, const int isize, const scaler.y_res = render->yres; setSize(isize); + fg_red = 0, fg_green = 0, fg_blue = 0; + memset((void*)colors, '\0', sizeof(colors)); + useFullBG = false; } FT_Error Font::getGlyphBitmap(FT_ULong glyph_index, FTC_SBit *sbit) @@ -383,43 +387,56 @@ int UTF8ToUnicode(const char * &text, const bool utf8_encoded) // returns -1 on return unicode_value; } -#define F_MUL 0x7FFF - -void Font::paintFontPixel(fb_pixel_t *td, uint8_t fg_red, uint8_t fg_green, uint8_t fg_blue, int faktor, uint8_t index) +void Font::paintFontPixel(fb_pixel_t *td, uint8_t src) { - fb_pixel_t bg_col = *td; - if (bg_col == (fb_pixel_t)0) - bg_col = 0xE0808080; - uint8_t bg_trans = (bg_col & 0xFF000000) >> 24; - int korr_r = ((bg_col & 0x00FF0000) >> 16) - fg_red; - int korr_g = ((bg_col & 0x0000FF00) >> 8) - fg_green; - int korr_b = (bg_col & 0x000000FF) - fg_blue; - - *td = ((g_settings.contrast_fonts && (index > 128)) ? 0xFF000000 : (((bg_trans == 0) ? 0xFF : bg_trans) << 24) & 0xFF000000) | - (((fg_red + ((korr_r*faktor)/F_MUL)) << 16) & 0x00FF0000) | - (((fg_green + ((korr_g*faktor)/F_MUL)) << 8) & 0x0000FF00) | - ((fg_blue + ((korr_b*faktor)/F_MUL)) & 0x000000FF); +#define DST_BLUE 0x80 +#define DST_GREEN 0x80 +#define DST_RED 0x80 +#define DST_TRANS 0x80 + if (useFullBG) { + uint8_t *dst = (uint8_t *)td; + if (*td == (fb_pixel_t)0) { + *dst = DST_BLUE + ((fg_blue - DST_BLUE) * src) / 256; + dst++; + *dst = DST_GREEN + ((fg_green - DST_GREEN) * src) / 256; + dst++; + *dst = DST_RED + ((fg_red - DST_RED) * src) / 256; + dst++; + *dst = (uint8_t)int_min(255, DST_TRANS + src); + } + else { + *dst = *dst + ((fg_blue - *dst) * src) / 256; + dst++; + *dst = *dst + ((fg_green - *dst) * src) / 256; + dst++; + *dst = *dst + ((fg_red - *dst) * src) / 256; + dst++; + *dst = (uint8_t)int_min(0xFF, *dst + src); + } + } + else + *td = colors[src]; } void Font::RenderString(int x, int y, const int width, const char *text, const fb_pixel_t color, const int boxheight, const unsigned int flags) { - const bool utf8_encoded = flags & IS_UTF8; - const bool useFullBg = flags & FULLBG; -/* - useFullBg (default = false) - - useFullBg = false - fetch bgcolor from framebuffer, using lower left edge of the font - - useFullBg = true - fetch bgcolor from framebuffer, using the respective real font position - - font rendering slower - - e.g. required for font rendering on images -*/ - if (!frameBuffer->getActive()) return; + const bool utf8_encoded = flags & IS_UTF8; + useFullBG = flags & FULLBG; +/* + useFullBg = false + fetch bgcolor from framebuffer, using lower left edge of the font + - default render mode + - font rendering faster + + useFullBg = true + fetch bgcolor from framebuffer, using the respective real fontpixel position + - better quality at font rendering on images or background with color gradient + - font rendering slower +*/ + frameBuffer->checkFbArea(x, y-height, width, height, true); pthread_mutex_lock( &renderer->render_mutex ); @@ -477,56 +494,34 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f int lastindex=0; // 0 == missing glyph (never has kerning values) FT_Vector kerning; - int pen1=-1; // "pen" positions for kerning, pen2 is "x" - static fb_pixel_t old_bgcolor = 0, old_fgcolor = 0; - static uint8_t bg_trans = 0, fg_red = 0, fg_green = 0, fg_blue = 0; - static bool olduseFullBg = false; - static fb_pixel_t colors[256] = {0}; - static int faktor[256] = {0}; - static bool fontRecsInit = false; - fb_pixel_t bg_color = 1; - fb_pixel_t fg_color = color; + int pen1 = -1; // "pen" positions for kerning, pen2 is "x" - if (!useFullBg) { - /* the GXA seems to do it's job asynchonously, so we need to wait until - it's ready, otherwise the font will sometimes "be overwritten" with - background color or bgcolor will be wrong */ - frameBuffer->waitForIdle("Font::RenderString 1"); + fg_red = (color & 0x00FF0000) >> 16; + fg_green = (color & 0x0000FF00) >> 8; + fg_blue = color & 0x000000FF; + fb_pixel_t bg_color = 0; + + /* the GXA seems to do it's job asynchonously, so we need to wait until + it's ready, otherwise the font will sometimes "be overwritten" with + background color or bgcolor will be wrong */ + frameBuffer->waitForIdle("Font::RenderString 1"); + if (!useFullBG) { /* fetch bgcolor from framebuffer, using lower left edge of the font... */ bg_color = *(frameBuffer->getFrameBufferPointer() + x + y * frameBuffer->getStride() / sizeof(fb_pixel_t)); - } - else - bg_color = 0; - if ((old_fgcolor != fg_color) || (old_bgcolor != bg_color) || (olduseFullBg != useFullBg) || !fontRecsInit) { - old_bgcolor = bg_color; - old_fgcolor = fg_color; - olduseFullBg = useFullBg; - fontRecsInit = true; + if (bg_color == (fb_pixel_t)0) + bg_color = 0x80808080; - bg_trans = (bg_color & 0xFF000000) >> 24; - fg_red = (fg_color & 0x00FF0000) >> 16; - fg_green = (fg_color & 0x0000FF00) >> 8; - fg_blue = fg_color & 0x000000FF; - - int korr_r=0, korr_g=0, korr_b=0; - if (!useFullBg) { - korr_r = ((bg_color & 0x00FF0000) >> 16) - fg_red; - korr_g = ((bg_color & 0x0000FF00) >> 8) - fg_green; - korr_b = (bg_color & 0x000000FF) - fg_blue; - } - - for (int i = 0; i <= 0xFF; i++) { - int _faktor = ((0xFF - i) * F_MUL) / 0xFF; - - if (useFullBg) - faktor[i] = _faktor; - else - colors[i] = ((g_settings.contrast_fonts && (i > 128)) ? 0xFF000000 : (((bg_trans == 0) ? 0xFF : bg_trans) << 24) & 0xFF000000) | - (((fg_red + ((korr_r*_faktor)/F_MUL)) << 16) & 0x00FF0000) | - (((fg_green + ((korr_g*_faktor)/F_MUL)) << 8) & 0x0000FF00) | - ((fg_blue + ((korr_b*_faktor)/F_MUL)) & 0x000000FF); + uint8_t bg_trans = (bg_color & 0xFF000000) >> 24; + uint8_t bg_red = (bg_color & 0x00FF0000) >> 16; + uint8_t bg_green = (bg_color & 0x0000FF00) >> 8; + uint8_t bg_blue = bg_color & 0x000000FF; + for (int i = 0; i < 256; i++) { + colors[i] = (((int_min(0xFF, bg_trans + i)) << 24) & 0xFF000000) | + (((bg_red +((fg_red -bg_red) * i)/256) << 16) & 0x00FF0000) | + (((bg_green+((fg_green-bg_green)* i)/256) << 8) & 0x0000FF00) | + ((bg_blue +((fg_blue -bg_blue) * i)/256) & 0x000000FF); } } @@ -596,12 +591,8 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f for (ax = 0; ax < w + spread_by; ax++) { if (stylemodifier != Font::Embolden) { /* do not paint the backgroundcolor (*s = 0) */ - if(*s != 0) { - if (useFullBg) - paintFontPixel(td, fg_red, fg_green, fg_blue, faktor[*s], *s); - else - *td = colors[*s]; - } + if (*s != 0) + paintFontPixel(td, *s); } else { int lcolor = -1; @@ -611,12 +602,8 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f if (lcolor < *(s - i)) lcolor = *(s - i); /* do not paint the backgroundcolor (lcolor = 0) */ - if(lcolor != 0) { - if (useFullBg) - paintFontPixel(td, fg_red, fg_green, fg_blue, faktor[lcolor], (uint8_t)lcolor); - else - *td = colors[lcolor]; - } + if (lcolor != 0) + paintFontPixel(td, (uint8_t)lcolor); } td++; s++; } diff --git a/src/driver/fontrenderer.h b/src/driver/fontrenderer.h index c061a7934..416ca6da1 100644 --- a/src/driver/fontrenderer.h +++ b/src/driver/fontrenderer.h @@ -3,6 +3,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2003 thegoodguy + Copyright (C) 2013-2017 M. Liebmann (micha-bbg) License: GPL @@ -54,8 +55,12 @@ class Font int height,DigitHeight,DigitOffset,ascender,descender,upper,lower; int fontwidth; int maxdigitwidth; + uint8_t fg_red, fg_green, fg_blue; + fb_pixel_t colors[256]; + bool useFullBG; - inline void paintFontPixel(fb_pixel_t *td, uint8_t fg_red, uint8_t fg_green, uint8_t fg_blue, int faktor, uint8_t index); + inline int int_min(int a, int b) { return (a < b) ? a : b; } + inline void paintFontPixel(fb_pixel_t *td, uint8_t src); public: enum fontmodifier diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index e669687ae..043ffbaac 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -716,7 +716,7 @@ void CTextBox::refreshText(void) frameBuffer->paintBoxRel(tx, ty-th, tw, th, COL_RED, m_nBgRadius, m_nBgRadiusType); #endif //TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX); - m_pcFontText->RenderString(tx, ty, tw, m_cLineArray[i].c_str(), m_textColor, 0, (m_renderMode | m_utf8_encoded) ? Font::IS_UTF8 : 0); + m_pcFontText->RenderString(tx, ty, tw, m_cLineArray[i].c_str(), m_textColor, 0, m_renderMode | ((m_utf8_encoded) ? Font::IS_UTF8 : 0)); m_old_cText = m_cText; y += m_nFontTextHeight; } From 32bbcaaa83815408f8c60b5ac0f5d66a9e7636b6 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 24 Jan 2017 22:33:23 +0100 Subject: [PATCH 09/47] screensaver: Use black background for the clock Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c62f964dde288be2c09001d986a6db67a018bf89 Author: Michael Liebmann Date: 2017-01-24 (Tue, 24 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/screensaver.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 1ded487eb..7c3b50b5a 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -270,10 +270,11 @@ void CScreenSaver::paint() } else{ if (!scr_clock){ - scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H:%M:%S", "%H:%M %S", true); + scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H:%M:%S", "%H:%M %S", true, + 1, NULL, CC_SHADOW_OFF, COL_BLACK, COL_BLACK); scr_clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]); scr_clock->disableSaveBg(); - scr_clock->doPaintBg(false); + scr_clock->doPaintBg(true); } if (scr_clock->isPainted()) scr_clock->Stop(); From 73076ba2cb9f84dc29fbfafff7d6fd861c8cf759 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 24 Jan 2017 22:33:27 +0100 Subject: [PATCH 10/47] Remove obsolete 'contrast_fonts' code from osd menu Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6803a8dff3c3d7a8efabd3759fe9b3205ee19fcc Author: Michael Liebmann Date: 2017-01-24 (Tue, 24 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 -- data/locale/english.locale | 2 -- data/locale/nederlands.locale | 2 -- data/locale/slovak.locale | 2 -- data/locale/unmaintained/czech.locale | 2 -- data/locale/unmaintained/polski.locale | 2 -- src/gui/osd_setup.cpp | 9 +-------- src/neutrino.cpp | 3 --- src/system/locals.h | 2 -- src/system/locals_intern.h | 2 -- src/system/settings.h | 2 -- 11 files changed, 1 insertion(+), 29 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index ad5fe2adf..a1715b44f 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -319,7 +319,6 @@ colormenu.advanced_mode_off Standard-Optionen colormenu.advanced_mode_on Erweiterte Optionen colormenu.background Hintergrundfarbe colormenu.clock_textcolor Ziffernfarbe -colormenu.contrast_fonts Schriftkontrast colormenu.fade Ein-/Ausblenden colormenu.font Verwendete Schriftart colormenu.font_ttx Teletext Schriftart @@ -1030,7 +1029,6 @@ menu.hint_colored_events_textcolor Ändern Sie die Farbe für farbige Events in menu.hint_colors Konfigurieren Sie die Menü-Farben menu.hint_content_back Ändern Sie die Hintergrundfarbe für den Fensterinhalt menu.hint_content_textcolor Ändern Sie die Textfarbe für den Fensterinhalt -menu.hint_contrast_fonts Wählen Sie einen höheren Schriftkontrast menu.hint_dboxinfo Informationen über CPU und Arbeitsspeicher der Box menu.hint_delete_channels Löschen aller Kanäle menu.hint_delete_removed Lösche das Bouquet 'Gelöschte Kanäle' diff --git a/data/locale/english.locale b/data/locale/english.locale index 5b3f6e6e4..4feae3a1e 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -319,7 +319,6 @@ colormenu.advanced_mode_off Default options colormenu.advanced_mode_on Advanced options colormenu.background Background colormenu.clock_textcolor Digit color -colormenu.contrast_fonts Contrast fonts colormenu.fade Fade GUI colormenu.font Select GUI font colormenu.font_ttx Select Teletext font @@ -1030,7 +1029,6 @@ menu.hint_colored_events_textcolor Change color for colored events in channellis menu.hint_colors Configure GUI colors menu.hint_content_back Change GUI window background color menu.hint_content_textcolor Change GUI window text color -menu.hint_contrast_fonts Make fonts contrast (do not blend with background) menu.hint_dboxinfo Information about box cpu and storage menu.hint_delete_channels Remove all channels menu.hint_delete_removed Delete the channels in the 'Removed channels' boquet diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index b4c78e9e0..1ec45b998 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -289,7 +289,6 @@ colormenu.advanced_mode_off Toon standaard opties colormenu.advanced_mode_on Toon geavanceerde zoekopties colormenu.background Achtergrond colormenu.clock_textcolor Digit kleur -colormenu.contrast_fonts Contrast lettertype colormenu.fade Menu's vervagen colormenu.font Selecteer lettertype gebruikersinterface colormenu.font_ttx Selecteer lettertype teletekst @@ -953,7 +952,6 @@ menu.hint_colored_events_textcolor Wijzig programma kleur voor gekleurde program menu.hint_colors Configureer GUI-kleuren menu.hint_content_back Wijzig venster achtergrond kleur menu.hint_content_textcolor Wijzig venster tekst kleur -menu.hint_contrast_fonts Lettertype contrast (Niet overgaan in achtergrond) menu.hint_dboxinfo Informatie over STB CPU en opslag menu.hint_delete_channels Verplaats alle kanalen menu.hint_delete_removed Verwijder de zenders in de 'Verwijderde zenders' bouquet diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index c292260db..3ae068e32 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -319,7 +319,6 @@ colormenu.advanced_mode_off Predvolené hodnoty colormenu.advanced_mode_on Rozšírené voľby colormenu.background Pozadie colormenu.clock_textcolor Farba číslic -colormenu.contrast_fonts Kontrast písma colormenu.fade Miznúce menu colormenu.font Výber písma colormenu.font_ttx Výber teletextového písma @@ -1030,7 +1029,6 @@ menu.hint_colored_events_textcolor Zmena farby pre farebné udalosti v zozname k menu.hint_colors Konfigurácia farieb GUI menu.hint_content_back Zmena farby podkladu GUI okna menu.hint_content_textcolor Zmena farby textu GUI okna -menu.hint_contrast_fonts Zvýraznenie kontrastu pisma (neúčinné pri podklade) menu.hint_dboxinfo Informácia o procesore a úložisku menu.hint_delete_channels Odstránenie všetkých kanálov menu.hint_delete_removed Vymazanie kanálov v bukete "Odstránené kanaly" diff --git a/data/locale/unmaintained/czech.locale b/data/locale/unmaintained/czech.locale index e2858c8cf..c4d0063c4 100644 --- a/data/locale/unmaintained/czech.locale +++ b/data/locale/unmaintained/czech.locale @@ -281,7 +281,6 @@ colorchooser.green Zelený colorchooser.red Červený colormenu.background Pozadí colormenu.clock_textcolor Barva číslic -colormenu.contrast_fonts Kontrast písma colormenu.fade Mizící menu colormenu.font Výběr písma colormenu.font_ttx Výběr teletextového písma @@ -946,7 +945,6 @@ menu.hint_color_gradient Přepne barevné přechody pro různé položky nabídk menu.hint_colors Konfigurace barev GUI menu.hint_content_back Změna barvy podkladu GUI okna menu.hint_content_textcolor Změna barvy textu GUI okna -menu.hint_contrast_fonts Zvýraznění kontrastu pisma (neúčinné u podkladu) menu.hint_dboxinfo Informace o procesoru a úložišti menu.hint_delete_channels Odstranění všech kanálů menu.hint_delete_removed Vymazání kanálů v buketu "Odstraněné kanály" diff --git a/data/locale/unmaintained/polski.locale b/data/locale/unmaintained/polski.locale index 305a5b2e1..75b427936 100644 --- a/data/locale/unmaintained/polski.locale +++ b/data/locale/unmaintained/polski.locale @@ -281,7 +281,6 @@ colorchooser.green Zielony colorchooser.red Czerwony colormenu.background Kolor tła colormenu.clock_textcolor Kolor zegara -colormenu.contrast_fonts Kontrast fontów colormenu.fade Zanikanie menu colormenu.font Font OSD colormenu.font_ttx Font teletekstu @@ -946,7 +945,6 @@ menu.hint_color_gradient Switches color gradients for various menu items on/off menu.hint_colors Configure GUI colors menu.hint_content_back Change GUI window background color menu.hint_content_textcolor Change GUI window text color -menu.hint_contrast_fonts Make fonts contrast (do not blend with background) menu.hint_dboxinfo Information about box cpu and storage menu.hint_delete_channels Remove all channels menu.hint_delete_removed Delete the channels in the 'Removed channels' boquet diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 87e76624d..a45a0ca5f 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -973,11 +973,6 @@ void COsdSetup::showOsdFontSizeSetup(CMenuWidget *menu_fonts) mfTtxFontFile->setHint("", LOCALE_MENU_HINT_FONT_TTX); fontSettings->addItem(mfTtxFontFile); - // contrast fonts - CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_COLORMENU_CONTRAST_FONTS, &g_settings.contrast_fonts, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this, CRCInput::RC_yellow); - mc->setHint("", LOCALE_MENU_HINT_CONTRAST_FONTS); - fontSettings->addItem(mc); - fontSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_FONTMENU_SIZES)); //submenu font scaling @@ -1325,9 +1320,7 @@ void COsdSetup::showOsdInfoclockSetup(CMenuWidget *menu_infoclock) bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) { - if(ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_CONTRAST_FONTS)) - return true; - else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SETTINGS_MENU_POS)) { + if (ARE_LOCALES_EQUAL(OptionName, LOCALE_SETTINGS_MENU_POS)) { submenu_menus->hide(); return true; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d6467bdf2..4e68ed97d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -577,8 +577,6 @@ int CNeutrinoApp::loadSetup(const char * fname) for (int i = 0; i < SNeutrinoSettings::P_SETTINGS_MAX; i++)//settings.h, settings.cpp g_settings.personalize[i] = configfile.getInt32( personalize_settings[i].personalize_settings_name, personalize_settings[i].personalize_default_val ); - g_settings.contrast_fonts = configfile.getInt32("contrast_fonts", 0); - //network for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { std::string i_str(to_string(i)); @@ -1189,7 +1187,6 @@ void CNeutrinoApp::saveSetup(const char * fname) for (int i = 0; i < SNeutrinoSettings::P_SETTINGS_MAX; i++) //settings.h, settings.cpp configfile.setInt32(personalize_settings[i].personalize_settings_name, g_settings.personalize[i]); - configfile.setInt32( "contrast_fonts", g_settings.contrast_fonts ); //network for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { sprintf(cfg_key, "network_nfs_ip_%d", i); diff --git a/src/system/locals.h b/src/system/locals.h index 18546341d..b74b90eb8 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -346,7 +346,6 @@ typedef enum LOCALE_COLORMENU_ADVANCED_MODE_ON, LOCALE_COLORMENU_BACKGROUND, LOCALE_COLORMENU_CLOCK_TEXTCOLOR, - LOCALE_COLORMENU_CONTRAST_FONTS, LOCALE_COLORMENU_FADE, LOCALE_COLORMENU_FONT, LOCALE_COLORMENU_FONT_TTX, @@ -1057,7 +1056,6 @@ typedef enum LOCALE_MENU_HINT_COLORS, LOCALE_MENU_HINT_CONTENT_BACK, LOCALE_MENU_HINT_CONTENT_TEXTCOLOR, - LOCALE_MENU_HINT_CONTRAST_FONTS, LOCALE_MENU_HINT_DBOXINFO, LOCALE_MENU_HINT_DELETE_CHANNELS, LOCALE_MENU_HINT_DELETE_REMOVED, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index f2d76e08d..b3b18075b 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -346,7 +346,6 @@ const char * locale_real_names[] = "colormenu.advanced_mode_on", "colormenu.background", "colormenu.clock_textcolor", - "colormenu.contrast_fonts", "colormenu.fade", "colormenu.font", "colormenu.font_ttx", @@ -1057,7 +1056,6 @@ const char * locale_real_names[] = "menu.hint_colors", "menu.hint_content_back", "menu.hint_content_textcolor", - "menu.hint_contrast_fonts", "menu.hint_dboxinfo", "menu.hint_delete_channels", "menu.hint_delete_removed", diff --git a/src/system/settings.h b/src/system/settings.h index 6d8bb8dc7..8d0e53e71 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -422,8 +422,6 @@ struct SNeutrinoSettings SNeutrinoTheme theme; bool osd_colorsettings_advanced_mode; - int contrast_fonts; - //network #define NETWORK_NFS_NR_OF_ENTRIES 8 struct { From 002f41b5bd3da9e327e1dcaf2bfce4906f4b9524 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 10 Jan 2017 23:21:55 +0100 Subject: [PATCH 11/47] CTextBox: paint bg always if pixbuffer exists Should prevent unintended possible overlap on multiple font render. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9b69803ca4bbba6310ea24bf440365cbeb3c70bb Author: Thilo Graf Date: 2017-01-10 (Tue, 10 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 043ffbaac..79cc95e30 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -601,12 +601,13 @@ void CTextBox::refreshText(void) bool has_changed = hasChanged(&ax, &ay, &dx, &dy); //clean up possible screen on any changes - if (has_changed && m_bgpixbuf){ + if (has_changed || m_bgpixbuf){ /*TODO/FIXME: in some cases could be required, that we must restore old saved screen. eg. if a text without bg was painted * and another text should be painted as next on the same position like current text, but new text will be overpaint and is * not visible. It's currently solvable only with appropriate order of text items */ - frameBuffer->RestoreScreen(m_old_x, m_old_y, m_old_dx, m_old_dy, m_bgpixbuf); + if (m_bgpixbuf) + frameBuffer->RestoreScreen(m_old_x, m_old_y, m_old_dx, m_old_dy, m_bgpixbuf); clearScreenBuffer(); } From 4fdb5d0b23f9b99650f366e2fce06c88dcce85fe Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 16 Jan 2017 12:10:14 +0100 Subject: [PATCH 12/47] CTextBox: remove text reinit from reInitToCompareVar() Will be already done after each text render. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ae903ddb2f738784ccbc97547b3b905454ba22aa Author: Thilo Graf Date: 2017-01-16 (Mon, 16 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 79cc95e30..ac9cc8acb 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -573,7 +573,6 @@ void CTextBox::reInitToCompareVar(int* x, int* y, int* dx, int* dy) m_old_nBgRadius = m_nBgRadius; m_old_nBgRadiusType = m_nBgRadiusType; m_old_nMode = m_nMode; - m_old_cText = m_cText; } void CTextBox::refreshText(void) From f82ce2d192d271941a13925429e955fd7d63acdf Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 24 Jan 2017 23:14:37 +0100 Subject: [PATCH 13/47] CTextBox: add attribut 'm_bg_painted' Shoul help in together with changed text content to control required text render. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d31deac54510cc7e191c758a19aa1a725a00f2f6 Author: Thilo Graf Date: 2017-01-24 (Tue, 24 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 5 ++++- src/gui/widget/textbox.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index ac9cc8acb..955a3b5a3 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -159,6 +159,7 @@ void CTextBox::initVar(void) m_pcFontText = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]; m_nFontTextHeight = getFontTextHeight(); m_nMaxTextWidth = 0; + m_bg_painted = false; m_nNrOfPages = 1; m_nNrOfLines = 0; @@ -648,6 +649,7 @@ void CTextBox::refreshText(void) //TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__); //paint full background only on new text, otherwise paint required background frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, BgRadiusType); + m_bg_painted = true; } } else{ @@ -716,7 +718,8 @@ void CTextBox::refreshText(void) frameBuffer->paintBoxRel(tx, ty-th, tw, th, COL_RED, m_nBgRadius, m_nBgRadiusType); #endif //TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX); - m_pcFontText->RenderString(tx, ty, tw, m_cLineArray[i].c_str(), m_textColor, 0, m_renderMode | ((m_utf8_encoded) ? Font::IS_UTF8 : 0)); + if (m_bg_painted || m_old_cText != m_cText) + m_pcFontText->RenderString(tx, ty, tw, m_cLineArray[i].c_str(), m_textColor, 0, m_renderMode | ((m_utf8_encoded) ? Font::IS_UTF8 : 0)); m_old_cText = m_cText; y += m_nFontTextHeight; } diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index c38ea5ef1..afb4e3912 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -122,6 +122,7 @@ class CTextBox : public sigc::trackable fb_pixel_t m_old_textBackgroundColor, m_old_textColor; bool m_showTextFrame; + bool m_bg_painted; CBox m_cFrame; CBox m_cFrameTextRel; From efd46bc4ce09d59e5bf4bd3cfd95ce645d585e1f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 17 Jan 2017 08:53:12 +0100 Subject: [PATCH 14/47] CTextBox: rework return control of value of setText() function value was not clearly, hope i'ts now Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1120e3a37dae79ff404175d1a7e16ef42cc32d73 Author: Thilo Graf Date: 2017-01-17 (Tue, 17 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 955a3b5a3..e21b7aac1 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -789,23 +789,26 @@ void CTextBox::refresh(void) bool CTextBox::setText(const std::string* newText, int max_width, bool force_repaint) { //TRACE("[CTextBox]->SetText \r\n"); - bool result = false; m_nMaxTextWidth = max_width; //reset text to force repaint the text, managed in hasChanged() if (force_repaint) m_old_cText = ""; //printf("setText: _max_width %d max_width %d\n", _max_width, max_width); - if (newText != NULL) - { + if (newText){ m_cText = *newText; - //m_cText = *newText + "\n"; //FIXME test - reSizeMainFrameHeight(m_cFrame.iHeight); - //refresh text line array - refreshTextLineArray(); - refresh(); - result = true; - } - return(result); + if (m_old_cText != m_cText){ + //m_cText = *newText + "\n"; //FIXME test + reSizeMainFrameHeight(m_cFrame.iHeight); + //refresh text line array + refreshTextLineArray(); + refresh(); + return true; + } + return false; + }else + return false; + + return true; } void CTextBox::paint (void) From bc4a990a0c1d6908a4d910681b31e98c6b9ac9c9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 18 Jan 2017 09:45:47 +0100 Subject: [PATCH 15/47] CCDraw: add signal OnAfterPaintBg Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0eb8c7b1735959720cda9fcd700d09dff55b6fa3 Author: Thilo Graf Date: 2017-01-18 (Wed, 18 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 1 + src/gui/components/cc_draw.h | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 10f00d890..eedd3c3f1 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -630,6 +630,7 @@ void CCDraw::paintFbItems(bool do_save_bg) } } is_painted = v_fbdata[i].is_painted = true; + OnAfterPaintBg(); } } } diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index dd99986fa..47702562f 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -353,10 +353,12 @@ class CCDraw : public COSDFader, public CComponentsSignals */ bool cancelBlink(bool keep_on_screen = false); - ///signal on before paint fb layers, called inside paintFbItems() + ///signal on before paint fb layers, called before paint fb layers inside paintFbItems() sigc::signal OnBeforePaintLayers; - ///signal on after paint fb layers, called inside paintFbItems() + ///signal on after paint fb layers, called after paint fb layers inside paintFbItems() sigc::signal OnAfterPaintLayers; + ///signal on after paint background, called after paint of background box inside paintFbItems() + sigc::signal OnAfterPaintBg; /*! Removes current item from screen and From 151b2f03249646659402c81190ef04a678637675 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 18 Jan 2017 11:59:21 +0100 Subject: [PATCH 16/47] CComponentsFrmClock: add slot to handle enforced repaint of segments If clock removed from screen and instance is not destroyed, then we must ensure repaint of segments after painted background. This is required if segments are only will paint if their content was changed and attribut ct_force_text_paint = false. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/81f26a327d0266621c58a859ca62dd9d79e3c65c Author: Thilo Graf Date: 2017-01-18 (Wed, 18 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_clock.cpp | 25 ++++++++++++++++++------- src/gui/components/cc_frm_clock.h | 7 ++++++- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index d1a9cbc7a..ff5a7c9be 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -30,7 +30,7 @@ #include "cc_frm_clock.h" #include - +#include #include #include #include @@ -98,7 +98,10 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, initParent(parent); //init slot for running clock - cl_sl = sigc::mem_fun0(*this, &CComponentsFrmClock::ShowTime); + cl_sl_show = sigc::mem_fun0(*this, &CComponentsFrmClock::ShowTime); + + //init slot to ensure paint segments after painted background + cl_sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsFrmClock::forceSegemnentsPaint), true); //run clock already if required if (activ) @@ -297,6 +300,11 @@ void CComponentsFrmClock::initCCLockItems() x_lbl += v_cc_items[i-1]->getWidth(); v_cc_items[i]->setPos(x_lbl, y_lbl); } + + //init slot to handle repaint of segments if background was repainted + OnAfterPaintBg.clear(); + if (paint_bg) + OnAfterPaintBg.connect(cl_sl_repaint); } @@ -321,7 +329,7 @@ bool CComponentsFrmClock::startClock() cl_timer = new CComponentsTimer(0); if (cl_timer->OnTimer.empty()){ dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); - cl_timer->OnTimer.connect(cl_sl); + cl_timer->OnTimer.connect(cl_sl_show); } } cl_timer->setTimerInterval(cl_interval); @@ -338,6 +346,7 @@ bool CComponentsFrmClock::stopClock() if (cl_timer){ if (cl_timer->stopTimer()){ dprintf(DEBUG_INFO, "[CComponentsFrmClock] [%s] stopping clock...\n", __func__); + clear(); delete cl_timer; cl_timer = NULL; return true; @@ -374,10 +383,6 @@ void CComponentsFrmClock::paint(bool do_save_bg) //paint form contents CComponentsForm::paint(do_save_bg); -#if 0 //has no effect - if (may_blit) - frameBuffer->blit(); -#endif } void CComponentsFrmClock::setClockFont(Font *font, const int& style) @@ -450,3 +455,9 @@ bool CComponentsFrmClock::enableColBodyGradient(const int& enable_mode, const fb } return false; } + +void CComponentsFrmClock::forceSegemnentsPaint(bool force) +{ + for (size_t i = 0; i < v_cc_items.size(); i++) + static_cast (v_cc_items[i])->forceTextPaint(force); +} diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index ddc5abbbb..89ed33e91 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -52,7 +52,10 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen protected: ///slot for timer event, reserved for ShowTime() - sigc::slot0 cl_sl; + sigc::slot0 cl_sl_show; + + ///slot for background paint event, reserved for initCCLockItems() + sigc::slot0 cl_sl_repaint; ///refresh interval in seconds int cl_interval; @@ -90,6 +93,8 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen void toggleFormat(); ///init internal font void initClockFont(int dx, int dy); + ///force repaint of all segments + void forceSegemnentsPaint(bool force); public: From fbbe2b1345850a1cfcef755d145d7d8d1381ba65 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 24 Jan 2017 23:17:59 +0100 Subject: [PATCH 17/47] CTextBox: fix m_old_cText update after text paint refreshText() executes loop also for text with more than one line and m_old_cText attribut should be updated only if loop is ready. Otherwise in text boxes with more than one line, only first line would be painted. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2f24e982521faec904b5c1f09d510a5d98e68a80 Author: Thilo Graf Date: 2017-01-24 (Tue, 24 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index e21b7aac1..54968c03c 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -720,9 +720,9 @@ void CTextBox::refreshText(void) //TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX); if (m_bg_painted || m_old_cText != m_cText) m_pcFontText->RenderString(tx, ty, tw, m_cLineArray[i].c_str(), m_textColor, 0, m_renderMode | ((m_utf8_encoded) ? Font::IS_UTF8 : 0)); - m_old_cText = m_cText; y += m_nFontTextHeight; } + m_old_cText = m_cText; } void CTextBox::scrollPageDown(const int pages) From 4b523310664ea0c27610cf64dd7206d0e059811a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 19 Jan 2017 09:15:49 +0100 Subject: [PATCH 18/47] Experimental try to rework isPainted() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/26eb4d079ba7ed14558a6ad8b2dd7732153ef30e Author: Thilo Graf Date: 2017-01-19 (Thu, 19 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 22 +++++++++++++++++++--- src/gui/components/cc_draw.h | 4 ++-- src/gui/components/cc_frm.cpp | 3 ++- src/gui/components/cc_frm_header.cpp | 6 ++++-- src/gui/infoclock.cpp | 1 + src/gui/infoviewer.cpp | 1 + 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index eedd3c3f1..87cec83a1 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -629,16 +629,32 @@ void CCDraw::paintFbItems(bool do_save_bg) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); } } - is_painted = v_fbdata[i].is_painted = true; + v_fbdata[i].is_painted = true; OnAfterPaintBg(); } } } } + + //set is_painted attribut. if any layer was painted set it to true; + is_painted = isPainted(); + //pick up signal if filled OnAfterPaintLayers(); } + bool CCDraw::isPainted() + { + if (firstPaint) + return false; + + for(size_t i=0; i< v_fbdata.size(); i++) + if (v_fbdata[i].is_painted) + return true; + + return false; + } + void CCDraw::hide() { OnBeforeHide(); @@ -653,8 +669,8 @@ void CCDraw::hide() } } } - is_painted = false; firstPaint = true; + is_painted = isPainted(); OnAfterHide(); } @@ -700,7 +716,7 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const in if (fblayer_type == CC_FBDATA_TYPES){ firstPaint = true; - is_painted = false; + is_painted = isPainted(); } } diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 47702562f..4220ec5a3 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -114,7 +114,7 @@ class CCDraw : public COSDFader, public CComponentsSignals ///status: true=component was painted for 1st time bool firstPaint; ///status: true=component was rendered - bool is_painted; +// bool is_painted; ///mode: true=activate rendering of basic elements (frame, shadow and body) bool paint_bg; ///mode: true=activate rendering of frame @@ -268,7 +268,7 @@ class CCDraw : public COSDFader, public CComponentsSignals virtual void disablePaintCache(){enablePaintCache(false);} ///returns paint mode, true=item was painted - virtual bool isPainted(){return is_painted;} + virtual bool isPainted(); ///allows paint of elementary item parts (shadow, frame and body), similar as background, set it usually to false, if item used in a form, returns true, if mode has changed, also cleans screnn buffer virtual bool doPaintBg(bool do_paint); ///allows paint frame around body, default true , NOTE: ignored if frame width = 0 diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 5bba0af59..d8b132529 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -335,7 +335,8 @@ void CComponentsForm::exchangeCCItem(CComponentsItem* item_a, CComponentsItem* i void CComponentsForm::paintForm(bool do_save_bg) { //paint body - paintInit(do_save_bg); + if (!is_painted) + paintInit(do_save_bg); //paint paintCCItems(); diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index faef78453..28953cc17 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -362,10 +362,12 @@ void CComponentsHeader::enableClock(bool enable, const char* format, const char* { cch_cl_enable = enable; cch_cl_format = format; + if (cch_cl_obj && cch_cl_enable) + cch_cl_obj->clear(); if (sec_format_str) cch_cl_sec_format = sec_format_str; cch_cl_enable_run = run; - if (!enable){ + if (!cch_cl_enable){ if (cch_cl_obj){ cch_cl_enable_run = false; removeCCItem(cch_cl_obj); @@ -544,7 +546,7 @@ void CComponentsHeader::paint(bool do_save_bg) initCCItems(); //paint form contents - paintForm(do_save_bg); + CComponentsForm::paint(do_save_bg); //start clock if enabled if (cch_cl_obj){ diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index fa4f66c5b..23aa8e290 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -107,6 +107,7 @@ bool CInfoClock::StopInfoClock() { bool ret = Stop(); kill(); + clear(); return ret; } diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index aac4cdc7e..c40439fbc 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -252,6 +252,7 @@ void CInfoViewer::initClock() } CInfoClock::getInstance()->disableInfoClock(); + clock->clear(); clock->enableColBodyGradient(gradient_top, COL_INFOBAR_PLUS_0); clock->doPaintBg(!gradient_top); clock->enableTboxSaveScreen(gradient_top); From 3ea1ed9459a4debc5389e5a0d2752936670d6816 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 24 Jan 2017 23:21:24 +0100 Subject: [PATCH 19/47] CTestMenu: fix icon container was not removed from screen Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b2f122632486d6d34f0261d5d89d6b3a4689220f Author: Thilo Graf Date: 2017-01-24 (Tue, 24 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/test_menu.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 7afb93eb4..44c9b3722 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -733,6 +733,9 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) ShowHint("Testmenu: Blink","Testmenu: Blinking image stopped ...", 700, 2); } + iconform->kill(); + delete iconform; + iconform = NULL; return res; } else if (actionKey == "window"){ From f9d4bb9fba1f7a1b0881c6b6c05666402b98a47e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 24 Jan 2017 23:23:13 +0100 Subject: [PATCH 20/47] CComponentsText: fix order of paint init Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8bd4633cb4e42c04e1eb8e6dbe89d59ab904435b Author: Thilo Graf Date: 2017-01-24 (Tue, 24 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item_text.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index 828b0033f..907264dc2 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -180,7 +180,7 @@ void CComponentsText::initCCText() //send text to CTextBox object, but force text paint text if force_text_paint option is enabled //this is managed by CTextBox object itself ct_text_sent = ct_textbox->setText(&ct_text, ct_box.iWidth, force_text_paint); - + //set current text status, needed by textChanged() if (ct_text_sent){ ct_old_text = ct_text; @@ -273,11 +273,12 @@ bool CComponentsText::setTextFromFile(const string& path_to_textfile, const int void CComponentsText::paintText(bool do_save_bg) { - paintInit(do_save_bg); initCCText(); + paintInit(do_save_bg); if (ct_text_sent && cc_allow_paint) ct_textbox->paint(); + ct_text_sent = false; } From 5011d32cd2b714ed988af0f37fab4ff9c71dcd4a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 24 Jan 2017 23:25:20 +0100 Subject: [PATCH 21/47] CCDraw: add new attribut force_paint_bg should help for some repaint actions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/384e98c089d1210e53ea160c0a59c4a0e1ad3471 Author: Thilo Graf Date: 2017-01-24 (Tue, 24 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 36 ++++++++++++++++++++-------------- src/gui/components/cc_draw.h | 4 +++- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 87cec83a1..b9035e8db 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -57,6 +57,7 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) cc_save_bg = false; firstPaint = true; is_painted = false; + force_paint_bg = false; paint_bg = true; cc_allow_paint = true; cc_enable_frame = true; @@ -546,7 +547,7 @@ void CCDraw::paintFbItems(bool do_save_bg) v_fbdata[i].is_painted = true; } } - if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && ((!is_painted || !fbdata.is_painted)|| shadow_force)) { + if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && ((!is_painted || !fbdata.is_painted)|| shadow_force || force_paint_bg)) { if (fbdata.enabled) { /* here we paint the shadow around the body * on 1st step we check for already cached screen buffer, if true @@ -637,23 +638,28 @@ void CCDraw::paintFbItems(bool do_save_bg) } //set is_painted attribut. if any layer was painted set it to true; - is_painted = isPainted(); + if (force_paint_bg){ + is_painted = false; + }else{ + for(size_t i=0; i< v_fbdata.size(); i++){ + if (v_fbdata[i].is_painted){ + is_painted = true; + break; + } + } + } + + //reset is painted ignore flag to default value + force_paint_bg = false; //pick up signal if filled OnAfterPaintLayers(); } - bool CCDraw::isPainted() - { - if (firstPaint) - return false; - - for(size_t i=0; i< v_fbdata.size(); i++) - if (v_fbdata[i].is_painted) - return true; - - return false; - } +bool CCDraw::isPainted() +{ + return is_painted; +} void CCDraw::hide() { @@ -670,7 +676,7 @@ void CCDraw::hide() } } firstPaint = true; - is_painted = isPainted(); + is_painted = false; OnAfterHide(); } @@ -716,7 +722,7 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const in if (fblayer_type == CC_FBDATA_TYPES){ firstPaint = true; - is_painted = isPainted(); + is_painted = false; } } diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 4220ec5a3..a7d442e86 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -114,7 +114,9 @@ class CCDraw : public COSDFader, public CComponentsSignals ///status: true=component was painted for 1st time bool firstPaint; ///status: true=component was rendered -// bool is_painted; + bool is_painted; + ///status: true= value is_painted would be ignored + bool force_paint_bg; ///mode: true=activate rendering of basic elements (frame, shadow and body) bool paint_bg; ///mode: true=activate rendering of frame From 7550c7276cbefa8b078360385c902fe768e82668 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 24 Jan 2017 23:27:44 +0100 Subject: [PATCH 22/47] CComponentsForm: add some usefull slots/signal to help paint backgrounds Requried to paint form items only on changed contents and on repaint Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5c8aa90e01266d220df5400b0d9f2b668be8466f Author: Thilo Graf Date: 2017-01-24 (Tue, 24 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 36 +++++++++++++++------------- src/gui/components/cc_frm.h | 5 ++++ src/gui/components/cc_frm_clock.cpp | 19 +++++++-------- src/gui/components/cc_frm_clock.h | 5 ---- src/gui/components/cc_frm_header.cpp | 15 ++++++++++-- 5 files changed, 46 insertions(+), 34 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index d8b132529..049f6ca45 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -335,7 +335,7 @@ void CComponentsForm::exchangeCCItem(CComponentsItem* item_a, CComponentsItem* i void CComponentsForm::paintForm(bool do_save_bg) { //paint body - if (!is_painted) + if (!is_painted || force_paint_bg) paintInit(do_save_bg); //paint @@ -520,23 +520,7 @@ void CComponentsForm::paintCCItems() cc_item->allowPaint(item_visible); } } -#if 0 -void CComponentsForm::hide() -{ - // hack: ensure hiding of minitv during hide of forms and inherited classes, - // because the handling of minitv items are different to other item types - // and need an explizit call of hide() - for(size_t i=0; igetItemType() == CC_ITEMTYPE_PIP){ - v_cc_items[i]->kill(); - break; - } - } - //hide body - CComponents::hide(); -} -#endif //erase or paint over rendered objects void CComponentsForm::killCCItems(const fb_pixel_t& bg_color, bool ignore_parent) { @@ -693,3 +677,21 @@ bool CComponentsForm::enableColBodyGradient(const int& enable_mode, const fb_pix } return false; } + +void CComponentsForm::forceItemsPaint(bool force) +{ + dprintf(DEBUG_NORMAL, "\033[33m[CComponentsForm] [%s - %d] try to detect items [%u] with possible required background repaint \033[0m\n", __func__, __LINE__, v_cc_items.size()); + for (size_t i = 0; i < v_cc_items.size(); i++){ + dprintf(DEBUG_NORMAL, "\033[33m[CComponentsForm] [%s - %d] found item type = [%d] \033[0m\n", __func__, __LINE__, v_cc_items[i]->getItemType()); + if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_TEXT){ + CComponentsText* text = static_cast (v_cc_items[i]); + text->forceTextPaint(force); + dprintf(DEBUG_NORMAL, "\033[33m[CComponentsForm] [%s - %d] force repaint of item type CC_ITEMTYPE_TEXT [%u] content [%s]\033[0m\n", __func__, __LINE__, i, text->getText().c_str()); + } + if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_LABEL){ + CComponentsLabel* label = static_cast (v_cc_items[i]); + label ->forceTextPaint(force); + dprintf(DEBUG_NORMAL, "\033[33m[CComponentsForm] [%s - %d] force repaint of item type CC_ITEMTYPE_LABEL [%u] content [%s]\033[0m\n", __func__, __LINE__, i, label->getText().c_str()); + } + } +} diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 44f6b481e..56ad077c6 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -65,6 +65,11 @@ class CComponentsForm : public CComponentsItem const fb_pixel_t& color_body, const fb_pixel_t& color_shadow); + ///force repaint of all possible text items + void forceItemsPaint(bool force); + ///slot for background paint event, reserved for forceItemsPaint() + sigc::slot0 sl_repaint; + public: CComponentsForm( const int x_pos = 0, const int y_pos = 0, const int w = 800, const int h = 600, CComponentsForm *parent = NULL, diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index ff5a7c9be..c3995318d 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -101,7 +101,7 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, cl_sl_show = sigc::mem_fun0(*this, &CComponentsFrmClock::ShowTime); //init slot to ensure paint segments after painted background - cl_sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsFrmClock::forceSegemnentsPaint), true); + sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsFrmClock::forceItemsPaint), true); //run clock already if required if (activ) @@ -301,10 +301,10 @@ void CComponentsFrmClock::initCCLockItems() v_cc_items[i]->setPos(x_lbl, y_lbl); } + if(!OnAfterPaintBg.empty()) + OnAfterPaintBg.clear(); //init slot to handle repaint of segments if background was repainted - OnAfterPaintBg.clear(); - if (paint_bg) - OnAfterPaintBg.connect(cl_sl_repaint); + OnAfterPaintBg.connect(sl_repaint); } @@ -330,6 +330,7 @@ bool CComponentsFrmClock::startClock() if (cl_timer->OnTimer.empty()){ dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); cl_timer->OnTimer.connect(cl_sl_show); + force_paint_bg = true; } } cl_timer->setTimerInterval(cl_interval); @@ -381,8 +382,12 @@ void CComponentsFrmClock::paint(bool do_save_bg) //prepare items before paint initCCLockItems(); + if (!is_painted) + force_paint_bg = false; + //paint form contents CComponentsForm::paint(do_save_bg); + } void CComponentsFrmClock::setClockFont(Font *font, const int& style) @@ -455,9 +460,3 @@ bool CComponentsFrmClock::enableColBodyGradient(const int& enable_mode, const fb } return false; } - -void CComponentsFrmClock::forceSegemnentsPaint(bool force) -{ - for (size_t i = 0; i < v_cc_items.size(); i++) - static_cast (v_cc_items[i])->forceTextPaint(force); -} diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index 89ed33e91..22da0af26 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -54,9 +54,6 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen ///slot for timer event, reserved for ShowTime() sigc::slot0 cl_sl_show; - ///slot for background paint event, reserved for initCCLockItems() - sigc::slot0 cl_sl_repaint; - ///refresh interval in seconds int cl_interval; @@ -93,8 +90,6 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen void toggleFormat(); ///init internal font void initClockFont(int dx, int dy); - ///force repaint of all segments - void forceSegemnentsPaint(bool force); public: diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 28953cc17..c4ce04d37 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -30,6 +30,9 @@ #include #include "cc_frm_header.h" #include + +#include + using namespace std; //------------------------------------------------------------------------------------------------------- @@ -133,6 +136,9 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_cl_sec_format = cch_cl_format; cch_cl_enable_run = false; + //init slot to ensure paint segments after painted background + sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsHeader::forceItemsPaint), true); + addContextButton(buttons); initCCItems(); initParent(parent); @@ -517,6 +523,11 @@ void CComponentsHeader::initCaption() */ //height = max(height, cch_text_obj->getHeight()); } + + if(!OnAfterPaintBg.empty()) + OnAfterPaintBg.clear(); + //init slot to handle repaint of text if background was repainted + OnAfterPaintBg.connect(sl_repaint); } void CComponentsHeader::initCCItems() @@ -539,12 +550,12 @@ void CComponentsHeader::initCCItems() //init text initCaption(); } - + void CComponentsHeader::paint(bool do_save_bg) { //prepare items initCCItems(); - + //paint form contents CComponentsForm::paint(do_save_bg); From 0b8b8c8fb3ee5a3fe42ff73233ba791db6e29c6e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 23 Jan 2017 20:37:47 +0100 Subject: [PATCH 23/47] CComponentsExtTextForm: init with gradient support and sl_repaint slot Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cbeecab801bc7398f7f22000821d606322a571f3 Author: Thilo Graf Date: 2017-01-23 (Mon, 23 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_ext_text.cpp | 69 +++++++++++++++----------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 645410ead..3abf816f4 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -29,6 +29,8 @@ #include #include "cc_frm_ext_text.h" +#include + #define DEF_HEIGHT 27 #define DEF_LABEL_WIDTH_PERCENT 30 @@ -112,56 +114,60 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p } ccx_label_align = ccx_text_align = CTextBox::NO_AUTO_LINEBREAK; + //init slot to ensure paint text items after painted background + sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsExtTextForm::forceItemsPaint), true); + initParent(parent); } void CComponentsExtTextForm::initLabel() { - //initialize label object if (ccx_label_obj == NULL){ - ccx_label_obj = new CComponentsLabel(); - ccx_label_obj->doPaintBg(!cc_txt_save_screen); - ccx_label_obj->doPaintTextBoxBg(false); - ccx_label_obj->enableTboxSaveScreen(cc_txt_save_screen); - } + //create ccx_label_obj and add to collection + ccx_label_obj = new CComponentsLabel(this); + ccx_label_obj->doPaintBg(false); + } - //add label object - if (!ccx_label_obj->isAdded()) - addCCItem(ccx_label_obj); - - //set properties + //set label properties if (ccx_label_obj){ - ccx_label_width = (ccx_percent_label_w * width/100); + //assign general properties y_text = height/2 - height-2*fr_thickness; - ccx_label_obj->setText(ccx_label_text, ccx_label_align, ccx_font); - ccx_label_obj->setTextColor(ccx_label_color); ccx_label_obj->setDimensionsAll(0, y_text, ccx_label_width-2*fr_thickness, height-2*fr_thickness); - ccx_label_obj->setCorner(this->corner_rad, CORNER_LEFT); + ccx_label_obj->setColorBody(col_body); + if (cc_body_gradient_enable != cc_body_gradient_enable_old) + ccx_label_obj->getCTextBoxObject()->clearScreenBuffer(); + ccx_label_obj->setTextColor(ccx_label_color); + ccx_label_obj->setText(ccx_label_text, ccx_label_align, ccx_font); + ccx_label_obj->enableTboxSaveScreen(cc_body_gradient_enable || cc_txt_save_screen); + + //corner of label item + ccx_label_obj->setCorner(corner_rad-fr_thickness, CORNER_LEFT); } } void CComponentsExtTextForm::initText() { - //initialize text object + //set text properties if (ccx_text_obj == NULL){ - ccx_text_obj = new CComponentsText(); - ccx_text_obj->doPaintBg(!cc_txt_save_screen); - ccx_text_obj->doPaintTextBoxBg(false); - ccx_text_obj->enableTboxSaveScreen(cc_txt_save_screen); + //create ccx_text_obj and add to collection + ccx_text_obj = new CComponentsText(this); + ccx_text_obj->doPaintBg(false); } - //add text object - if (!ccx_text_obj->isAdded()) - addCCItem(ccx_text_obj); - - //set properties if (ccx_text_obj){ - ccx_text_width = width-ccx_label_obj->getWidth(); - ccx_text_obj->setText(ccx_text, ccx_text_align, ccx_font); - ccx_text_obj->setTextColor(ccx_text_color); + //assign general properties + y_text = height/2 - height-2*fr_thickness; ccx_text_obj->setDimensionsAll(ccx_label_obj->getWidth(), y_text, ccx_text_width-2*fr_thickness, height-2*fr_thickness); - ccx_text_obj->setCorner(this->corner_rad, CORNER_RIGHT); + ccx_text_obj->setColorBody(col_body); + if (cc_body_gradient_enable != cc_body_gradient_enable_old) + ccx_text_obj->getCTextBoxObject()->clearScreenBuffer(); + ccx_text_obj->setTextColor(ccx_text_color); + ccx_text_obj->setText(ccx_text, ccx_text_align, ccx_font);; + ccx_text_obj->enableTboxSaveScreen(cc_body_gradient_enable || cc_txt_save_screen); + + //corner of text item + ccx_text_obj->setCorner(corner_rad-fr_thickness, CORNER_RIGHT); } } @@ -216,6 +222,11 @@ void CComponentsExtTextForm::initCCTextItems() { initLabel(); initText(); + + if(!OnAfterPaintBg.empty()) + OnAfterPaintBg.clear(); + //init slot to handle repaint of text if background was repainted + OnAfterPaintBg.connect(sl_repaint); } void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val) From a5c16f0042202f54bb388385ea54f2e89d8d3d72 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 23 Jan 2017 21:27:10 +0100 Subject: [PATCH 24/47] CComponentsText: add explicit kill methode and add ct_force_text_paint After hide or kill text will does not paint without ct_force_text_paint, so it is required to add this. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4c71edbd3c6dcdf72b9957a92164a59d5137e9a2 Author: Thilo Graf Date: 2017-01-23 (Mon, 23 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_item_text.cpp | 19 ++++++++++++++++--- src/gui/components/cc_item_text.h | 2 ++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index 907264dc2..bd37e0d37 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -274,7 +274,8 @@ bool CComponentsText::setTextFromFile(const string& path_to_textfile, const int void CComponentsText::paintText(bool do_save_bg) { initCCText(); - paintInit(do_save_bg); + if (!is_painted) + paintInit(do_save_bg); if (ct_text_sent && cc_allow_paint) ct_textbox->paint(); @@ -291,8 +292,20 @@ void CComponentsText::hide() { if (ct_textbox) ct_textbox->hide(); - ct_old_text = ""; - CComponents::hide(); + + ct_old_text.clear(); + CCDraw::hide(); + ct_force_text_paint = true; +} + +void CComponentsText::kill() +{ + if (ct_textbox) + ct_textbox->hide(); + + ct_old_text.clear(); + CCDraw::kill(); + ct_force_text_paint = true; } void CComponentsText::setXPos(const int& xpos) diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index a8105e1a0..f744efba2 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -138,6 +138,8 @@ class CComponentsText : public CCTextScreen, public CComponentsItem ///default members to paint a text box and hide painted text ///hide textbox void hide(); + ///remove textbox from screen + void kill(); ///paint text box, parameter do_save_bg: default = true, causes fill of backckrond pixel buffer void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); From 1eb76c353ddad414915ac6ca7155d9a9bc341433 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 23 Jan 2017 21:28:54 +0100 Subject: [PATCH 25/47] CInfoViewer: enable kill text items after killed title This causes repaint text on next view of infobar. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0de94903267897e0cd3b6215d4e8bd34a1d2741f Author: Thilo Graf Date: 2017-01-23 (Mon, 23 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index c40439fbc..9ac8c16b8 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -2169,7 +2169,7 @@ void CInfoViewer::killTitle() clock->kill(); #endif body->kill(); -#if 0 //not really required to kill epg infos, body does this + if (txt_cur_event) txt_cur_event->kill(); if (txt_cur_event_rest) @@ -2182,7 +2182,7 @@ void CInfoViewer::killTitle() txt_next_event->kill(); if (txt_next_in) txt_next_in->kill(); -#endif + if (timescale) if (g_settings.infobar_progressbar == SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_DEFAULT) timescale->kill(); From c900f84634037570b5b54f846faa95a175ac2849 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 23 Jan 2017 22:52:00 +0100 Subject: [PATCH 26/47] CImageInfo: prevent possible overpainting while switching of sub text caption Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5d1bcbd33f1211f3adb4108cf59fe668c03052ad Author: Thilo Graf Date: 2017-01-23 (Mon, 23 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 6f946a3ab..017205bc7 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -169,7 +169,8 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) btn_red->setCaption(new_btn_cap); //paint items - cc_sub_caption->paint(false); + cc_sub_caption->hide(); + cc_sub_caption->paint(); cc_lic->paint(false); btn_red->kill(); btn_red->paint(false); From 39befc83d75b8b99b3e11b1b033365688e54f020 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 24 Jan 2017 15:57:12 +0100 Subject: [PATCH 27/47] CComponentsForm: remove debug spam Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/31146bd9af796f51f74c7f1f1c7e524747121787 Author: Thilo Graf Date: 2017-01-24 (Tue, 24 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 049f6ca45..626fdff67 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -680,18 +680,17 @@ bool CComponentsForm::enableColBodyGradient(const int& enable_mode, const fb_pix void CComponentsForm::forceItemsPaint(bool force) { - dprintf(DEBUG_NORMAL, "\033[33m[CComponentsForm] [%s - %d] try to detect items [%u] with possible required background repaint \033[0m\n", __func__, __LINE__, v_cc_items.size()); for (size_t i = 0; i < v_cc_items.size(); i++){ - dprintf(DEBUG_NORMAL, "\033[33m[CComponentsForm] [%s - %d] found item type = [%d] \033[0m\n", __func__, __LINE__, v_cc_items[i]->getItemType()); + dprintf(DEBUG_DEBUG, "\033[33m[CComponentsForm] [%s - %d] found item type = [%d] \033[0m\n", __func__, __LINE__, v_cc_items[i]->getItemType()); if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_TEXT){ CComponentsText* text = static_cast (v_cc_items[i]); text->forceTextPaint(force); - dprintf(DEBUG_NORMAL, "\033[33m[CComponentsForm] [%s - %d] force repaint of item type CC_ITEMTYPE_TEXT [%u] content [%s]\033[0m\n", __func__, __LINE__, i, text->getText().c_str()); + dprintf(DEBUG_DEBUG, "\033[33m[CComponentsForm] [%s - %d] force repaint of item type CC_ITEMTYPE_TEXT [%u] content [%s]\033[0m\n", __func__, __LINE__, i, text->getText().c_str()); } if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_LABEL){ CComponentsLabel* label = static_cast (v_cc_items[i]); label ->forceTextPaint(force); - dprintf(DEBUG_NORMAL, "\033[33m[CComponentsForm] [%s - %d] force repaint of item type CC_ITEMTYPE_LABEL [%u] content [%s]\033[0m\n", __func__, __LINE__, i, label->getText().c_str()); + dprintf(DEBUG_DEBUG, "\033[33m[CComponentsForm] [%s - %d] force repaint of item type CC_ITEMTYPE_LABEL [%u] content [%s]\033[0m\n", __func__, __LINE__, i, label->getText().c_str()); } } } From 1c286a20ad28f829875874e4f9ebb9a64602e1b9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 24 Jan 2017 22:14:15 +0100 Subject: [PATCH 28/47] CEventList: fix current channel position and ensure clean up header Current channel name was out of center and a clean up of header background was required because texts are only painted with transparent background and old texts are futher visible. Now we have a clean background before repaint logo or new channel names. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/17a84f0e75d315d4acc81e815e1fd9efe484354f Author: Thilo Graf Date: 2017-01-24 (Tue, 24 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 741ec77fd..76c771559 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -877,7 +877,9 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s } else { header->removeCCItem(midLogo); //remove/destroy logo object, if it is not available - CComponentsText *midText = new CComponentsText(CC_CENTERED, CC_CENTERED, mid_width, theight, _channelname, CTextBox::CENTER, g_Font[font_mid], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + int w_midText = g_Font[font_mid]->getRenderWidth(_channelname); + CComponentsText *midText = new CComponentsText(0, CC_CENTERED, w_midText, theight, _channelname, CTextBox::CENTER, g_Font[font_mid], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + midText->setXPos(full_width/2 - midText->getWidth()/2); midText->doPaintBg(false); } @@ -892,6 +894,8 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s rText->doPaintBg(false); } + if (header->isPainted()) //clean up background of header for new captions + header->kill(header->getColorBody()); header->paint(CC_SAVE_SCREEN_NO); } From 159c7c57fff4020df09baaae106e57bcfc21d719 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 24 Jan 2017 22:56:18 +0100 Subject: [PATCH 29/47] CComponentsHeader: add missing paramters to kill methode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ba9284fba7979b5925772aaf99c073c7bf1357f7 Author: Thilo Graf Date: 2017-01-24 (Tue, 24 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_header.cpp | 11 +++++++++++ src/gui/components/cc_frm_header.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index c4ce04d37..4c21bd560 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -577,3 +577,14 @@ bool CComponentsHeader::enableColBodyGradient(const int& enable_mode, const fb_p return CComponentsForm::enableColBodyGradient(enable_mode, sec_color, dir); } +void CComponentsHeader::kill(const fb_pixel_t& bg_color, const int& corner_radius, const int& fblayer_type /*fbdata_type*/, bool disable_clock) +{ + if (disable_clock) + disableClock(); + + int rad = corner_radius; + if (corner_radius == -1) + rad = corner_rad; + + CComponentsForm::kill(bg_color, rad, fblayer_type); +} diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index df444ee7a..7f75f2fd7 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -269,7 +269,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen ///hides item, arg: no_restore see hideCCItem() void hide(){disableClock(); CComponents::hide();} ///erase current screen without restore of background, it's similar to paintBackgroundBoxRel() from CFrameBuffer - virtual void kill(){disableClock(); CComponentsForm::kill();} + void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1, const int& fblayer_type = CC_FBDATA_TYPES, bool disable_clock = true); ///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*/, const int& direction = -1); From 339167a5077406f688be07543decf183c2c889a3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 24 Jan 2017 22:57:54 +0100 Subject: [PATCH 30/47] CChannelList: ensure repaint of new header content Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ea700ddf525a0293c94c68bf084be426544dc34a Author: Thilo Graf Date: 2017-01-24 (Tue, 24 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index e463c458f..1f7ffbb7d 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2168,7 +2168,9 @@ void CChannelList::paintHead() else logo_off = 10; - 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) + if (header->isPainted()) //clean up background of header for new contents + header->kill(header->getColorBody(), -1, CC_FBDATA_TYPES, false); + header->paint0(); } CComponentsHeader* CChannelList::getHeaderObject() From 1d472ccf0269503db1b1609b349e4f82d22f56b1 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 25 Jan 2017 08:50:54 +0100 Subject: [PATCH 31/47] CInfoViewer: Use flag Font::FULLBG for RenderString() dependent on g_settings.theme.infobar_gradient_* Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a7ef709e559b9bd9fb206005c276c1b96813b307 Author: Michael Liebmann Date: 2017-01-25 (Wed, 25 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 9ac8c16b8..da61e5cea 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -601,11 +601,12 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe if (!zap_mode) infoViewerBB->paintshowButtonBar(); + int renderFlag = ((g_settings.theme.infobar_gradient_top) ? Font::FULLBG : 0) | Font::IS_UTF8; int ChannelLogoMode = 0; if (g_settings.infobar_show_channellogo > 1) ChannelLogoMode = showChannelLogo(current_channel_id, 0); if (ChannelLogoMode == 0 || ChannelLogoMode == 3 || ChannelLogoMode == 4) - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(ChanNameX + 10 , ChanNameY + header_height,BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 10 ,ChannelName, COL_INFOBAR_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(ChanNameX + 10 , ChanNameY + header_height,BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 10 ,ChannelName, COL_INFOBAR_TEXT, 0, renderFlag); // show_Data if (CMoviePlayerGui::getInstance().file_prozent > 100) @@ -661,7 +662,7 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe if (speed) { int sh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); int sy = BoxStartY + ChanHeight/2 - sh/2 + sh; - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(icon_x, sy, ChanHeight, runningRest, COL_INFOBAR_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(icon_x, sy, ChanHeight, runningRest, COL_INFOBAR_TEXT, 0, renderFlag); icon_x += speedw; } frameBuffer->paintIcon(playicon, icon_x, icon_y); @@ -706,6 +707,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap { if(!calledFromNumZap && !(zap_mode & IV_MODE_DEFAULT)) resetSwitchMode(); + int renderFlag = ((g_settings.theme.infobar_gradient_top) ? Font::FULLBG : 0) | Font::IS_UTF8; std::string Channel = channel->getName(); t_satellite_position satellitePosition = channel->getSatellitePosition(); @@ -816,7 +818,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap } } int h_sfont = g_SignalFont->getHeight(); - g_SignalFont->RenderString (BoxStartX + numbox_offset + ((ChanWidth - satNameWidth) / 2) , numbox->getYPos() + h_sfont, satNameWidth, satname_tmp, COL_INFOBAR_TEXT); + g_SignalFont->RenderString (BoxStartX + numbox_offset + ((ChanWidth - satNameWidth) / 2) , numbox->getYPos() + h_sfont, satNameWidth, satname_tmp, COL_INFOBAR_TEXT, 0, renderFlag); } /* TODO: the logic will get much easier once we decouple channellogo and signal bars */ @@ -835,14 +837,14 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap y_tmp, ChanWidth - 2*numbox_offset, strChanNum, - col_NumBoxText); + col_NumBoxText, 0, renderFlag); } if (ChannelLogoMode == 1 || ( g_settings.infobar_show_channellogo == 3 && !logo_ok) || g_settings.infobar_show_channellogo == 6 ) /* channel number besides channel name */ { ChanNumWidth = 5 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (strChanNum); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString( ChanNameX + 5, ChanNameY + header_height, - ChanNumWidth, strChanNum, col_NumBoxText); + ChanNumWidth, strChanNum, col_NumBoxText, 0, renderFlag); } } @@ -854,7 +856,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString( ChanNameX + 10 + ChanNumWidth, ChanNameY + header_height, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 10 - ChanNumWidth, - ChannelName, color /*COL_INFOBAR_TEXT*/); + ChannelName, color /*COL_INFOBAR_TEXT*/, 0, renderFlag); //provider name if(g_settings.infobar_show_channeldesc && channel->pname){ std::string prov_name = channel->pname; @@ -871,7 +873,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString( ChanNameX + 10 + ChanNumWidth + chname_width, tmpY, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 10 - ChanNumWidth - chname_width, - prov_name, color /*COL_INFOBAR_TEXT*/); + prov_name, color /*COL_INFOBAR_TEXT*/, 0, renderFlag); } } @@ -1635,6 +1637,7 @@ void CInfoViewer::showSNR () { if (! is_visible) return; + int renderFlag = ((g_settings.theme.infobar_gradient_top) ? Font::FULLBG : 0) | Font::IS_UTF8; /* right now, infobar_show_channellogo == 3 is the trigger for signal bars etc. TODO: decouple this */ if (!fileplay && !IS_WEBTV(current_channel_id) && ( g_settings.infobar_show_channellogo == 3 || g_settings.infobar_show_channellogo == 5 || g_settings.infobar_show_channellogo == 6 )) { @@ -1657,7 +1660,7 @@ void CInfoViewer::showSNR () int freqWidth = g_SignalFont->getRenderWidth(freq); if (freqWidth > (ChanWidth - numbox_offset*2)) freqWidth = ChanWidth - numbox_offset*2; - g_SignalFont->RenderString(BoxStartX + numbox_offset + ((ChanWidth - freqWidth) / 2), y_numbox + y_freq - 3, ChanWidth - 2*numbox_offset, freq, SDT_freq_update ? COL_COLORED_EVENTS_TEXT:COL_INFOBAR_TEXT); + g_SignalFont->RenderString(BoxStartX + numbox_offset + ((ChanWidth - freqWidth) / 2), y_numbox + y_freq - 3, ChanWidth - 2*numbox_offset, freq, SDT_freq_update ? COL_COLORED_EVENTS_TEXT:COL_INFOBAR_TEXT, 0, renderFlag); SDT_freq_update = false; } if (sigbox == NULL){ From 1de4cfa9c5e5ad66cdbb177b23a74c40a25f86ff Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 26 Jan 2017 18:16:27 +0100 Subject: [PATCH 32/47] configure.ac: Check freetype version >= 2.5.0 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/86c3b08533a683e00d4f99b4c52f2432036d90f8 Author: Michael Liebmann Date: 2017-01-26 (Thu, 26 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/configure.ac b/configure.ac index 4b729fadf..5d88ff9f7 100644 --- a/configure.ac +++ b/configure.ac @@ -91,6 +91,19 @@ AM_CONDITIONAL(USE_TREMOR, test "$TREMOR" = "yes") # TUXBOX_APPS_LIB_PKGCONFIG(OPENSSL,openssl) TUXBOX_APPS_LIB_PKGCONFIG(CURL,libcurl) TUXBOX_APPS_LIB_PKGCONFIG(FREETYPE,freetype2) +CPPFLAGS+=" $(freetype-config --cflags)" +AC_MSG_CHECKING([whether FreeType version is 2.5.0 or higher]) + AC_TRY_CPP([ + #include + #include FT_FREETYPE_H + #if FREETYPE_MAJOR < 2 || (FREETYPE_MAJOR == 2 && FREETYPE_MINOR < 5) + #error Freetype version too low. + #endif + ], + [AC_MSG_RESULT(yes)], + [AC_MSG_ERROR([Need FreeType library version 2.5.0 or higher]) + ]) + # fallback to curl-config (which is ugly for cross-compilation) if test -z "$CURL_LIBS" -a -z "$CURL_CFLAGS"; then TUXBOX_APPS_LIB_CONFIG(CURL,curl-config) From 3cf53d47e6b34eab2ad6ba9dd4183de4bd2ee4fd Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 27 Jan 2017 10:47:30 +0100 Subject: [PATCH 33/47] CVolumeBar: Enable background paint for digits Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e74f24a658a4c81df691c8dba00198eb7f92a25e Author: Michael Liebmann Date: 2017-01-27 (Fri, 27 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/volumebar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 58a41f7d9..5f597aeac 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -214,6 +214,7 @@ void CVolumeBar::initVolumeBarDigit() vb_digit->setDimensionsAll(vb_digit_x, 0, vb_digit_w, height); vb_digit->setTextColor(COL_MENUCONTENT_TEXT); vb_digit->setCorner(cornerRad(), CORNER_RIGHT); + vb_digit->doPaintTextBoxBg(true); initVolumeBarDigitValue(); //add digit label to container From 6b39f273839bb4ff0b9468635c0304d224e4fb68 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 27 Jan 2017 15:49:59 +0100 Subject: [PATCH 34/47] CComponentsText: add missing parameters to kill() methode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f219da23bf5f1ee23a3ef3677d71cd074fb4cbed Author: Thilo Graf Date: 2017-01-27 (Fri, 27 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item_text.cpp | 5 +++-- src/gui/components/cc_item_text.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index bd37e0d37..3c1b61e13 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -298,13 +298,14 @@ void CComponentsText::hide() ct_force_text_paint = true; } -void CComponentsText::kill() +void CComponentsText::kill(const fb_pixel_t& bg_color, const int& corner_radius, const int& fblayer_type) { if (ct_textbox) ct_textbox->hide(); ct_old_text.clear(); - CCDraw::kill(); + force_paint_bg = true; + CCDraw::kill(bg_color, corner_radius, fblayer_type); ct_force_text_paint = true; } diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index f744efba2..1de07d08c 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -139,7 +139,7 @@ class CComponentsText : public CCTextScreen, public CComponentsItem ///hide textbox void hide(); ///remove textbox from screen - void kill(); + void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1, const int& fblayer_type = CC_FBDATA_TYPES); ///paint text box, parameter do_save_bg: default = true, causes fill of backckrond pixel buffer void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); From 0ee904135abcd4807674112bd8fcaac3cf7781d8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 27 Jan 2017 14:50:22 +0100 Subject: [PATCH 35/47] CComponentsText: add signal OnBeforePaint into text paint() methode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/53f956c0f9dcfd2593ab564e0947e6fe1dee0176 Author: Thilo Graf Date: 2017-01-27 (Fri, 27 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item_text.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index 3c1b61e13..67ee50401 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -285,6 +285,7 @@ void CComponentsText::paintText(bool do_save_bg) void CComponentsText::paint(bool do_save_bg) { + OnBeforePaint(); paintText(do_save_bg); } From 8e8ff02d6dabe1fa94f2d3d9090e3d535c7e8867 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 27 Jan 2017 20:30:05 +0100 Subject: [PATCH 36/47] CMenuWidget: add missing hide() for details line Details_line was not removed in all constellations when menu was closed. Sample: open main menue and select an entry with connect-line, eg. plugins, press key to come into submenu, then go back to main menue and close menu with home key, result: it's possible that line is still on screen. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/76008371ffad9c3fd6d71a732726c96edc02d431 Author: Thilo Graf Date: 2017-01-27 (Fri, 27 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 8e148aea7..cb83c00f5 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1075,6 +1075,8 @@ void CMenuWidget::hide() header->kill(); if (info_box) info_box->kill(); + if (details_line) + details_line->hide(); frameBuffer->paintBackgroundBoxRel(x, y, full_width, full_height + fbutton_height); //paintHint(-1); } From a0e5aa2eda85d182a2990ecacd4cb94017cad4e9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 28 Jan 2017 21:16:34 +0100 Subject: [PATCH 37/47] CVolumeBar: don't use digit height height is wrong and calculations for digit positions could be confused Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4d2dd415c1123a49ae35ddc8edd2ee1798a20d69 Author: Thilo Graf Date: 2017-01-28 (Sat, 28 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/volumebar.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 5f597aeac..69d54b269 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -224,11 +224,6 @@ void CVolumeBar::initVolumeBarDigit() //refresh and paint digit void CVolumeBar::paintVolumeBarDigit() { - // digits - CTextBox* ctb = vb_digit->getCTextBoxObject(); - if (ctb) - ctb->setFontUseDigitHeight(); - // paint digit vb_digit->paint(CC_SAVE_SCREEN_NO); } From 0e3e32fd2c96bcc5279c43ad0a7496ad8dc0e7c1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 28 Jan 2017 23:06:47 +0100 Subject: [PATCH 38/47] CVolumeBar: use CORNER_RADIUS_MID cornerRad() is not really the best solution. Inner items are fit with full height and should use the same value. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3f0b81f0a70675f2a52a68dd06f96d790c2f65be Author: Thilo Graf Date: 2017-01-28 (Sat, 28 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/volumebar.cpp | 8 ++++---- src/gui/volumebar.h | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 69d54b269..c18d3737e 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -50,7 +50,7 @@ CVolumeBar::CVolumeBar() void CVolumeBar::initVarVolumeBar() { col_body = COL_MENUCONTENT_PLUS_0; - + corner_rad = CORNER_RADIUS_MID; vb_item_offset = 4; height = g_settings.volume_size; //default height @@ -87,7 +87,7 @@ void CVolumeBar::initVolumeBarSize() cvh->getDimensions(&x, &y, &sw, &sh, &vb_icon_w, &vb_digit_w); cvh->getVolBarDimensions(&y, &height); - vb_digit_w += cornerRad()/2; + //vb_digit_w += corner_rad/2; //scale vb_pbw = 200; @@ -180,7 +180,7 @@ void CVolumeBar::initVolumeBarIcon() vb_icon = new CComponentsPicture(vb_icon_x, CC_CENTERED, vb_icon_w, height, NEUTRINO_ICON_VOLUME); vb_icon->setColorBody(col_body); - vb_icon->setCorner(cornerRad(), CORNER_LEFT); + vb_icon->setCorner(corner_rad, CORNER_LEFT); //add icon to container addCCItem(vb_icon); @@ -213,7 +213,7 @@ void CVolumeBar::initVolumeBarDigit() vb_digit->setDimensionsAll(vb_digit_x, 0, vb_digit_w, height); vb_digit->setTextColor(COL_MENUCONTENT_TEXT); - vb_digit->setCorner(cornerRad(), CORNER_RIGHT); + vb_digit->setCorner(corner_rad, CORNER_RIGHT); vb_digit->doPaintTextBoxBg(true); initVolumeBarDigitValue(); diff --git a/src/gui/volumebar.h b/src/gui/volumebar.h index 62ce4d90c..9989eded3 100644 --- a/src/gui/volumebar.h +++ b/src/gui/volumebar.h @@ -72,9 +72,6 @@ class CVolumeBar : public CComponentsForm void paintVolScale(); void paintVolumeBarDigit(); -// inline int cornerRad() { return (g_settings.rounded_corners) ? height/2 : 0; } - inline int cornerRad() { return (g_settings.rounded_corners) ? CORNER_RADIUS_SMALL : 0; } - public: enum From be5e1438ce84c15c012ac23beae32f0ff2b35c92 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 29 Jan 2017 19:43:14 +0100 Subject: [PATCH 39/47] CVolumeBar: use OFFSET_INNER_SMALL instead static value for item offset Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7de2fbe881a0ba4c28d143f20fe82a726824f967 Author: Thilo Graf Date: 2017-01-29 (Sun, 29 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/volumebar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index c18d3737e..a69e7dd53 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -51,7 +51,7 @@ void CVolumeBar::initVarVolumeBar() { col_body = COL_MENUCONTENT_PLUS_0; corner_rad = CORNER_RADIUS_MID; - vb_item_offset = 4; + vb_item_offset = OFFSET_INNER_SMALL; height = g_settings.volume_size; //default height //assume volume value as pointer to global setting @@ -94,7 +94,7 @@ void CVolumeBar::initVolumeBarSize() vb_pbh = height-4*vb_item_offset; //result for width - width = (vb_icon_w + vb_pbw + vb_digit_w) + 4*vb_item_offset; + width = (vb_icon_w + vb_pbw + vb_digit_w) + 4*vb_item_offset + corner_rad/2; //adapt x-pos vb_pbx = vb_item_offset + vb_icon_w + vb_item_offset; From 204b499a8061db8d52d8e4b7e1d0bdf96b091d12 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 29 Jan 2017 20:24:50 +0100 Subject: [PATCH 40/47] CVolumeBar: add missing paint() methode, avoid multiple iitem instances Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/58c65b1a7ef39191e94546b014ffc2ec31f0c13a Author: Thilo Graf Date: 2017-01-29 (Sun, 29 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/volumebar.cpp | 39 ++++++++++++++++++++++++++------------- src/gui/volumebar.h | 1 + 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index a69e7dd53..be6e5a3cb 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -177,48 +177,49 @@ void CVolumeBar::initVolumeBarItems() //init current icon object void CVolumeBar::initVolumeBarIcon() { - vb_icon = new CComponentsPicture(vb_icon_x, CC_CENTERED, vb_icon_w, height, NEUTRINO_ICON_VOLUME); + if (!vb_icon){ + vb_icon = new CComponentsPicture(vb_icon_x, CC_CENTERED, vb_icon_w, height, NEUTRINO_ICON_VOLUME); + //add icon to container + addCCItem(vb_icon); + } + vb_icon->setDimensionsAll(vb_icon_x, CC_CENTERED, vb_icon_w, height); vb_icon->setColorBody(col_body); vb_icon->setCorner(corner_rad, CORNER_LEFT); - - //add icon to container - addCCItem(vb_icon); } //create new scale void CVolumeBar::initVolumeBarScale() { - vb_pb = new CProgressBar(); + if (!vb_pb){ + vb_pb = new CProgressBar(); + //add progressbar to container + addCCItem(vb_pb); + } vb_pb->setType(CProgressBar::PB_REDRIGHT); vb_pb->setRgb(85, 75, 100); vb_pb->setFrameThickness(2); vb_pb->setProgress(vb_pbx, vb_pby, vb_pbw, vb_pbh, *vb_vol, 100); - - //add progressbar to container - addCCItem(vb_pb); } //set digit text with current volume value void CVolumeBar::initVolumeBarDigitValue() { + vb_digit->kill(col_body); vb_digit->setText(*vb_vol ,vb_digit_mode, *(CVolumeHelper::getInstance()->vb_font)); } //create digit void CVolumeBar::initVolumeBarDigit() { - vb_digit = new CComponentsLabel(); + if (!vb_digit) + vb_digit = new CComponentsLabel(this); vb_digit->setDimensionsAll(vb_digit_x, 0, vb_digit_w, height); vb_digit->setTextColor(COL_MENUCONTENT_TEXT); vb_digit->setCorner(corner_rad, CORNER_RIGHT); - vb_digit->doPaintTextBoxBg(true); initVolumeBarDigitValue(); - - //add digit label to container - addCCItem(vb_digit); } //refresh and paint digit @@ -247,6 +248,18 @@ void CVolumeBar::paintVolScale() vb_pb->paint(CC_SAVE_SCREEN_NO); } +void CVolumeBar::paint(bool do_save_bg) +{ + //prepare items + initVolumeBarItems(); + + //paint form contents + if (!is_painted) + CComponentsForm::paint(do_save_bg); + else + repaintVolScale(); +} + // CVolumeHelper #################################################################################################### diff --git a/src/gui/volumebar.h b/src/gui/volumebar.h index 9989eded3..cfc201305 100644 --- a/src/gui/volumebar.h +++ b/src/gui/volumebar.h @@ -89,6 +89,7 @@ class CVolumeBar : public CComponentsForm // ~CVolumeBar(); inherited from CComponentsForm void repaintVolScale(); + void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; From 0204a7f8a0a12c4d220d62c36f9cc4aebed5c056 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 29 Jan 2017 20:44:53 +0100 Subject: [PATCH 41/47] CVolume: replace repaintVolScale() with paint() paint() contains repaintVolScale() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/008be59b08cf61dafc5db25b1b5544098659da9c Author: Thilo Graf Date: 2017-01-29 (Sun, 29 Jan 2017) ------------------ This commit was generated by Migit --- src/driver/volume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index 4a3112c52..9b66449fd 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -159,7 +159,7 @@ void CVolume::setVolume(const neutrino_msg_t key) if (volscale) { if(vol != g_settings.current_volume) { vol = g_settings.current_volume; - volscale->repaintVolScale(); + volscale->paint(); } } From dff5ceee103a8d3d284d199d34c00c40ba20d066 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 30 Jan 2017 11:00:53 +0100 Subject: [PATCH 42/47] CMenuWidget: ensure repaint of all header content if it is already painted TODO: This should be controlled inside header base class. paint() method seems suitable. I Will try to implement it soon. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/97ed7cdaf74c7a539c792773541f5ac5e6608856 Author: Thilo Graf Date: 2017-01-30 (Mon, 30 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index cb83c00f5..3f5039f7d 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1257,6 +1257,8 @@ void CMenuWidget::paint() header->setCaptionColor(COL_MENUHEAD_TEXT); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0); header->enableGradientBgCleanUp(savescreen); + if (header->isPainted()) + header->kill(header->getColorBody()); header->paint(CC_SAVE_SCREEN_NO); // paint body shadow From d2668ef219f42d634bdb79c4c35ce4426745fe54 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 31 Jan 2017 17:11:50 +0100 Subject: [PATCH 43/47] configure.ac: bump revision to 3.4.1 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a9d61337654e965a1e01afe90227eeffe9f2a557 Author: Michael Liebmann Date: 2017-01-31 (Tue, 31 Jan 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5d88ff9f7..64e4093a3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(Tuxbox-Neutrino,3.4.0) +AC_INIT(Tuxbox-Neutrino,3.4.1) AM_INIT_AUTOMAKE([1.0.1 nostdinc]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) From 37234bb5848ca6c2a9eed914e1ea10e0bc5f97b4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 1 Feb 2017 09:10:06 +0100 Subject: [PATCH 44/47] CRecordManager: remove static error messages Static message window expects user interaction but in this case user could be absent. and recordings could be running out of control. These messages are only warnings and "to slow" warning is optional. To avoid uncontrolled behavior of recordings, it should be enough to use messages with simple timeout. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3387bcf2c4f0de54abea7f5cb3067d84b1af3716 Author: Thilo Graf Date: 2017-02-01 (Wed, 01 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/record.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index f76cecf3b..12b62c13f 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1325,10 +1325,10 @@ int CRecordManager::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data if ((have_err & REC_STATUS_OVERFLOW) && error_display) { error_display = false; warn_display = false; - DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_OVERFLOW)); + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_STREAMING_OVERFLOW, 700, 60, NEUTRINO_ICON_ERROR, NULL, CComponentsHeader::CC_BTN_EXIT); } else if (g_settings.recording_slow_warning && warn_display) { warn_display = false; - DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_SLOW)); + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_STREAMING_SLOW, 700, 60, NEUTRINO_ICON_ERROR, NULL, CComponentsHeader::CC_BTN_EXIT); } } return messages_return::handled; From 6128b4766d783864f74b0384e99a3ef32e201e51 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 1 Feb 2017 09:36:28 +0100 Subject: [PATCH 45/47] CRecordManager: revert warn message for stream overflow It's an error not a warning! Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/721f85deba24584e987f4dfabf395cccdd00b820 Author: Thilo Graf Date: 2017-02-01 (Wed, 01 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/record.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 12b62c13f..517ecff64 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1325,7 +1325,7 @@ int CRecordManager::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data if ((have_err & REC_STATUS_OVERFLOW) && error_display) { error_display = false; warn_display = false; - ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_STREAMING_OVERFLOW, 700, 60, NEUTRINO_ICON_ERROR, NULL, CComponentsHeader::CC_BTN_EXIT); + DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_OVERFLOW)); } else if (g_settings.recording_slow_warning && warn_display) { warn_display = false; ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_STREAMING_SLOW, 700, 60, NEUTRINO_ICON_ERROR, NULL, CComponentsHeader::CC_BTN_EXIT); From 7a62d18bf44f0c77d7c55fc1c7ccb2e2fc6168e2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 1 Feb 2017 11:34:00 +0100 Subject: [PATCH 46/47] Messages: add timeout parameter for error and info messages I'm not sure if it is a good idea to set a global timeout for all error messages. This should be decided for respective cases. Timeout for info messages should not be a problem. The default timeout is set here as global. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b8dabf2bf96075705d8ef5e0a56a5e5a5b569633 Author: Thilo Graf Date: 2017-02-01 (Wed, 01 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 24 ++++++++++++------------ src/gui/widget/msgbox.h | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index dc5b0b50c..25deb70f8 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -542,32 +542,32 @@ int ShowMsg( const std::string & Title, return (result); } -void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Text_mode) +void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int &Timeout , const int& Text_mode) { - ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, NO_TIMEOUT, false, Text_mode, COL_RED); + ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, Timeout, false, Text_mode, COL_RED); } -void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Text_mode) +void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int &Timeout , const int& Text_mode) { - ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, NO_TIMEOUT, false, Text_mode, COL_RED); + ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, Timeout, false, Text_mode, COL_RED); } -void DisplayErrorMessage(const char * const ErrorMsg, const int& Text_mode) +void DisplayErrorMessage(const char * const ErrorMsg, const int &Timeout, const int& Text_mode) { - DisplayErrorMessage(ErrorMsg, LOCALE_MESSAGEBOX_ERROR, Text_mode); + DisplayErrorMessage(ErrorMsg, LOCALE_MESSAGEBOX_ERROR, Timeout, Text_mode); } -void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Text_mode, fb_pixel_t color_frame) +void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Timeout, const int& Text_mode, fb_pixel_t color_frame) { - ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, NO_TIMEOUT, false, Text_mode, color_frame); + ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, Timeout, false, Text_mode, color_frame); } -void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Text_mode, fb_pixel_t color_frame) +void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Timeout, const int& Text_mode, fb_pixel_t color_frame) { - ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, NO_TIMEOUT, false, Text_mode, color_frame); + ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, Timeout, false, Text_mode, color_frame); } -void DisplayInfoMessage(const char * const InfoMsg, const int& Text_mode, fb_pixel_t color_frame) +void DisplayInfoMessage(const char * const InfoMsg, const int& Timeout, const int& Text_mode, fb_pixel_t color_frame) { - DisplayInfoMessage(InfoMsg, LOCALE_MESSAGEBOX_INFO, Text_mode, color_frame); + DisplayInfoMessage(InfoMsg, LOCALE_MESSAGEBOX_INFO, Timeout, Text_mode, color_frame); } diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index f15060973..dcca0b8a7 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -403,10 +403,10 @@ int ShowMsg( const std::string & Title, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const int& Timeout = NO_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Timeout = NO_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Timeout = NO_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const int& Timeout = DEFAULT_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Timeout = DEFAULT_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Timeout = DEFAULT_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 #endif From 995e202c5bef8736a4bbaa071786069779a50917 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 1 Feb 2017 20:38:04 +0100 Subject: [PATCH 47/47] try to fix loop rezap with lua script Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4fcea5bfd5348ffeb1d3b1bcde4e75352c806cae Author: Jacek Jendrzej Date: 2017-02-01 (Wed, 01 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/zapit.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index c9febc2d4..3d7242db0 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -515,6 +515,11 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay if (IS_WEBTV(newchannel->getChannelID()) && !newchannel->getUrl().empty()) { dvbsub_stop(); + if (current_channel->getChannelID() == newchannel->getChannelID() && !newchannel->getScriptName().empty()){ + INFO("[zapit] stop rezap to channel %s id %" PRIx64 ")", newchannel->getName().c_str(), newchannel->getChannelID()); + return true; + } + if (!IS_WEBTV(live_channel_id)) CCamManager::getInstance()->Stop(live_channel_id, CCamManager::PLAY);