mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
CComponents: Add color gradient for CC_FBDATA_TYPE_BOX
Origin commit data
------------------
Branch: ni/coolstream
Commit: db6fd8480d
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-09-20 (Sat, 20 Sep 2014)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
committed by
[CST] Focus
parent
eecd394b6f
commit
093d638920
@@ -31,6 +31,7 @@
|
||||
#include <global.h>
|
||||
#include <neutrino.h>
|
||||
#include "cc_base.h"
|
||||
#include <cs_api.h>
|
||||
#include <system/debug.h>
|
||||
using namespace std;
|
||||
|
||||
@@ -197,9 +198,20 @@ void CComponents::paintFbItems(bool do_save_bg)
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if(cc_allow_paint)
|
||||
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);
|
||||
else {
|
||||
if(cc_allow_paint) {
|
||||
if ((v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BOX) && (v_fbdata[i].data != NULL)) {
|
||||
// color gradient
|
||||
gradientData_t *gradientData = static_cast<gradientData_t*> (v_fbdata[i].data);
|
||||
if (gradientData->boxBuf == NULL)
|
||||
gradientData->boxBuf = frameBuffer->paintBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, 0, gradientData, v_fbdata[i].r, corner_type);
|
||||
else
|
||||
// frameBuffer->blit2FB(gradientData->boxBuf, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].x, v_fbdata[i].y);
|
||||
frameBuffer->blitBox2FB(gradientData->boxBuf, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].x, v_fbdata[i].y);
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,9 +284,16 @@ void CComponents::kill(const fb_pixel_t& bg_color, const int& corner_radius)
|
||||
//clean old screen buffer
|
||||
void CComponents::clearFbData()
|
||||
{
|
||||
for(size_t i =0; i< v_fbdata.size() ;i++)
|
||||
for(size_t i =0; i< v_fbdata.size() ;i++) {
|
||||
if (v_fbdata[i].pixbuf)
|
||||
delete[] v_fbdata[i].pixbuf;
|
||||
|
||||
if (v_fbdata[i].data && (v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BOX)) {
|
||||
gradientData_t *gradientData = static_cast<gradientData_t*> (v_fbdata[i].data);
|
||||
if (gradientData->boxBuf)
|
||||
cs_free_uncached(gradientData->boxBuf);
|
||||
}
|
||||
}
|
||||
v_fbdata.clear();
|
||||
}
|
||||
|
||||
|
@@ -249,6 +249,8 @@ class CComponentsItem : public CComponents
|
||||
///Is typically the type CComponentsForm or derived classes, default intialized with NULL
|
||||
CComponentsForm *cc_parent;
|
||||
|
||||
gradientData_t cc_gradientData;
|
||||
|
||||
///hides item, arg: no_restore=true causes no restore of background, but clean up pixel buffer if required
|
||||
void hideCCItem(bool no_restore = false);
|
||||
|
||||
|
@@ -51,6 +51,7 @@ CComponentsItem::CComponentsItem(CComponentsForm* parent)
|
||||
cc_item_selected = false;
|
||||
cc_page_number = 0;
|
||||
cc_has_focus = true;
|
||||
cc_gradientData.gradientBuf = NULL;
|
||||
initParent(parent);
|
||||
}
|
||||
|
||||
@@ -88,12 +89,15 @@ void CComponentsItem::paintInit(bool do_save_bg)
|
||||
iy = cc_yr;
|
||||
}
|
||||
|
||||
cc_gradientData.boxBuf = NULL;
|
||||
cc_gradientData.mode = CFrameBuffer::pbrg_noFree;
|
||||
void* gradientData = (cc_gradientData.gradientBuf == NULL) ? NULL : &cc_gradientData;
|
||||
comp_fbdata_t fbdata[] =
|
||||
{
|
||||
{CC_FBDATA_TYPE_BGSCREEN, ix, iy, width+sw, height+sw, 0, 0, 0, NULL, NULL},
|
||||
{CC_FBDATA_TYPE_SHADOW_BOX, ix+sw, iy+sw, width, height, col_shadow, corner_rad, 0, NULL, NULL},//shadow
|
||||
{CC_FBDATA_TYPE_FRAME, ix, iy, width, height, col_frame_cur, corner_rad, th, NULL, NULL},//frame
|
||||
{CC_FBDATA_TYPE_BOX, ix+th, iy+th, width-2*th, height-2*th, col_body, rad, 0, NULL, NULL},//body
|
||||
{CC_FBDATA_TYPE_BOX, ix+th, iy+th, width-2*th, height-2*th, col_body, rad, 0, NULL, gradientData},//body
|
||||
};
|
||||
|
||||
for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++) {
|
||||
|
Reference in New Issue
Block a user