components: use const bool& parameter in paint methodes

Origin commit data
------------------
Commit: 07d8f07d4d
Author: Thilo Graf <dbt@novatux.de>
Date: 2019-10-27 (Sun, 27 Oct 2019)
This commit is contained in:
2019-10-27 22:56:49 +01:00
committed by vanhofen
parent 4e84787e92
commit 2afd15ea32
43 changed files with 61 additions and 60 deletions

View File

@@ -88,7 +88,7 @@ CComponentsDetailsLine::~CComponentsDetailsLine()
//paint details line with current parameters
void CComponentsDetailsLine::paint(bool do_save_bg)
void CComponentsDetailsLine::paint(const bool &do_save_bg)
{
//NI
if (!g_settings.show_menu_hints_line) return;

View File

@@ -77,7 +77,7 @@ class CComponentsDetailsLine : public CComponents
void setLineWidth(const int& w){dl_w = w;}
///paint all to screen
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
};
#endif

View File

@@ -498,7 +498,7 @@ void CCDraw::enablePaintCache(bool enable)
}
//paint framebuffer layers
void CCDraw::paintFbItems(bool do_save_bg)
void CCDraw::paintFbItems(const bool &do_save_bg)
{
//Pick up signal if filled and execute slots.
OnBeforePaintLayers();

View File

@@ -156,7 +156,7 @@ class CCDraw : public COSDFader, public CComponentsSignals, public CCTypes
///rendering of framebuffer elements at once,
///elements are contained in v_fbdata, presumes added frambuffer elements with paintInit(),
///parameter do_save_bg=true, saves background of element to pixel buffer, this can be restore with hide()
void paintFbItems(bool do_save_bg = true);
void paintFbItems(const bool &do_save_bg = true);
public:
///basic component class constructor.
@@ -306,7 +306,7 @@ class CCDraw : public COSDFader, public CComponentsSignals, public CCTypes
int getColBodyGradientMode(){return cc_body_gradient_enable;}
///abstract: paint item, arg: do_save_bg see paintInit() above
virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES) = 0;
virtual void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES) = 0;
///paint item, same like paint(CC_SAVE_SCREEN_NO) but without any argument
void paint0(){paint(CC_SAVE_SCREEN_NO);}
///paint item, same like paint(CC_SAVE_SCREEN_YES) but without any argument

View File

@@ -341,7 +341,7 @@ void CComponentsForm::exchangeCCItem(CComponentsItem* item_a, CComponentsItem* i
exchangeCCItem(getCCItemId(item_a), getCCItemId(item_b));
}
void CComponentsForm::paintForm(bool do_save_bg)
void CComponentsForm::paintForm(const bool &do_save_bg)
{
//paint body
if (!is_painted || force_paint_bg || shadow_force)
@@ -351,7 +351,7 @@ void CComponentsForm::paintForm(bool do_save_bg)
paintCCItems();
}
void CComponentsForm::paint(bool do_save_bg)
void CComponentsForm::paint(const bool &do_save_bg)
{
if(is_painted)
OnBeforeRePaint();
@@ -368,7 +368,7 @@ bool CComponentsForm::isPageChanged()
return false;
}
void CComponentsForm::paintPage(const uint8_t& page_number, bool do_save_bg)
void CComponentsForm::paintPage(const uint8_t& page_number, const bool &do_save_bg)
{
cur_page = page_number;
paint(do_save_bg);
@@ -724,3 +724,4 @@ int CComponentsForm::getUsedDX()
return x_res;
}

View File

@@ -36,7 +36,7 @@ class CComponentsForm : public CComponentsItem
{
protected:
std::vector<CComponentsItem*> v_cc_items;
void paintForm(bool do_save_bg);
void paintForm(const bool &do_save_bg);
///generates next possible index for an item, see also cc_item_index, getIndex(), setIndex()
int genIndex();
@@ -77,7 +77,7 @@ class CComponentsForm : public CComponentsItem
virtual ~CComponentsForm();
///paints current form on screen, for paint a page use paintPage()
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
///same like CComponentsItem::kill(), but erases all embedded items inside of parent at once, this = parent
///NOTE: Items always have parent bindings to "this" and use the parent background color as default! Set parameter 'ignore_parent=true' to ignore parent background color!
@@ -170,7 +170,7 @@ class CComponentsForm : public CComponentsItem
///get current page
uint8_t getCurrentPage(){return cur_page;};
///paint defined page number 0...n
void paintPage(const uint8_t& page_number, bool do_save_bg = CC_SAVE_SCREEN_NO);
void paintPage(const uint8_t& page_number, const bool &do_save_bg = CC_SAVE_SCREEN_NO);
///enum page scroll modes
enum
{

View File

@@ -288,7 +288,7 @@ void CComponentsButton::initCCBtnItems()
}
void CComponentsButton::paint(bool do_save_bg)
void CComponentsButton::paint(const bool &do_save_bg)
{
//prepare items before paint
initCCBtnItems();

View File

@@ -173,7 +173,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
void Refresh(){initCCBtnItems();};
///paint button object
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
/**
* Assigns a single event msg value to button object

View File

@@ -381,7 +381,7 @@ bool CComponentsFrmClock::Stop()
return false;
}
void CComponentsFrmClock::paint(bool do_save_bg)
void CComponentsFrmClock::paint(const bool &do_save_bg)
{
//prepare items before paint
initCCLockItems();

View File

@@ -159,7 +159,7 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen
void setClockInterval(const int& seconds){cl_interval = seconds;}
///show clock on screen
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
///hide clock on screen
void hide(){Stop(); CComponentsForm::hide();}
///does the same like kill() from base class, but stopping clock before kill

View File

@@ -229,7 +229,7 @@ void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val)
initCCTextItems();
}
void CComponentsExtTextForm::paint(bool do_save_bg)
void CComponentsExtTextForm::paint(const bool &do_save_bg)
{
//prepare items before paint
initCCTextItems();

View File

@@ -152,7 +152,7 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen
Font* getFont(){return ccx_font;}
///paint this item/form
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
};
#endif

View File

@@ -381,7 +381,7 @@ void CComponentsFooter::paintButtons(const int& x_pos,
const int& label_width,
const int& context_buttons,
Font* font,
bool do_save_bg)
const bool &do_save_bg)
{
this->setDimensionsAll(x_pos, y_pos, w, h);
this->setButtonFont(font);

View File

@@ -143,7 +143,7 @@ class CComponentsFooter : public CComponentsHeader, public CCButtonSelect
const int& label_width = 0,
const int& context_buttons = 0,
Font* font = g_Font[SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT],
bool do_save_bg = CC_SAVE_SCREEN_NO
const bool &do_save_bg = CC_SAVE_SCREEN_NO
);
enum

View File

@@ -707,7 +707,7 @@ void CComponentsHeader::initCCItems()
initLogo();
}
void CComponentsHeader::paint(bool do_save_bg)
void CComponentsHeader::paint(const bool &do_save_bg)
{
//prepare items
initCCItems();

View File

@@ -328,7 +328,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT
void disableClock();
///paint header
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
///hides item, arg: no_restore see hideCCItem()
void hide(){disableClock(); CComponentsForm::hide();}

View File

@@ -233,7 +233,7 @@ void CSignalBar::paintScale()
}
}
void CSignalBar::paint(bool do_save_bg)
void CSignalBar::paint(const bool &do_save_bg)
{
//initialize before and paint frame and body
if (!is_painted){
@@ -353,7 +353,7 @@ void CSignalBox::paintScale()
snrbar->paint/*Scale*/(false);
}
void CSignalBox::paint(bool do_save_bg)
void CSignalBox::paint(const bool &do_save_bg)
{
//paint frame and body
if (!is_painted)

View File

@@ -146,7 +146,7 @@ class CSignalBar : public CComponentsForm, public CCTextScreen
virtual int getScaleWidth(){ return sb_scale_width;};
///paint this items
virtual void paint(bool do_save_bg);
virtual void paint(const bool &do_save_bg);
//returns the current signal value
uint16_t getValue(void) { return sb_signal; }
@@ -329,7 +329,7 @@ class CSignalBox : public CComponentsForm, public CCTextScreen
fb_pixel_t getPassiveColor(){return sbx_passive_color;};
///paint items
void paint(bool do_save_bg);
void paint(const bool &do_save_bg);
///return current signal value
uint16_t getSignalValue(void) { return sbar->getValue();}

View File

@@ -157,7 +157,7 @@ void CComponentsSlider::setSliderIcon(const std::string &icon_name)
initCCSlSlider();
}
// void CComponentsSlider::paint(bool do_save_bg)
// void CComponentsSlider::paint(const bool &do_save_bg)
// {
// //prepare items before paint
// initCCSlItems();

View File

@@ -76,7 +76,7 @@ class CComponentsSlider : public CComponentsForm
void setValueScale(const int& min_value, const int& max_value);
void setSliderIcon(const std::string &icon_name);
// void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
// void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
};
#endif

View File

@@ -432,7 +432,7 @@ void CComponentsWindow::enablePageScroll(const int& mode)
ccw_body->enablePageScroll(mode);
}
void CComponentsWindow::paintCurPage(bool do_save_bg)
void CComponentsWindow::paintCurPage(const bool &do_save_bg)
{
if (is_painted) //ensure that we have painted already the parent form before paint body
ccw_body->paint(do_save_bg);
@@ -440,13 +440,13 @@ void CComponentsWindow::paintCurPage(bool do_save_bg)
paint(do_save_bg);
}
void CComponentsWindow::paintPage(const uint8_t& page_number, bool do_save_bg)
void CComponentsWindow::paintPage(const uint8_t& page_number, const bool &do_save_bg)
{
CComponentsWindow::setCurrentPage(page_number);
CComponentsWindow::paintCurPage(do_save_bg);
}
void CComponentsWindow::paint(bool do_save_bg)
void CComponentsWindow::paint(const bool &do_save_bg)
{
//prepare items before paint
initCCWItems();

View File

@@ -385,7 +385,7 @@ class CComponentsWindow : public CComponentsForm, CCHeaderTypes
* @param[in] do_save_bg
* @li optional: expects type bool, default = CC_SAVE_SCREEN_NO (false), sets background save mode
*/
void paintCurPage(bool do_save_bg = CC_SAVE_SCREEN_NO);
void paintCurPage(const bool &do_save_bg = CC_SAVE_SCREEN_NO);
/**
* Paints defined page of body, parameter number 0...n
@@ -394,7 +394,7 @@ class CComponentsWindow : public CComponentsForm, CCHeaderTypes
* @param[in] do_save_bg
* @li optional: expects type bool, default = CC_SAVE_SCREEN_NO (false), sets background save mode
*/
void paintPage(const uint8_t& page_number, bool do_save_bg = CC_SAVE_SCREEN_NO);
void paintPage(const uint8_t& page_number, const bool &do_save_bg = CC_SAVE_SCREEN_NO);
/**
* enable/disable page scroll
@@ -420,7 +420,7 @@ class CComponentsWindow : public CComponentsForm, CCHeaderTypes
* @param[in] do_save_bg
* @li optional: expects type bool, sets background save mode
*/
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
/**
* Adds an additional exec key to current collection, default exit keys are CRCInput::RC_home and CRCInput::RC_setup

View File

@@ -65,7 +65,7 @@ void CComponentsItem::initParent(CComponentsForm* parent)
// init container properties in cc-items for shadow, background and frame.
// This member must be called first in all paint() members before paint other items into the container.
// If backround is not required, it's possible to override this with variable paint_bg=false, use doPaintBg(true/false) to set this!
void CComponentsItem::paintInit(bool do_save_bg)
void CComponentsItem::paintInit(const bool &do_save_bg)
{
if (hasChanges()){
clearFbData();

View File

@@ -59,7 +59,7 @@ class CComponentsItem : public CComponents
///If backround is not required, it's possible to override this with variable paint_bg=false, use doPaintBg(true/false) to set this!
///arg do_save_bg=false avoids using of unnecessary pixel memory, eg. if no hide with restore is provided. This is mostly the case whenever
///an item will be hide or overpainted with other methods, or it's embedded (bound) in a parent form.
void paintInit(bool do_save_bg);
void paintInit(const bool &do_save_bg);
///add "this" current item to parent
void initParent(CComponentsForm* parent);

View File

@@ -138,7 +138,7 @@ void CComponentsInfoBox::paintPicture()
pic->paint(CC_SAVE_SCREEN_NO);
}
void CComponentsInfoBox::paint(bool do_save_bg)
void CComponentsInfoBox::paint(const bool &do_save_bg)
{
paintInit(do_save_bg);
paintPicture();

View File

@@ -88,7 +88,7 @@ class CComponentsInfoBox : public CComponentsText
///retur internal picture object
CComponentsPicture * getPictureObject(){return pic;}
///paint item
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
};
#endif

View File

@@ -343,7 +343,7 @@ void CComponentsPicture::paintPicture()
}
}
void CComponentsPicture::paint(bool do_save_bg)
void CComponentsPicture::paint(const bool &do_save_bg)
{
if (pic_name.empty())
return;

View File

@@ -179,7 +179,7 @@ class CComponentsPicture : public CComponentsItem
void SetTransparent(int t){ image_transparent = t; }
///paint item
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
///hide item, see also CComponents::hide();
void hide();

View File

@@ -375,7 +375,7 @@ void CProgressBarCache::pbcApplyGradient(fb_pixel_t *b)
}
}
void CProgressBar::paintProgress(bool do_save_bg)
void CProgressBar::paintProgress(const bool &do_save_bg)
{
if (*pb_design == PB_OFF) {
paintInit(false);
@@ -438,7 +438,7 @@ void CProgressBar::paintStarBar()
g_PicViewer->DisplayImage_unscaled(pb_active_graphic, pb_x, pb_y, pb_active_width, stars_h); // aktiv bar
}
void CProgressBar::paint(bool do_save_bg)
void CProgressBar::paint(const bool &do_save_bg)
{
paintProgress(do_save_bg);
}

View File

@@ -150,7 +150,7 @@ class CProgressBar : public CComponentsItem
void initDimensions();
///paints graph
void paintProgress(bool do_save_bg = CC_SAVE_SCREEN_NO);
void paintProgress(const bool &do_save_bg = CC_SAVE_SCREEN_NO);
void paintStarBar(); //NI starbar
public:
@@ -199,7 +199,7 @@ class CProgressBar : public CComponentsItem
///force update on next paint
void reset() { pb_last_width = -1; }
void paint(bool do_save_bg = CC_SAVE_SCREEN_NO);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_NO);
enum pb_color_t {
PB_OFF = -2, /* -2 */

View File

@@ -56,7 +56,7 @@ CComponentsShapeSquare::CComponentsShapeSquare( const int x_pos, const int y_pos
initParent(parent);
}
void CComponentsShapeSquare::paint(bool do_save_bg)
void CComponentsShapeSquare::paint(const bool &do_save_bg)
{
paintInit(do_save_bg);
}
@@ -105,7 +105,7 @@ CComponentsShapeCircle::CComponentsShapeCircle( int x_pos, int y_pos, int diam,
//
// + - +
void CComponentsShapeCircle::paint(bool do_save_bg)
void CComponentsShapeCircle::paint(const bool &do_save_bg)
{
paintInit(do_save_bg);
}

View File

@@ -57,7 +57,7 @@ class CComponentsShapeCircle : public CComponentsItem
inline int getDiam() const {return d;};
///paint item
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
};
class CComponentsShapeSquare : public CComponentsItem
@@ -70,7 +70,7 @@ class CComponentsShapeSquare : public CComponentsItem
fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0,
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
};

View File

@@ -278,7 +278,7 @@ bool CComponentsText::setTextFromFile(const string& path_to_textfile, const int
return setText(txt, mode, font_text, color_text, style);
}
void CComponentsText::paintText(bool do_save_bg)
void CComponentsText::paintText(const bool &do_save_bg)
{
if (cc_parent){
if(!cc_parent->OnAfterPaintBg.empty())
@@ -300,7 +300,7 @@ void CComponentsText::paintText(bool do_save_bg)
ct_text_sent = false;
}
void CComponentsText::paint(bool do_save_bg)
void CComponentsText::paint(const bool &do_save_bg)
{
OnBeforePaint();
paintText(do_save_bg);

View File

@@ -96,7 +96,7 @@ class CComponentsText : public CCTextScreen, public CComponentsItem
void initCBox();
///paint CCItem backckrond (if paint_bg=true), apply initCCText() and send paint() to the CTextBox object
void paintText(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paintText(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
public:
enum {
FONT_STYLE_REGULAR = 0,
@@ -136,7 +136,7 @@ class CComponentsText : public CCTextScreen, public CComponentsItem
///remove textbox from screen
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);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
///send options for text font (size and type), color and mode (allignment)
void setTextFont(Font* font_text);

View File

@@ -77,7 +77,7 @@ CComponentsPIP::~CComponentsPIP()
// videoDecoder->Pig(-1, -1, -1, -1);
}
void CComponentsPIP::paint(bool do_save_bg)
void CComponentsPIP::paint(const bool &do_save_bg)
{
//NOTE: real values are reqiured, if we paint not bound items or an own render methodes
int pig_x = (cc_parent ? cc_xr : x) + fr_thickness;

View File

@@ -65,7 +65,7 @@ class CComponentsPIP : public CComponentsItem
void setPicture(const std::string& image){pic_name = image;};
///show tv box
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
///remove tv box from screen
void hide();
};

View File

@@ -247,7 +247,7 @@ void CVolumeBar::paintVolScale()
vb_pb->paint(CC_SAVE_SCREEN_NO);
}
void CVolumeBar::paint(bool do_save_bg)
void CVolumeBar::paint(const bool &do_save_bg)
{
//prepare items
initVolumeBarItems();

View File

@@ -89,7 +89,7 @@ class CVolumeBar : public CComponentsForm
// ~CVolumeBar(); inherited from CComponentsForm
void repaintVolScale();
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
};

View File

@@ -74,7 +74,7 @@ public:
const char* Icon = NEUTRINO_ICON_INFO);
///show = paint, for compatibility
void show(bool do_save_bg = true){ paint(do_save_bg) ;}
void show(const bool &do_save_bg = true){ paint(do_save_bg) ;}
/**Adds an item with pre defined text

View File

@@ -115,7 +115,7 @@ void CNaviBar::initCCItems()
}
void CNaviBar::paint(bool do_save_bg)
void CNaviBar::paint(const bool &do_save_bg)
{
hideCCItems();
nb_lText->hide();

View File

@@ -162,7 +162,7 @@ class CNaviBar : public CComponentsFrmChain
* @param[in] do_save_bg
* @li optional: expects type bool, default = CC_SAVE_SCREEN_YES.
*/
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
};
#endif

View File

@@ -211,7 +211,7 @@ int CProgressWindow::exec(CMenuTarget* parent, const string & /*actionKey*/)
return menu_return::RETURN_REPAINT;
}
void CProgressWindow::paint(bool do_save_bg)
void CProgressWindow::paint(const bool &do_save_bg)
{
fitItems();
CComponentsWindow::paint(do_save_bg);

View File

@@ -285,7 +285,7 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget
* @param[in] do_save_bg
* @li optional: expects type bool, sets background save mode
*/
void paint(bool do_save_bg = true);
void paint(const bool &do_save_bg = true);
};
class CProgressSignals : public sigc::trackable