mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 10:21:10 +02:00
Merge remote-tracking branch 'n/cst-next-fixed'
This commit is contained in:
@@ -620,8 +620,6 @@ void CCDraw::paintFbItems(bool do_save_bg)
|
||||
|
||||
void CCDraw::hide()
|
||||
{
|
||||
bool restored = false;
|
||||
|
||||
//restore saved screen background of item if available
|
||||
for(size_t i =0; i< v_fbdata.size() ;i++) {
|
||||
if (v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BGSCREEN){
|
||||
@@ -629,14 +627,9 @@ void CCDraw::hide()
|
||||
//restore screen from backround layer
|
||||
frameBuffer->waitForIdle("CCDraw::hide()");
|
||||
frameBuffer->RestoreScreen(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].pixbuf);
|
||||
restored = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
//cleanup background layer, but only if restore was required
|
||||
if (restored)
|
||||
clearSavedScreen();
|
||||
|
||||
is_painted = false;
|
||||
firstPaint = true;
|
||||
}
|
||||
|
@@ -174,6 +174,7 @@ void CComponentsButton::initCaption()
|
||||
if (cc_btn_capt_obj == NULL){
|
||||
cc_btn_capt_obj = new CComponentsLabel();
|
||||
cc_btn_capt_obj->doPaintBg(false);
|
||||
cc_btn_capt_obj->doPaintTextBoxBg(false);
|
||||
cc_btn_capt_obj->enableTboxSaveScreen(cc_txt_save_screen);
|
||||
addCCItem(cc_btn_capt_obj);
|
||||
}
|
||||
|
@@ -135,6 +135,27 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
|
||||
///set text color
|
||||
virtual void setButtonTextColor(fb_pixel_t text_color, fb_pixel_t text_color_disabled = COL_MENUCONTENTINACTIVE_TEXT){cc_btn_capt_col = text_color; cc_btn_capt_disable_col = text_color_disabled;}
|
||||
|
||||
/**Member to modify background behavior of embeded caption object.
|
||||
* @param[in] mode
|
||||
* @li bool, default = true
|
||||
* @return
|
||||
* void
|
||||
* @see
|
||||
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||
* CTextBox::enableSaveScreen()
|
||||
* disableTboxSaveScreen()
|
||||
*/
|
||||
virtual void enableTboxSaveScreen(bool mode)
|
||||
{
|
||||
if (cc_txt_save_screen == mode)
|
||||
return;
|
||||
cc_txt_save_screen = mode;
|
||||
for(size_t i=0; i<v_cc_items.size(); i++){
|
||||
if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_LABEL)
|
||||
static_cast<CComponentsLabel*>(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen);
|
||||
}
|
||||
};
|
||||
|
||||
///set caption: parameter as string
|
||||
virtual void setCaption(const std::string& text);
|
||||
///set caption: parameter as locale
|
||||
|
@@ -402,16 +402,13 @@ void CComponentsFrmClock::kill(const fb_pixel_t& bg_color, bool ignore_parent)
|
||||
CComponentsForm::kill(bg_color, ignore_parent);
|
||||
}
|
||||
|
||||
void CComponentsFrmClock::enableSegmentSaveScreen(bool mode)
|
||||
void CComponentsFrmClock::enableTboxSaveScreen(bool mode)
|
||||
{
|
||||
if (cc_txt_save_screen == mode || v_cc_items.empty())
|
||||
return;
|
||||
|
||||
cc_txt_save_screen = mode;
|
||||
|
||||
for (size_t i = 0; i < v_cc_items.size(); i++){
|
||||
CComponentsLabel *seg = static_cast <CComponentsLabel*>(v_cc_items[i]);
|
||||
//seg->clearSavedScreen();
|
||||
seg->enableTboxSaveScreen(cc_txt_save_screen);
|
||||
}
|
||||
}
|
||||
|
@@ -158,8 +158,18 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen
|
||||
|
||||
///reinitialize clock contents
|
||||
virtual void refresh() { initCCLockItems(); }
|
||||
///allows to save bg screen behind text within segment objects, see also cl_save_segment_screen
|
||||
void enableSegmentSaveScreen(bool mode);
|
||||
|
||||
/**Member to modify background behavior of embeded segment objects
|
||||
* @param[in] mode
|
||||
* @li bool, default = true
|
||||
* @return
|
||||
* void
|
||||
* @see
|
||||
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||
* CTextBox::enableSaveScreen()
|
||||
* disableTboxSaveScreen()
|
||||
*/
|
||||
void enableTboxSaveScreen(bool mode);
|
||||
|
||||
///set color gradient on/off, returns true if gradient mode was changed
|
||||
virtual bool enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color = 255 /*=COL_BACKGROUND*/);
|
||||
|
@@ -104,7 +104,8 @@ void CComponentsExtTextForm::initLabel()
|
||||
//initialize label object
|
||||
if (ccx_label_obj == NULL){
|
||||
ccx_label_obj = new CComponentsLabel();
|
||||
ccx_label_obj->doPaintBg(false);
|
||||
ccx_label_obj->doPaintBg(!cc_txt_save_screen);
|
||||
ccx_label_obj->doPaintTextBoxBg(false);
|
||||
ccx_label_obj->enableTboxSaveScreen(cc_txt_save_screen);
|
||||
}
|
||||
|
||||
@@ -117,7 +118,7 @@ void CComponentsExtTextForm::initLabel()
|
||||
ccx_label_width = (ccx_percent_label_w * width/100);
|
||||
ccx_label_obj->setText(ccx_label_text, ccx_label_align, ccx_font);
|
||||
ccx_label_obj->setTextColor(ccx_label_color);
|
||||
ccx_label_obj->setDimensionsAll(fr_thickness, 0, ccx_label_width-fr_thickness, height-2*fr_thickness);
|
||||
ccx_label_obj->setDimensionsAll(0, 0, ccx_label_width-2*fr_thickness, height-2*fr_thickness);
|
||||
ccx_label_obj->setCorner(this->corner_rad, CORNER_LEFT);
|
||||
}
|
||||
}
|
||||
@@ -127,7 +128,8 @@ void CComponentsExtTextForm::initText()
|
||||
//initialize text object
|
||||
if (ccx_text_obj == NULL){
|
||||
ccx_text_obj = new CComponentsText();
|
||||
ccx_text_obj->doPaintBg(false);
|
||||
ccx_text_obj->doPaintBg(!cc_txt_save_screen);
|
||||
ccx_text_obj->doPaintTextBoxBg(false);
|
||||
ccx_text_obj->enableTboxSaveScreen(cc_txt_save_screen);
|
||||
}
|
||||
|
||||
|
@@ -110,6 +110,24 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen
|
||||
///returns a pointer to the internal text object, use this to get access to its most properties
|
||||
CComponentsText*getTextObject(){return ccx_text_obj;};
|
||||
|
||||
/**Member to modify background behavior of embeded label and text objects
|
||||
* @param[in] mode
|
||||
* @li bool, default = true
|
||||
* @return
|
||||
* void
|
||||
* @see
|
||||
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||
* CTextBox::enableSaveScreen()
|
||||
* disableTboxSaveScreen()
|
||||
*/
|
||||
void enableTboxSaveScreen(bool mode){
|
||||
if (cc_txt_save_screen == mode)
|
||||
return;
|
||||
cc_txt_save_screen = mode;
|
||||
for(size_t i=0; i<v_cc_items.size(); i++)
|
||||
static_cast<CComponentsText*>(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen);
|
||||
};
|
||||
|
||||
///sets the text modes (mainly text alignment) to the label and text object, see /gui/widget/textbox.h for possible modes
|
||||
void setTextModes(const int& label_mode, const int& text_mode);
|
||||
|
||||
|
@@ -86,7 +86,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const
|
||||
fb_pixel_t color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_FRM_HEADER;
|
||||
cc_txt_save_screen = true;
|
||||
cc_txt_save_screen = false;
|
||||
x = x_old = x_pos;
|
||||
y = y_old = y_pos;
|
||||
|
||||
|
@@ -211,6 +211,23 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen
|
||||
///returns the text object
|
||||
virtual CComponentsText* getTextObject(){return cch_text_obj;}
|
||||
|
||||
/**Member to modify background behavior of embeded title
|
||||
* @param[in] mode
|
||||
* @li bool, default = true
|
||||
* @return
|
||||
* void
|
||||
* @see
|
||||
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||
* CTextBox::enableSaveScreen()
|
||||
* disableTboxSaveScreen()
|
||||
*/
|
||||
void enableTboxSaveScreen(bool mode)
|
||||
{
|
||||
cc_txt_save_screen = mode;
|
||||
if (cch_text_obj->getCTextBoxObject())
|
||||
cch_text_obj->getCTextBoxObject()->enableSaveScreen(cc_txt_save_screen);
|
||||
}
|
||||
|
||||
///returns the clock object
|
||||
virtual CComponentsFrmClock* getClockObject(){return cch_cl_obj;}
|
||||
|
||||
|
@@ -106,7 +106,7 @@ void CSignalBar::initVarSigBar()
|
||||
append_x_offset = 2;
|
||||
append_y_offset = 2;
|
||||
height = SB_MIN_HEIGHT;
|
||||
|
||||
cc_item_type = CC_ITEMTYPE_FRM_SIGNALBAR;
|
||||
sb_scale_height = -1;
|
||||
dy_font = CNeutrinoFonts::getInstance();
|
||||
|
||||
@@ -144,12 +144,13 @@ void CSignalBar::initSBarValue()
|
||||
//create value label object with basic properties
|
||||
if (sb_vlbl == NULL){
|
||||
sb_vlbl = new CComponentsLabel();
|
||||
sb_vlbl->doPaintBg(false);
|
||||
sb_vlbl->doPaintTextBoxBg(false);
|
||||
sb_vlbl->enableTboxSaveScreen(true);
|
||||
sb_vlbl->setText(REF_PERCENT_TXT, sb_val_mode, sb_font);
|
||||
}
|
||||
|
||||
sb_vlbl->doPaintBg(false);
|
||||
sb_vlbl->doPaintTextBoxBg(!cc_txt_save_screen);
|
||||
sb_vlbl->enableTboxSaveScreen(cc_txt_save_screen);
|
||||
|
||||
//move and set dimensions
|
||||
int vlbl_x = sb_scale->getXPos() + sb_scale_width + append_y_offset;
|
||||
int vlbl_h = sb_scale->getHeight();
|
||||
@@ -169,12 +170,14 @@ void CSignalBar::initSBarName()
|
||||
//create name label object with basic properties
|
||||
if (sb_lbl == NULL){
|
||||
sb_lbl = new CComponentsLabel();
|
||||
sb_lbl->doPaintBg(false);
|
||||
sb_lbl->doPaintTextBoxBg(false);
|
||||
sb_lbl->enableTboxSaveScreen(true);
|
||||
sb_lbl->setText(sb_name, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, sb_font);
|
||||
}
|
||||
|
||||
sb_lbl->doPaintBg(false);
|
||||
sb_lbl->doPaintTextBoxBg(!cc_txt_save_screen);
|
||||
sb_lbl->enableTboxSaveScreen(cc_txt_save_screen);
|
||||
|
||||
sb_lbl->setText(sb_name, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, sb_font);
|
||||
|
||||
//move and set dimensions
|
||||
int lbl_x = sb_vlbl->getXPos()+ sb_vlbl->getWidth();
|
||||
int lbl_h = sb_vlbl->getHeight();
|
||||
@@ -316,11 +319,13 @@ void CSignalBox::initSignalItems()
|
||||
sbar->setFrontEnd(sbx_frontend);
|
||||
sbar->setCorner(0);
|
||||
sbar->setScaleHeight(scale_h);
|
||||
sbar->enableTboxSaveScreen(cc_txt_save_screen);
|
||||
|
||||
snrbar->setDimensionsAll(vertical ? sbar_x : CC_APPEND, vertical ? CC_APPEND : 1, sbar_w, sbar_h);
|
||||
snrbar->setFrontEnd(sbx_frontend);
|
||||
snrbar->setCorner(0);
|
||||
snrbar->setScaleHeight(scale_h);
|
||||
snrbar->enableTboxSaveScreen(cc_txt_save_screen);
|
||||
}
|
||||
|
||||
void CSignalBox::paintScale()
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include <gui/components/cc_frm.h>
|
||||
#include <gui/components/cc_item_progressbar.h>
|
||||
#include <gui/components/cc_item_text.h>
|
||||
#include <gui/components/cc_text_screen.h>
|
||||
#include <zapit/include/zapit/frontend_c.h>
|
||||
#include <driver/neutrinofonts.h>
|
||||
|
||||
@@ -47,7 +48,7 @@ CSignalBar() and their sub classes based up CComponentsForm() and are usable lik
|
||||
CSignalBar() is intended to show signal rate.
|
||||
*/
|
||||
|
||||
class CSignalBar : public CComponentsForm
|
||||
class CSignalBar : public CComponentsForm, public CCTextScreen
|
||||
{
|
||||
public:
|
||||
///refresh current item properties, use this before paintScale().
|
||||
@@ -141,6 +142,27 @@ class CSignalBar : public CComponentsForm
|
||||
|
||||
//returns the current signal value
|
||||
uint16_t getValue(void) { return sb_signal; }
|
||||
|
||||
/**Member to modify background behavior of embeded caption objects (value, name)
|
||||
* @param[in] mode
|
||||
* @li bool, default = true
|
||||
* @return
|
||||
* void
|
||||
* @see
|
||||
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||
* CTextBox::enableSaveScreen()
|
||||
* disableTboxSaveScreen()
|
||||
*/
|
||||
void enableTboxSaveScreen(bool mode)
|
||||
{
|
||||
if (cc_txt_save_screen == mode)
|
||||
return;
|
||||
cc_txt_save_screen = mode;
|
||||
for(size_t i=0; i<v_cc_items.size(); i++){
|
||||
if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_LABEL)
|
||||
static_cast<CComponentsLabel*>(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/// Sub class of CSignalBar()
|
||||
@@ -237,7 +259,7 @@ void CSampleClass::hide ()
|
||||
|
||||
*/
|
||||
|
||||
class CSignalBox : public CComponentsForm
|
||||
class CSignalBox : public CComponentsForm, public CCTextScreen
|
||||
{
|
||||
private:
|
||||
///object: current frontend
|
||||
@@ -289,8 +311,27 @@ class CSignalBox : public CComponentsForm
|
||||
|
||||
///return current snr value
|
||||
uint16_t getSNRValue(void) { return snrbar->getValue();}
|
||||
|
||||
///return current snr value
|
||||
|
||||
/**Member to modify background behavior of embeded caption objects (value, name)
|
||||
* @param[in] mode
|
||||
* @li bool, default = true
|
||||
* @return
|
||||
* void
|
||||
* @see
|
||||
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||
* CTextBox::enableSaveScreen()
|
||||
* disableTboxSaveScreen()
|
||||
*/
|
||||
void enableTboxSaveScreen(bool mode)
|
||||
{
|
||||
if (cc_txt_save_screen == mode)
|
||||
return;
|
||||
cc_txt_save_screen = mode;
|
||||
for(size_t i=0; i<v_cc_items.size(); i++){
|
||||
if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_FRM_SIGNALBAR)
|
||||
static_cast<CSignalBar*>(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -135,7 +135,6 @@ void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent)
|
||||
else
|
||||
CComponents::kill(cc_parent->getColorBody(), cc_parent->getCornerRadius());
|
||||
}
|
||||
clearScreenBuffer();
|
||||
}
|
||||
|
||||
//synchronize colors for forms
|
||||
|
@@ -152,6 +152,18 @@ void CComponentsPicture::initCCItem()
|
||||
if (!do_scale){
|
||||
//use image/icon size as object dimension values
|
||||
frameBuffer->getIconSize(pic_name.c_str(), &width, &height);
|
||||
|
||||
/*if we have an image with full path => fallback to pv methode.
|
||||
* That's always a cramp, why we don't have an unified solution in render classes?
|
||||
*/
|
||||
if (width == 0 || height == 0){
|
||||
int dx_tmp, dy_tmp;
|
||||
g_PicViewer->getSize(pic_name.c_str(), &dx_tmp, &dy_tmp);
|
||||
if (width == 0)
|
||||
width = dx_tmp;
|
||||
if (height == 0)
|
||||
height = dy_tmp;
|
||||
}
|
||||
return;
|
||||
}
|
||||
else{ //initialized scaled size
|
||||
@@ -169,10 +181,10 @@ void CComponentsPicture::initCCItem()
|
||||
//check dimensions, leave if dimensions are equal
|
||||
if (width == dx && height == dy)
|
||||
return;
|
||||
|
||||
#if 0
|
||||
//clean up possible cache on changed dimensions
|
||||
clearCache();
|
||||
|
||||
#endif
|
||||
//temporarily vars
|
||||
int w_2scale = width;
|
||||
int h_2scale = height;
|
||||
@@ -294,7 +306,6 @@ bool CComponentsPicture::hasChanges()
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_pos, const int &w, const int &h,
|
||||
const std::string& channelName,
|
||||
const uint64_t& channelId,
|
||||
|
@@ -133,7 +133,7 @@ void CComponentsText::initCCText()
|
||||
if (cc_parent){
|
||||
int th_parent_fr = cc_parent->getFrameThickness();
|
||||
iX = cc_xr + (x <= th_parent_fr ? th_parent_fr : 0);
|
||||
iY = cc_yr + (y <= th_parent_fr ? th_parent_fr : 0);
|
||||
iY = cc_yr - (y <= th_parent_fr ? th_parent_fr : 0);
|
||||
}
|
||||
|
||||
//init textbox
|
||||
@@ -145,13 +145,13 @@ void CComponentsText::initCCText()
|
||||
ct_textbox->setTextMode(ct_text_mode);
|
||||
ct_textbox->setWindowPos(this);
|
||||
ct_textbox->setTextBorderWidth(ct_text_Hborder, ct_text_Vborder);
|
||||
ct_textbox->enableBackgroundPaint(ct_paint_textbg);
|
||||
ct_textbox->enableBackgroundPaint(ct_paint_textbg && !cc_txt_save_screen);
|
||||
ct_textbox->setBackGroundColor(col_body);
|
||||
ct_textbox->setBackGroundRadius(corner_rad-fr_thickness, corner_type);
|
||||
ct_textbox->setTextColor(ct_col_text);
|
||||
ct_textbox->setWindowMaxDimensions(iWidth, iHeight);
|
||||
ct_textbox->setWindowMinDimensions(iWidth, iHeight);
|
||||
ct_textbox->enableSaveScreen(cc_txt_save_screen);
|
||||
ct_textbox->enableSaveScreen(cc_txt_save_screen && !ct_paint_textbg);
|
||||
ct_textbox->enableUTF8(ct_utf8_encoded);
|
||||
|
||||
//observe behavior of parent form if available
|
||||
|
@@ -177,14 +177,22 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox
|
||||
|
||||
///returns count of lines from a text box page
|
||||
virtual int getTextLinesAutoHeight(const int& textMaxHeight, const int& textWidth, const int& mode);
|
||||
///allows to save bg screen behind text within CTextBox object, see also cc_txt_save_screen
|
||||
|
||||
/**Member to modify background behavior of textbox object
|
||||
* @param[in] mode
|
||||
* @li bool, default = true
|
||||
* @return
|
||||
* void
|
||||
* @see
|
||||
* Parent member: CCTextScreen::enableTboxSaveScreen()
|
||||
* CTextBox::enableSaveScreen()
|
||||
* disableTboxSaveScreen()
|
||||
*/
|
||||
void enableTboxSaveScreen(bool mode)
|
||||
{
|
||||
if (cc_txt_save_screen == mode)
|
||||
return;
|
||||
cc_txt_save_screen = mode;
|
||||
if (ct_textbox)
|
||||
ct_textbox->enableSaveScreen(mode);
|
||||
ct_textbox->enableSaveScreen(cc_txt_save_screen);
|
||||
}
|
||||
///enable/disable utf8 encoding
|
||||
void enableUTF8(bool enable = true){ct_utf8_encoded = enable;}
|
||||
|
@@ -24,7 +24,6 @@
|
||||
#ifndef __CC_TXT_SCREEN__
|
||||
#define __CC_TXT_SCREEN__
|
||||
|
||||
|
||||
//! Sub class for CTextBox using CComponent classes.
|
||||
/*!
|
||||
This class contains flags or helpers to control CTextBox screen and paint handling and mostly used by
|
||||
@@ -38,7 +37,25 @@ class CCTextScreen
|
||||
bool cc_txt_save_screen;
|
||||
|
||||
public:
|
||||
CCTextScreen(){cc_txt_save_screen = false;};
|
||||
CCTextScreen(){cc_txt_save_screen = false;}
|
||||
|
||||
/**Abstract member to modify background behavior of embeded textbox object
|
||||
* @param[in] mode
|
||||
* @li bool, default = true, enables backround saving of textbox object. This causes painting of backround from saved screen instead simple backround (if enabled)
|
||||
* This is usefull if text should be paint on transparent background or background with color gradient.
|
||||
* @return
|
||||
* void
|
||||
* @see
|
||||
* CTextBox::enableSaveScreen()
|
||||
* disableTboxSaveScreen()
|
||||
*/
|
||||
virtual void enableTboxSaveScreen(bool mode) = 0;
|
||||
|
||||
/**member to disable background behavior of embeded textbox object.
|
||||
* @see
|
||||
* disableTboxSaveScreen()
|
||||
*/
|
||||
virtual void disableTboxSaveScreen(){enableTboxSaveScreen(false);}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -63,6 +63,7 @@ typedef enum
|
||||
CC_ITEMTYPE_BUTTON_BLUE,
|
||||
CC_ITEMTYPE_SLIDER,
|
||||
CC_ITEMTYPE_FRM_SCROLLBAR,
|
||||
CC_ITEMTYPE_FRM_SIGNALBAR,
|
||||
|
||||
CC_ITEMTYPES
|
||||
}CC_ITEMTYPES_T;
|
||||
|
Reference in New Issue
Block a user