diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index ab7e02575..9e4dd3da2 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -110,6 +110,7 @@ typedef struct comp_element_data_t #define CC_SAVE_SCREEN_YES true #define CC_SAVE_SCREEN_NO false +#define CC_NO_INDEX -1 class CComponents { @@ -173,6 +174,7 @@ class CComponentsItem : public CComponents { protected: int cc_item_type; + int cc_item_index; void hideCCItem(bool no_restore = false); void paintInit(bool do_save_bg); @@ -335,11 +337,13 @@ class CComponentsPIP : public CComponentsItem private: int screen_w, screen_h; public: - CComponentsPIP( const int x_pos, const int y_pos, const int percent, bool has_shadow = CC_SHADOW_OFF); + CComponentsPIP( const int x_pos, const int y_pos, const int percent = 30, bool has_shadow = CC_SHADOW_OFF); ~CComponentsPIP(); void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); void hide(bool no_restore = false); + void setScreenWidth(int screen_width){screen_w = screen_width;}; + void setScreenHeight(int screen_heigth){screen_h = screen_heigth;}; }; diff --git a/src/gui/components/components.cpp b/src/gui/components/components.cpp index 37a415e2f..0c5c223aa 100644 --- a/src/gui/components/components.cpp +++ b/src/gui/components/components.cpp @@ -93,7 +93,7 @@ void CComponents::paintFbItems(bool do_save_bg) for(size_t i=0; isave screen: %d, fbdata_type: %d\n", __FUNCTION__, __LINE__, firstPaint, v_fbdata[i].fbdata_type); #endif saved_screen.x = v_fbdata[i].x; saved_screen.y = v_fbdata[i].y; @@ -101,10 +101,6 @@ void CComponents::paintFbItems(bool do_save_bg) saved_screen.dy = v_fbdata[i].dy; clearSavedScreen(); saved_screen.pixbuf = getScreen(saved_screen.x, saved_screen.y, saved_screen.dx, saved_screen.dy); -#ifdef DEBUG_CC - printf("[CComponents]\n#####[%s - %d], fbdata_[%d] \nx = %d\ny = %d\ndx = %d\n dy = %d\n\n", __FUNCTION__, __LINE__, i, v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy); -#endif - firstPaint = false; break; } @@ -113,7 +109,9 @@ void CComponents::paintFbItems(bool do_save_bg) for(size_t i=0; i< v_fbdata.size() ;i++){ int fbtype = v_fbdata[i].fbdata_type; - +#ifdef DEBUG_CC + printf(" [CComponents]\n [%s - %d], fbdata_[%d] \n x = %d\n y = %d\n dx = %d\n dy = %d\n", __FUNCTION__, __LINE__, i, v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy); +#endif if (firstPaint){ if (do_save_bg && fbtype == CC_FBDATA_TYPE_LINE) @@ -190,6 +188,7 @@ void CComponentsItem::initVarItem() { //CComponents initVarBasic(); + cc_item_index = CC_NO_INDEX; } // Paint container background in cc-items with shadow, background and frame. @@ -216,7 +215,7 @@ void CComponentsItem::paintInit(bool do_save_bg) for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++) v_fbdata.push_back(fbdata[i]); #ifdef DEBUG_CC - printf("[CComponentsItem] %s: init paint cc_item_type: %d\n", __FUNCTION__, cc_item_type); + printf("[CComponentsItem] %s:\ncc_item_type: %d\ncc_item_index = %d\nheight = %d\nwidth = %d\n", __FUNCTION__, cc_item_type, cc_item_index, height, width); #endif paintFbItems(do_save_bg); }