mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 18:01:06 +02:00
Merge branch 'ni/tuxbox' into ni/mp/tuxbox
Origin commit data
------------------
Commit: 665e499208
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-05-03 (Wed, 03 May 2017)
This commit is contained in:
@@ -284,6 +284,8 @@ class CCDraw : public COSDFader, public CComponentsSignals
|
||||
virtual void enableSaveBg(bool save_bg = true);
|
||||
///disable background buffering, does the same like enableSaveBg(false), NOTE: cleans existant pixbuffer content!
|
||||
virtual void disableSaveBg(){enableSaveBg(false);}
|
||||
///returns background buffering mode. Mode is assigned with paint() or enableSaveBg()/disableSaveBg())
|
||||
bool SaveBg(){return cc_save_bg;}
|
||||
|
||||
///allow/disalows paint of item and its contents, but initialize of other properties are not touched
|
||||
///this can be understood as a counterpart to isPainted(), but before paint and value of is_painted is modified temporarily till next paint of item //TODO: is this sufficiently?
|
||||
|
@@ -185,12 +185,11 @@ void CComponentsForm::clear()
|
||||
return;
|
||||
|
||||
for(size_t i=0; i<v_cc_items.size(); i++) {
|
||||
if (v_cc_items[i]){
|
||||
|
||||
dprintf(DEBUG_DEBUG, "[CComponentsForm] %s... delete form cc-item %d of %d (type=%d)\n", __func__, (int)i+1, (int)v_cc_items.size(), v_cc_items[i]->getItemType());
|
||||
|
||||
delete v_cc_items[i];
|
||||
v_cc_items[i] = NULL;
|
||||
CComponentsItem *item = v_cc_items[i];
|
||||
if (item){
|
||||
dprintf(DEBUG_DEBUG, "[CComponentsForm] %s... delete form cc-item %d of %d (type=%d)\taddress = %p\n", __func__, (int)i+1, (int)v_cc_items.size(), item->getItemType(), item);
|
||||
delete item;
|
||||
item = NULL;
|
||||
}
|
||||
}
|
||||
v_cc_items.clear();
|
||||
@@ -518,7 +517,7 @@ void CComponentsForm::paintCCItems()
|
||||
|
||||
//finally paint current item, but only required contents of page
|
||||
if (cc_item->getPageNumber() == cur_page)
|
||||
cc_item->paint(CC_SAVE_SCREEN_NO);
|
||||
cc_item->paint(cc_item->SaveBg());
|
||||
|
||||
//restore defined old visibility mode of item after paint
|
||||
cc_item->allowPaint(item_visible);
|
||||
|
@@ -27,6 +27,25 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
/* general chain form shema
|
||||
|
||||
x/y
|
||||
/
|
||||
+---------------------------------------width----------------------------------------+
|
||||
| chn_t_offset |
|
||||
| +--------+ +--------+ +--------+ |
|
||||
|chn_l_offset| item |append_x_offset| item |append_x_offset| item |chn_r_offset|
|
||||
| +--------+ +--------+ +--------+ |
|
||||
| append_y_offset |height
|
||||
| +--------+ +--------+ +--------+ |
|
||||
| | item | | item | | item | |
|
||||
| +--------+ +--------+ +--------+ |
|
||||
| chn_b_offset |
|
||||
+------------------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
//sub class CComponentsFrmChain
|
||||
CComponentsFrmChain::CComponentsFrmChain( const int& x_pos, const int& y_pos, const int& w, const int& h,
|
||||
@@ -59,11 +78,14 @@ void CComponentsFrmChain::initVarChain( const int& x_pos, const int& y_pos, cons
|
||||
width = w;
|
||||
height = h;
|
||||
|
||||
chn_l_offset = chn_r_offset = 0;
|
||||
chn_t_offset = chn_b_offset = 0;
|
||||
|
||||
shadow = shadow_mode;
|
||||
col_frame = color_frame;
|
||||
col_body = color_body;
|
||||
col_shadow = color_shadow;
|
||||
|
||||
|
||||
chn_direction = direction;
|
||||
|
||||
if (v_items)
|
||||
@@ -86,23 +108,65 @@ void CComponentsFrmChain::initChainItems()
|
||||
return;
|
||||
|
||||
//set new values
|
||||
int w_tmp = append_x_offset;
|
||||
int h_tmp = append_y_offset;
|
||||
int w_tmp = 0, h_tmp = 0;
|
||||
int w_item = 0, h_item = 0;
|
||||
size_t i_count = v_cc_items.size();
|
||||
|
||||
for (size_t i= 0; i< v_cc_items.size(); i++){
|
||||
int x_item = v_cc_items[i]->getXPos();
|
||||
int y_item = v_cc_items[i]->getYPos();
|
||||
|
||||
for (size_t i= 0; i< i_count; i++){
|
||||
// x_item = v_cc_items[i]->getXPos();
|
||||
// y_item = v_cc_items[i]->getYPos();
|
||||
w_item = v_cc_items[i]->getWidth();
|
||||
h_item = v_cc_items[i]->getHeight();
|
||||
|
||||
if (chn_direction & CC_DIR_X){
|
||||
w_tmp += v_cc_items[i]->getWidth();
|
||||
w_tmp += append_x_offset;
|
||||
v_cc_items[i]->setPos(max(CC_APPEND, x_item), max(CC_CENTERED, y_item));
|
||||
if (i == 0){
|
||||
v_cc_items[i]->setXPos(chn_l_offset);
|
||||
w_tmp += chn_l_offset;
|
||||
w_tmp += w_item;
|
||||
if (i_count == 1)
|
||||
w_tmp += chn_r_offset;
|
||||
}
|
||||
|
||||
if (i_count > 1){
|
||||
if (i == i_count-1){
|
||||
w_tmp += w_item;
|
||||
w_tmp += append_x_offset;
|
||||
v_cc_items[i]->setXPos(w_tmp - v_cc_items[i]->getWidth());
|
||||
w_tmp += chn_r_offset;
|
||||
}
|
||||
}
|
||||
|
||||
if (i != 0 && i != i_count-1){
|
||||
w_tmp += w_item;
|
||||
w_tmp += append_x_offset;
|
||||
v_cc_items[i]->setXPos(w_tmp - v_cc_items[i]->getWidth());
|
||||
}
|
||||
}
|
||||
|
||||
if (chn_direction & CC_DIR_Y){
|
||||
h_tmp += v_cc_items[i]->getHeight();
|
||||
h_tmp += append_y_offset;
|
||||
v_cc_items[i]->setPos(max(CC_CENTERED, x_item), max(CC_APPEND, y_item));
|
||||
if (i == 0){
|
||||
v_cc_items[i]->setYPos(chn_t_offset);
|
||||
h_tmp += chn_t_offset;
|
||||
h_tmp += h_item;
|
||||
if (i_count == 1)
|
||||
h_tmp += chn_b_offset;
|
||||
}
|
||||
|
||||
if (i_count > 1){
|
||||
if (i == i_count-1){
|
||||
h_tmp += h_item;
|
||||
h_tmp += append_y_offset;
|
||||
v_cc_items[i]->setYPos(h_tmp - v_cc_items[i]->getHeight());
|
||||
h_tmp += chn_b_offset;
|
||||
}
|
||||
}
|
||||
|
||||
if (i != 0 && i != i_count-1){
|
||||
h_tmp += h_item;
|
||||
h_tmp += append_y_offset;
|
||||
v_cc_items[i]->setYPos(h_tmp - v_cc_items[i]->getHeight());
|
||||
}
|
||||
}
|
||||
}
|
||||
width = max (w_tmp, width);
|
||||
|
@@ -55,6 +55,10 @@ class CComponentsFrmChain : public CComponentsForm
|
||||
fb_pixel_t& color_frame,
|
||||
fb_pixel_t& color_body,
|
||||
fb_pixel_t& color_shadow);
|
||||
|
||||
int chn_l_offset, chn_r_offset;
|
||||
int chn_t_offset, chn_b_offset;
|
||||
|
||||
protected:
|
||||
///property: mode for arrangement direction of items, see also setDirection(), getDirection()
|
||||
int chn_direction;
|
||||
@@ -75,7 +79,26 @@ class CComponentsFrmChain : public CComponentsForm
|
||||
///defines mode for arrangement direction of items, see also chn_direction
|
||||
virtual void setDirection(int direction);
|
||||
///gets the mode of arrangment direction
|
||||
virtual int getDirection(){return chn_direction;};
|
||||
virtual int getDirection(){return chn_direction;}
|
||||
|
||||
/**Members to set border offsets
|
||||
* @param[in] offset
|
||||
* @li expects type int as offset value
|
||||
* @return
|
||||
* void
|
||||
*/
|
||||
void setLeftOffset(const int& offset){chn_l_offset = offset;}
|
||||
void setRightOffset(const int& offset){chn_r_offset = offset;}
|
||||
void setTopOffset(const int& offset){chn_t_offset = offset;}
|
||||
void setBottomOffset(const int& offset){chn_b_offset = offset;}
|
||||
|
||||
void setBorderOffsets(const int& left_offset, const int& right_offset, const int& top_offset, const int& bottom_offset)
|
||||
{
|
||||
setLeftOffset(left_offset);
|
||||
setRightOffset(right_offset);
|
||||
setTopOffset(top_offset);
|
||||
setBottomOffset(bottom_offset);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -277,10 +277,13 @@ void CComponentsHeader::initLogo()
|
||||
int h_logo = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_MIN : cch_logo.dy_max;
|
||||
|
||||
if(!cch_logo_obj)
|
||||
cch_logo_obj = new CComponentsChannelLogoScalable(width/2, height/2 - h_logo/2, cch_logo.Name, cch_logo.Id, this);
|
||||
cch_logo_obj = new CComponentsChannelLogoScalable(1, height/2 - h_logo/2, cch_logo.Name, cch_logo.Id, this);
|
||||
else
|
||||
cch_logo_obj->setChannel(cch_logo.Id, cch_logo.Name);
|
||||
|
||||
// use value 1 as initial value for logo width, ensures downscale with stupid available logo space
|
||||
cch_logo_obj->setHeight(1, true);
|
||||
|
||||
//ensure logo is not larger than original size if in auto mode
|
||||
if (cch_logo.dy_max == -1){
|
||||
int dx_orig = 0, dy_orig = 0 ;
|
||||
@@ -289,6 +292,7 @@ void CComponentsHeader::initLogo()
|
||||
h_logo = dy_orig;
|
||||
}
|
||||
|
||||
//cch_logo_obj->setWidth(1, true);
|
||||
if (cch_logo_obj->hasLogo()){
|
||||
cch_logo_obj->setHeight(h_logo, true);
|
||||
|
||||
@@ -414,8 +418,9 @@ void CComponentsHeader::initButtons()
|
||||
//set button form properties
|
||||
if (cch_btn_obj){
|
||||
cch_btn_obj->setYPos(cch_items_y);
|
||||
cch_btn_obj->doPaintBg(false);
|
||||
cch_btn_obj->doPaintBg(false);;
|
||||
cch_btn_obj->setAppendOffset(cch_buttons_space, 0);
|
||||
cch_btn_obj->setRightOffset(cch_buttons_space);
|
||||
cch_btn_obj->removeAllIcons();
|
||||
cch_btn_obj->addIcon(v_cch_btn);
|
||||
|
||||
@@ -532,7 +537,7 @@ void CComponentsHeader::initCaption()
|
||||
cch_btn_obj->setXPos(width - buttons_w);
|
||||
|
||||
//set required width of caption object
|
||||
cc_text_w -= (buttons_w + cch_offset);
|
||||
cc_text_w -= buttons_w;
|
||||
}
|
||||
|
||||
//clock
|
||||
@@ -547,7 +552,7 @@ void CComponentsHeader::initCaption()
|
||||
cch_cl_obj->setXPos(width - buttons_w - clock_w);
|
||||
|
||||
//set required width of caption object
|
||||
cc_text_w -= (clock_w + cch_offset);
|
||||
cc_text_w -= clock_w;
|
||||
|
||||
//stop clock if disabled or option run is disabled and clock is running
|
||||
if (cch_cl_enable){
|
||||
|
@@ -208,7 +208,8 @@ class CComponentsPictureScalable : public CComponentsPicture
|
||||
fb_pixel_t color_background = 0,
|
||||
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
|
||||
int transparent = CFrameBuffer::TM_NONE)
|
||||
: CComponentsPicture(x_pos, y_pos, 0, 0, image_name, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){};
|
||||
: CComponentsPicture(x_pos, y_pos, 0, 0, image_name, parent, shadow_mode, color_frame, color_background, color_shadow, transparent)
|
||||
{cc_item_type = CC_ITEMTYPE_PICTURE_SCALABLE;};
|
||||
};
|
||||
|
||||
class CComponentsChannelLogo : public CComponentsPicture
|
||||
@@ -292,7 +293,8 @@ class CComponentsChannelLogoScalable : public CComponentsChannelLogo
|
||||
fb_pixel_t color_background = 0,
|
||||
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
|
||||
int transparent = CFrameBuffer::TM_BLACK)
|
||||
: CComponentsChannelLogo(x_pos, y_pos, 0, 0, channelName, channelId, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){};
|
||||
: CComponentsChannelLogo(x_pos, y_pos, 0, 0, channelName, channelId, parent, shadow_mode, color_frame, color_background, color_shadow, transparent)
|
||||
{cc_item_type = CC_ITEMTYPE_CHANNEL_LOGO_SCALABLE;};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -41,7 +41,9 @@ typedef enum
|
||||
CC_ITEMTYPE_GENERIC,
|
||||
CC_ITEMTYPE_ITEM,
|
||||
CC_ITEMTYPE_PICTURE,
|
||||
CC_ITEMTYPE_PICTURE_SCALABLE,
|
||||
CC_ITEMTYPE_CHANNEL_LOGO,
|
||||
CC_ITEMTYPE_CHANNEL_LOGO_SCALABLE,
|
||||
CC_ITEMTYPE_TEXT,
|
||||
CC_ITEMTYPE_TEXT_INFOBOX,
|
||||
CC_ITEMTYPE_SHAPE_SQUARE,
|
||||
|
Reference in New Issue
Block a user