mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
cc_draw: use const bool& for more safety
This commit is contained in:
@@ -422,7 +422,7 @@ void CCDraw::clearFbData()
|
|||||||
v_fbdata.clear();
|
v_fbdata.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CCDraw::CheckFbData(const cc_fbdata_t& fbdata, const char* func, const int line)
|
bool CCDraw::CheckFbData(const cc_fbdata_t& fbdata, const char* func, const int& line)
|
||||||
{
|
{
|
||||||
if (fbdata.x < 0 || fbdata.y < 0 || fbdata.dx == 0 || fbdata.dy == 0) {
|
if (fbdata.x < 0 || fbdata.y < 0 || fbdata.dx == 0 || fbdata.dy == 0) {
|
||||||
dprintf(DEBUG_DEBUG,"[CCDraw]\t[%s - %d], INFO! Position < 0 or dx and/or dy = 0, x = %d, y = %d, dx = %d, dy = %d item: %s [type: %d]\n",
|
dprintf(DEBUG_DEBUG,"[CCDraw]\t[%s - %d], INFO! Position < 0 or dx and/or dy = 0, x = %d, y = %d, dx = %d, dy = %d item: %s [type: %d]\n",
|
||||||
@@ -483,14 +483,14 @@ cc_screen_data_t CCDraw::getScreenData(const int& ax, const int& ay, const int&
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCDraw::enableSaveBg(bool save_bg)
|
void CCDraw::enableSaveBg(const bool &save_bg)
|
||||||
{
|
{
|
||||||
if (!cc_save_bg || (cc_save_bg != save_bg))
|
if (!cc_save_bg || (cc_save_bg != save_bg))
|
||||||
clearSavedScreen();
|
clearSavedScreen();
|
||||||
cc_save_bg = save_bg;
|
cc_save_bg = save_bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCDraw::enablePaintCache(bool enable)
|
void CCDraw::enablePaintCache(const bool &enable)
|
||||||
{
|
{
|
||||||
if (!cc_paint_cache || (cc_paint_cache != enable))
|
if (!cc_paint_cache || (cc_paint_cache != enable))
|
||||||
clearPaintCache();
|
clearPaintCache();
|
||||||
@@ -801,7 +801,7 @@ void CCDraw::killShadow(const fb_pixel_t& bg_color, const int& corner_radius)
|
|||||||
kill(bg_color, corner_radius, CC_FBDATA_TYPE_SHADOW_BOX);
|
kill(bg_color, corner_radius, CC_FBDATA_TYPE_SHADOW_BOX);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CCDraw::doPaintBg(bool do_paint)
|
bool CCDraw::doPaintBg(const bool &do_paint)
|
||||||
{
|
{
|
||||||
if (paint_bg == do_paint)
|
if (paint_bg == do_paint)
|
||||||
return false;
|
return false;
|
||||||
|
@@ -146,7 +146,7 @@ class CCDraw : public COSDFader, public CComponentsSignals, public CCTypes
|
|||||||
fb_pixel_t cc_body_gradient_2nd_col, cc_body_gradient_2nd_col_old;
|
fb_pixel_t cc_body_gradient_2nd_col, cc_body_gradient_2nd_col_old;
|
||||||
|
|
||||||
///check current fbdtata position and dimensions, parameter fbdata is an element of v_fbdata, returns false on error
|
///check current fbdtata position and dimensions, parameter fbdata is an element of v_fbdata, returns false on error
|
||||||
bool CheckFbData(const cc_fbdata_t& fbdata, const char* func, const int line);
|
bool CheckFbData(const cc_fbdata_t& fbdata, const char* func, const int& line);
|
||||||
|
|
||||||
///sub: get gradient data evaluted with current parameters
|
///sub: get gradient data evaluted with current parameters
|
||||||
gradientData_t* getGradientData();
|
gradientData_t* getGradientData();
|
||||||
@@ -257,20 +257,20 @@ class CCDraw : public COSDFader, public CComponentsSignals, public CCTypes
|
|||||||
int getShadowWidth(){return shadow_w;}
|
int getShadowWidth(){return shadow_w;}
|
||||||
|
|
||||||
///paint caching for body and shadow, see also cc_paint_cache NOTE: has no effect if paint_bg = false
|
///paint caching for body and shadow, see also cc_paint_cache NOTE: has no effect if paint_bg = false
|
||||||
void enablePaintCache(bool enable = true);
|
void enablePaintCache(const bool &enable = true);
|
||||||
///disable paint caching for body and shadow
|
///disable paint caching for body and shadow
|
||||||
void disablePaintCache(){enablePaintCache(false);}
|
void disablePaintCache(){enablePaintCache(false);}
|
||||||
|
|
||||||
///returns paint mode, true=item was painted
|
///returns paint mode, true=item was painted
|
||||||
bool isPainted();
|
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
|
///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
|
||||||
bool doPaintBg(bool do_paint);
|
bool doPaintBg(const bool &do_paint);
|
||||||
///allows paint frame around body, default true , NOTE: ignored if frame width = 0
|
///allows paint frame around body, default true , NOTE: ignored if frame width = 0
|
||||||
void enableFrame(bool enable = true, const int& frame_width = -1){cc_enable_frame = enable; setFrameThickness(frame_width == -1 ? fr_thickness : frame_width);}
|
void enableFrame(const bool &enable = true, const int& frame_width = -1){cc_enable_frame = enable; setFrameThickness(frame_width == -1 ? fr_thickness : frame_width);}
|
||||||
///disallow paint frame around body
|
///disallow paint frame around body
|
||||||
void disableFrame(){enableFrame(false);}
|
void disableFrame(){enableFrame(false);}
|
||||||
///enable/disable background buffering, default action = enable, see also cc_save_bg
|
///enable/disable background buffering, default action = enable, see also cc_save_bg
|
||||||
void enableSaveBg(bool save_bg = true);
|
void enableSaveBg(const bool &save_bg = true);
|
||||||
///disable background buffering, does the same like enableSaveBg(false), NOTE: cleans existant pixbuffer content!
|
///disable background buffering, does the same like enableSaveBg(false), NOTE: cleans existant pixbuffer content!
|
||||||
void disableSaveBg(){enableSaveBg(false);}
|
void disableSaveBg(){enableSaveBg(false);}
|
||||||
///returns background buffering mode. Mode is assigned with paint() or enableSaveBg()/disableSaveBg())
|
///returns background buffering mode. Mode is assigned with paint() or enableSaveBg()/disableSaveBg())
|
||||||
|
Reference in New Issue
Block a user