CComponents: add some new variables and parameters and modifie debug output

- add var for object index
 can be usefull for identifications of objects for focus operations soon

- add default value for screen size (30%) to CComponentsPIP constructor
 most size we mostly use is 30% of size

- add setters for screen_w and screen_h
 also this can be usefull t adapt screen sizes e.g. during
 runtime operations


Origin commit data
------------------
Branch: ni/coolstream
Commit: 399eb696d6
Author: Thilo Graf <dbt@novatux.de>
Date: 2013-02-17 (Sun, 17 Feb 2013)

Origin message was:
------------------
CComponents: add some new variables and parameters and modifie debug output

- add var for object index
 can be usefull for identifications of objects for focus operations soon

- add default value for screen size (30%) to CComponentsPIP constructor
 most size we mostly use is 30% of size

- add setters for screen_w and screen_h
 also this can be usefull t adapt screen sizes e.g. during
 runtime operations


------------------
This commit was generated by Migit
This commit is contained in:
2013-02-17 23:12:42 +01:00
parent 9d1b8eed1f
commit f9d8a289d5
2 changed files with 11 additions and 8 deletions

View File

@@ -110,6 +110,7 @@ typedef struct comp_element_data_t
#define CC_SAVE_SCREEN_YES true #define CC_SAVE_SCREEN_YES true
#define CC_SAVE_SCREEN_NO false #define CC_SAVE_SCREEN_NO false
#define CC_NO_INDEX -1
class CComponents class CComponents
{ {
@@ -173,6 +174,7 @@ class CComponentsItem : public CComponents
{ {
protected: protected:
int cc_item_type; int cc_item_type;
int cc_item_index;
void hideCCItem(bool no_restore = false); void hideCCItem(bool no_restore = false);
void paintInit(bool do_save_bg); void paintInit(bool do_save_bg);
@@ -335,11 +337,13 @@ class CComponentsPIP : public CComponentsItem
private: private:
int screen_w, screen_h; int screen_w, screen_h;
public: 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(); ~CComponentsPIP();
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void hide(bool no_restore = false); void hide(bool no_restore = false);
void setScreenWidth(int screen_width){screen_w = screen_width;};
void setScreenHeight(int screen_heigth){screen_h = screen_heigth;};
}; };

View File

@@ -93,7 +93,7 @@ void CComponents::paintFbItems(bool do_save_bg)
for(size_t i=0; i<v_fbdata.size(); i++){ for(size_t i=0; i<v_fbdata.size(); i++){
if (v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BGSCREEN){ if (v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BGSCREEN){
#ifdef DEBUG_CC #ifdef DEBUG_CC
printf("[CComponents]\n#####[%s - %d] firstPaint: %d, fbdata_type: %d\n \n", __FUNCTION__, __LINE__, firstPaint, v_fbdata[i].fbdata_type); printf(" [CComponents]\n [%s - %d] firstPaint->save screen: %d, fbdata_type: %d\n", __FUNCTION__, __LINE__, firstPaint, v_fbdata[i].fbdata_type);
#endif #endif
saved_screen.x = v_fbdata[i].x; saved_screen.x = v_fbdata[i].x;
saved_screen.y = v_fbdata[i].y; 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; saved_screen.dy = v_fbdata[i].dy;
clearSavedScreen(); clearSavedScreen();
saved_screen.pixbuf = getScreen(saved_screen.x, saved_screen.y, saved_screen.dx, saved_screen.dy); 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; firstPaint = false;
break; break;
} }
@@ -113,7 +109,9 @@ void CComponents::paintFbItems(bool do_save_bg)
for(size_t i=0; i< v_fbdata.size() ;i++){ for(size_t i=0; i< v_fbdata.size() ;i++){
int fbtype = v_fbdata[i].fbdata_type; 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 (firstPaint){
if (do_save_bg && fbtype == CC_FBDATA_TYPE_LINE) if (do_save_bg && fbtype == CC_FBDATA_TYPE_LINE)
@@ -190,6 +188,7 @@ void CComponentsItem::initVarItem()
{ {
//CComponents //CComponents
initVarBasic(); initVarBasic();
cc_item_index = CC_NO_INDEX;
} }
// Paint container background in cc-items with shadow, background and frame. // 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++) for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++)
v_fbdata.push_back(fbdata[i]); v_fbdata.push_back(fbdata[i]);
#ifdef DEBUG_CC #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 #endif
paintFbItems(do_save_bg); paintFbItems(do_save_bg);
} }