components: rework classes

- outsourced some classes cc_item.cpp/h, cc_draw.cpp/h
- added extra methodes for simple use of some basic components extra.cpp/h
- rework clock handling: use timer class, reworked members for
  enable/disable clock with external timer events,
  tryed to fix some display issues related with infoclock and
  time osd clock in moviebrowser, channellist, menuus
- reworked hide/kill handling, removed parameter for hide(), try to use
  cached backgrounds for other constallations, paint cache, image cache (all beta)
- reworked shadow/frame handling, add shadow modes for left/right
  arrangement, TODO: repaint for existant instances required
- reworked color gradient assignment (beta)

... Note: I had a data crash in my local git tree
and i tryed to restore my historie, but most was lost. Therefore here
the commit is large
This commit is contained in:
2015-11-18 18:08:23 +01:00
parent a2171dad4a
commit 0146511f38
68 changed files with 3207 additions and 1682 deletions

View File

@@ -39,7 +39,7 @@ using namespace std;
//sub class CComponentsForm from CComponentsItem
CComponentsForm::CComponentsForm( const int x_pos, const int y_pos, const int w, const int h,
CComponentsForm* parent,
bool has_shadow,
int shadow_mode,
fb_pixel_t color_frame,
fb_pixel_t color_body,
fb_pixel_t color_shadow)
@@ -47,18 +47,11 @@ CComponentsForm::CComponentsForm( const int x_pos, const int y_pos, const int w,
{
cc_item_type = CC_ITEMTYPE_FRM;
x = x_pos;
y = y_pos;
cc_xr = x;
cc_yr = y;
width = w;
height = h;
shadow = has_shadow;
col_frame = color_frame;
col_body = color_body;
col_shadow = color_shadow;
Init(x_pos, y_pos, w, h, color_frame, color_body, color_shadow);
cc_xr = x;
cc_yr = y;
shadow = shadow_mode;
shadow_w = SHADOW_OFFSET;
corner_rad = RADIUS_LARGE;
corner_type = CORNER_ALL;
@@ -80,6 +73,15 @@ CComponentsForm::CComponentsForm( const int x_pos, const int y_pos, const int w,
this->OnExec.connect(sl);
}
void CComponentsForm::Init( const int& x_pos, const int& y_pos, const int& w, const int& h,
const fb_pixel_t& color_frame,
const fb_pixel_t& color_body,
const fb_pixel_t& color_shadow)
{
setDimensionsAll(x_pos, y_pos, w, h);
setColorAll(color_frame, color_body, color_shadow);
}
CComponentsForm::~CComponentsForm()
{
clear();
@@ -292,7 +294,7 @@ void CComponentsForm::insertCCItem(const uint& cc_item_id, CComponentsItem* cc_I
if (v_cc_items.empty()){
addCCItem(cc_Item);
dprintf(DEBUG_DEBUG, "[CComponentsForm] %s insert cc_Item not possible, v_cc_items is empty, cc_Item added\n", __func__);
dprintf(DEBUG_NORMAL, "[CComponentsForm] %s insert cc_Item not possible, v_cc_items is empty, cc_Item added\n", __func__);
}else{
v_cc_items.insert(v_cc_items.begin()+cc_item_id, cc_Item);
cc_Item->setParent(this);
@@ -520,23 +522,23 @@ void CComponentsForm::paintCCItems()
cc_item->allowPaint(item_visible);
}
}
void CComponentsForm::hide(bool no_restore)
#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; i<v_cc_items.size(); i++) {
if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_PIP){
v_cc_items[i]->hide();
v_cc_items[i]->kill();
break;
}
}
//hide body
hideCCItem(no_restore);
CComponents::hide();
}
#endif
//erase or paint over rendered objects
void CComponentsForm::killCCItems(const fb_pixel_t& bg_color, bool ignore_parent)
{
@@ -649,3 +651,47 @@ void CComponentsForm::ScrollPage(int direction, bool do_paint)
OnAfterScrollPage();
}
bool CComponentsForm::clearSavedScreen()
{
if (CCDraw::clearSavedScreen()){
for(size_t i=0; i<v_cc_items.size(); i++)
v_cc_items[i]->clearSavedScreen();
return true;
}
return false;
}
bool CComponentsForm::clearPaintCache()
{
if (CCDraw::clearPaintCache()){
for(size_t i=0; i<v_cc_items.size(); i++)
v_cc_items[i]->clearPaintCache();
return true;
}
return false;
}
//clean old gradient buffer
bool CComponentsForm::clearFbGradientData()
{
if (CCDraw::clearFbGradientData()){
for(size_t i=0; i<v_cc_items.size(); i++)
v_cc_items[i]->clearFbGradientData();
return true;
}
return false;
}
bool CComponentsForm::enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color, const int& direction)
{
if (CCDraw::enableColBodyGradient(enable_mode, sec_color, direction)){
for (size_t i= 0; i< v_cc_items.size(); i++)
v_cc_items[i]->clearScreenBuffer();
return true;
}
return false;
}