mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 09:51:22 +02:00
Merge remote-tracking branch 'check/next-cc'
needs buildfixing in framebuffer class... Conflicts: data/locale/deutsch.locale data/locale/english.locale src/driver/fontrenderer.cpp src/driver/volume.cpp src/gui/audiomute.cpp src/gui/audioplayer.cpp src/gui/osd_setup.cpp src/gui/widget/stringinput.cpp src/neutrino.cpp
This commit is contained in:
@@ -36,8 +36,6 @@
|
||||
|
||||
class CComponents
|
||||
{
|
||||
private:
|
||||
bool allowPaint(const int& i);
|
||||
protected:
|
||||
int x, y, height, width, corner_type, shadow_w;
|
||||
int corner_rad, fr_thickness, fr_thickness_sel;
|
||||
|
@@ -80,27 +80,10 @@ void CComponents::initVarBasic()
|
||||
saved_screen.pixbuf = NULL;
|
||||
}
|
||||
|
||||
bool CComponents::allowPaint(const int& i)
|
||||
{
|
||||
if(v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BOX)
|
||||
return true;
|
||||
|
||||
|
||||
if (v_fbdata[CC_FBDATA_TYPE_BOX].x != v_fbdata[i].x)
|
||||
return true;
|
||||
else if (v_fbdata[CC_FBDATA_TYPE_BOX].y != v_fbdata[i].y)
|
||||
return true;
|
||||
else if (v_fbdata[CC_FBDATA_TYPE_BOX].dx != v_fbdata[i].dx)
|
||||
return true;
|
||||
else if (v_fbdata[CC_FBDATA_TYPE_BOX].dy != v_fbdata[i].dy)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//paint framebuffer stuff and fill buffer
|
||||
void CComponents::paintFbItems(bool do_save_bg)
|
||||
{
|
||||
//save background before first paint, do_save_bg must be true
|
||||
if (firstPaint && do_save_bg) {
|
||||
for(size_t i=0; i<v_fbdata.size(); i++){
|
||||
if (v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BGSCREEN){
|
||||
@@ -128,6 +111,8 @@ void CComponents::paintFbItems(bool do_save_bg)
|
||||
#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
|
||||
//some elements can be assembled from lines and must be handled as one unit (see details line),
|
||||
//so all individual backgrounds of boxes must be saved and painted in "firstpaint mode"
|
||||
if (firstPaint){
|
||||
|
||||
if (do_save_bg && fbtype == CC_FBDATA_TYPE_LINE)
|
||||
@@ -139,12 +124,16 @@ void CComponents::paintFbItems(bool do_save_bg)
|
||||
else
|
||||
firstPaint = false;
|
||||
}
|
||||
if (fbtype != CC_FBDATA_TYPE_BGSCREEN){
|
||||
if (fbtype == CC_FBDATA_TYPE_FRAME && v_fbdata[i].frame_thickness > 0)
|
||||
frameBuffer->paintBoxFrame(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].frame_thickness, v_fbdata[i].color, v_fbdata[i].r);
|
||||
|
||||
//paint all fb relevant basic parts (frame and body) with all specified properties, paint_bg must be true
|
||||
if (fbtype != CC_FBDATA_TYPE_BGSCREEN && paint_bg){
|
||||
if (fbtype == CC_FBDATA_TYPE_FRAME) {
|
||||
if (v_fbdata[i].frame_thickness > 0)
|
||||
frameBuffer->paintBoxFrame(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].frame_thickness, v_fbdata[i].color, v_fbdata[i].r, corner_type);
|
||||
}
|
||||
else if (fbtype == CC_FBDATA_TYPE_BACKGROUND)
|
||||
frameBuffer->paintBackgroundBoxRel(x, y, v_fbdata[i].dx, v_fbdata[i].dy);
|
||||
else if( allowPaint(i) || fbtype == CC_FBDATA_TYPE_LINE)
|
||||
else
|
||||
frameBuffer->paintBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].color, v_fbdata[i].r, corner_type);
|
||||
}
|
||||
}
|
||||
@@ -156,6 +145,7 @@ void CComponents::paintFbItems(bool do_save_bg)
|
||||
inline fb_pixel_t* CComponents::getScreen(int ax, int ay, int dx, int dy)
|
||||
{
|
||||
fb_pixel_t* pixbuf = new fb_pixel_t[dx * dy];
|
||||
frameBuffer->waitForIdle("CComponents::getScreen()");
|
||||
frameBuffer->SaveScreen(ax, ay, dx, dy, pixbuf);
|
||||
return pixbuf;
|
||||
}
|
||||
@@ -165,6 +155,7 @@ inline void CComponents::hide()
|
||||
{
|
||||
for(size_t i =0; i< v_fbdata.size() ;i++) {
|
||||
if (v_fbdata[i].pixbuf != NULL){
|
||||
frameBuffer->waitForIdle("CComponents::hide()");
|
||||
frameBuffer->RestoreScreen(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].pixbuf);
|
||||
delete[] v_fbdata[i].pixbuf;
|
||||
v_fbdata[i].pixbuf = NULL;
|
||||
|
@@ -67,10 +67,6 @@ void CComponentsItem::paintInit(bool do_save_bg)
|
||||
{
|
||||
clear();
|
||||
|
||||
if(!paint_bg)
|
||||
return;
|
||||
|
||||
int sw = shadow ? shadow_w : 0;
|
||||
int th = fr_thickness;
|
||||
fb_pixel_t col_frame_cur = col_frame;
|
||||
|
||||
@@ -83,13 +79,21 @@ void CComponentsItem::paintInit(bool do_save_bg)
|
||||
//calculate current needed corner radius for body box, depends of frame thickness
|
||||
int rad = (corner_rad>th) ? corner_rad-th : corner_rad;
|
||||
|
||||
//calculate positon of shadow areas
|
||||
int x_sh = corner_rad>0 ? x+width-2*corner_rad+sw : x+width; //right
|
||||
int y_sh = corner_rad>0 ? y+height-2*corner_rad+sw : y+height; //bottom
|
||||
|
||||
//calculate current shadow width depends of current corner_rad
|
||||
int sw_cur = corner_rad>0 ? 2*corner_rad : sw;
|
||||
|
||||
int sw = 0, sw_cur = 0;
|
||||
int x_sh = x + width;
|
||||
int y_sh = y + height;
|
||||
if (shadow) {
|
||||
sw = shadow_w;
|
||||
sw_cur = sw;
|
||||
if (corner_type && corner_rad) {
|
||||
//calculate positon of shadow areas
|
||||
x_sh += sw - 2*corner_rad;
|
||||
y_sh += sw - 2*corner_rad;
|
||||
//calculate current shadow width depends of current corner_rad
|
||||
sw_cur = max(2*corner_rad, sw);
|
||||
}
|
||||
}
|
||||
|
||||
comp_fbdata_t fbdata[] =
|
||||
{
|
||||
{CC_FBDATA_TYPE_BGSCREEN, x, y, width+sw, height+sw, 0, 0, 0, NULL, NULL},
|
||||
@@ -115,6 +119,7 @@ void CComponentsItem::hideCCItem(bool no_restore)
|
||||
is_painted = false;
|
||||
|
||||
if (saved_screen.pixbuf) {
|
||||
frameBuffer->waitForIdle("CComponentsItem::hideCCItem()");
|
||||
frameBuffer->RestoreScreen(saved_screen.x, saved_screen.y, saved_screen.dx, saved_screen.dy, saved_screen.pixbuf);
|
||||
if (no_restore) {
|
||||
delete[] saved_screen.pixbuf;
|
||||
|
@@ -93,12 +93,12 @@ typedef struct comp_screen_data_t
|
||||
//align types
|
||||
enum
|
||||
{
|
||||
CC_ALIGN_RIGHT = 0,
|
||||
CC_ALIGN_LEFT = 1,
|
||||
CC_ALIGN_TOP = 2,
|
||||
CC_ALIGN_BOTTOM = 4,
|
||||
CC_ALIGN_HOR_CENTER = 8,
|
||||
CC_ALIGN_VER_CENTER = 16
|
||||
CC_ALIGN_RIGHT = 1,
|
||||
CC_ALIGN_LEFT = 2,
|
||||
CC_ALIGN_TOP = 4,
|
||||
CC_ALIGN_BOTTOM = 8,
|
||||
CC_ALIGN_HOR_CENTER = 16,
|
||||
CC_ALIGN_VER_CENTER = 32
|
||||
};
|
||||
|
||||
enum
|
||||
|
Reference in New Issue
Block a user