else if (surface) surface->drawJpeg(fileName,x,y,width,height);
}
-void Boxx::drawMonoBitmap(UCHAR*base, int dx, int dy, unsigned int height,unsigned int width, Colour& nextColour)
+void Boxx::drawMonoBitmap(UCHAR*base, int dx, int dy, unsigned int height,unsigned int width, DrawStyle& nextColour)
{
if (parent) parent->drawMonoBitmap(base, area.x +dx,area.y +dy, height,width, nextColour);
else if (surface) surface->drawMonoBitmap(base, dx,dy, height,width, nextColour);
void drawJpeg(const char *fileName,int x, int y,int *width, int *height);
void drawTTChar(int ox, int oy,int x, int y, cTeletextChar c);
- void drawMonoBitmap(UCHAR*base, int dx, int dy, unsigned int height,unsigned int width, Colour& nextColour);
+ void drawMonoBitmap(UCHAR*base, int dx, int dy, unsigned int height,unsigned int width, DrawStyle& nextColour);
/* This is for system which need a locking of the drawing surface to speed up drawing */
void startFastDraw();
#include "colour.h"
-/*
-Real colours
-*/
+
DrawStyle DrawStyle::BLACK(0, 0, 0);
DrawStyle DrawStyle::RED(255, 0, 0);
DrawStyle DrawStyle::GREEN(0, 255, 0);
+DrawStyle DrawStyle::GREY(180, 180, 180);
+DrawStyle DrawStyle::DARKGREY(100, 100, 100);
DrawStyle DrawStyle::BLUE(0, 0, 255);
DrawStyle DrawStyle::YELLOW(255, 255, 0);
DrawStyle DrawStyle::VIDEOBLUE(0, 0, 150);
DrawStyle DrawStyle::NOPROGRAMME(180, 180, 180); // no programme details colour
-/*
+void SkinFactory::InitDefaultSkin()
+{
+ /*
+Real colours
+ */
+ DrawStyle::BLACK=DrawStyle(0, 0, 0);
+ DrawStyle::RED=DrawStyle(255, 0, 0);
+ DrawStyle::GREY=DrawStyle(180, 180, 180);
+ DrawStyle::DARKGREY=DrawStyle(100, 100, 100);
+ DrawStyle::GREEN=DrawStyle(0, 255, 0);
+ DrawStyle::BLUE=DrawStyle(0, 0, 255);
+ DrawStyle::YELLOW=DrawStyle(255, 255, 0);
+ DrawStyle::VIDEOBLUE=DrawStyle(0, 0, 150);
+ DrawStyle::VIEWBACKGROUND=DrawStyle(0, 0, 100);
+ DrawStyle::TABVIEWBACKGROUND=DrawStyle(0, 0, 120);
+ DrawStyle::TITLEBARBACKGROUND=DrawStyle(0, 0, 200);
+ DrawStyle::SELECTHIGHLIGHT=DrawStyle(240, 250, 80);
+ DrawStyle::SELECTDARKHIGHLIGHT=DrawStyle(120, 125, 40);
+ DrawStyle::LIGHTTEXT=DrawStyle(255, 255, 255);
+ DrawStyle::DARKTEXT=DrawStyle(0, 0, 100);
+ DrawStyle::DANGER=DrawStyle(200, 0, 0);
+ DrawStyle::BUTTONBACKGROUND=DrawStyle(0, 0, 200);
+ DrawStyle::PROGRAMMEB=DrawStyle(80, 80, 240); // two colours used as alterating backgrounds for individual programmes in EPG
+ DrawStyle::PROGRAMMEA=DrawStyle(40, 40, 120); // TODO fit epg style (colours) in with rest of application
+ DrawStyle::NOPROGRAMME=DrawStyle(180, 180, 180); // no programme details colour
+
+
+ /*
Silly colours
Colour Colour::VIDEOBLUE(250, 0, 0);
Colour Colour::DARKTEXT(0, 0, 255);
Colour Colour::DANGER(200, 200, 0);
Colour Colour::BUTTONBACKGROUND(255, 255, 255);
-*/
+ */
+}
+
+void SkinFactory::InitEnhancedSkin()
+{
+ /*
+Real colours
+ */
+ DrawStyle::BLACK=DrawStyle(0, 0, 0);
+
+ DrawStyle::RED=DrawStyle(100, 0, 0);
+ DrawStyle::RED.grad_col[0]=Colour(255, 0, 0);
+ DrawStyle::RED.grad_col[1]=Colour(100, 0, 0);
+ DrawStyle::RED.grad_pos[0]=0.5;
+ DrawStyle::RED.num_colors=2;
+ DrawStyle::RED.ft=DrawStyle::GradientLinear;
+ DrawStyle::RED.x1=0.0;
+ DrawStyle::RED.y1=0.0;
+ DrawStyle::RED.x2=0.0;
+ DrawStyle::RED.y2=1.0;
+
+ DrawStyle::GREEN=DrawStyle(0, 100, 0);
+ DrawStyle::GREEN.grad_col[0]=Colour(0, 255, 0);
+ DrawStyle::GREEN.grad_col[1]=Colour(0, 100, 0);
+ DrawStyle::GREEN.grad_pos[0]=0.5;
+ DrawStyle::GREEN.num_colors=2;
+ DrawStyle::GREEN.ft=DrawStyle::GradientLinear;
+ DrawStyle::GREEN.x1=0.0;
+ DrawStyle::GREEN.y1=0.0;
+ DrawStyle::GREEN.x2=0.0;
+ DrawStyle::GREEN.y2=1.0;
+
+ DrawStyle::BLUE=DrawStyle(0, 0, 100);
+ DrawStyle::BLUE.grad_col[0]=Colour(0, 0, 255);
+ DrawStyle::BLUE.grad_col[1]=Colour(0, 0, 100);
+ DrawStyle::BLUE.grad_pos[0]=0.5;
+ DrawStyle::BLUE.num_colors=2;
+ DrawStyle::BLUE.ft=DrawStyle::GradientLinear;
+ DrawStyle::BLUE.x1=0.0;
+ DrawStyle::BLUE.y1=0.0;
+ DrawStyle::BLUE.x2=0.0;
+ DrawStyle::BLUE.y2=1.0;
+
+ DrawStyle::YELLOW=DrawStyle(100, 100, 0);
+ DrawStyle::YELLOW.grad_col[0]=Colour(255, 255, 0);
+ DrawStyle::YELLOW.grad_col[1]=Colour(100, 100, 0);
+ DrawStyle::YELLOW.grad_pos[0]=0.5;
+ DrawStyle::YELLOW.num_colors=2;
+ DrawStyle::YELLOW.ft=DrawStyle::GradientLinear;
+ DrawStyle::YELLOW.x1=0.0;
+ DrawStyle::YELLOW.y1=0.0;
+ DrawStyle::YELLOW.x2=0.0;
+ DrawStyle::YELLOW.y2=1.0;
+
+ DrawStyle::GREY=DrawStyle(100, 100, 100);
+ DrawStyle::GREY.grad_col[0]=Colour(180, 180, 180);
+ DrawStyle::GREY.grad_col[1]=Colour(100, 100, 100);
+ DrawStyle::GREY.grad_pos[0]=0.5;
+ DrawStyle::GREY.num_colors=2;
+ DrawStyle::GREY.ft=DrawStyle::GradientLinear;
+ DrawStyle::GREY.x1=0.0;
+ DrawStyle::GREY.y1=0.0;
+ DrawStyle::GREY.x2=0.0;
+ DrawStyle::GREY.y2=1.0;
+
+ DrawStyle::DARKGREY=DrawStyle(50, 50, 50);
+ DrawStyle::DARKGREY.grad_col[0]=Colour(100, 100, 100);
+ DrawStyle::DARKGREY.grad_col[1]=Colour(50, 50, 50);
+ DrawStyle::DARKGREY.grad_pos[0]=0.5;
+ DrawStyle::DARKGREY.num_colors=2;
+ DrawStyle::DARKGREY.ft=DrawStyle::GradientLinear;
+ DrawStyle::DARKGREY.x1=0.0;
+ DrawStyle::DARKGREY.y1=0.0;
+ DrawStyle::DARKGREY.x2=0.0;
+ DrawStyle::DARKGREY.y2=1.0;
+
+
+ DrawStyle::VIDEOBLUE=DrawStyle(0, 0, 150);
+
+ DrawStyle::VIEWBACKGROUND=DrawStyle(0, 0, 100);
+ DrawStyle::VIEWBACKGROUND.grad_col[0]=Colour(0,0,160);
+ DrawStyle::VIEWBACKGROUND.num_colors=1;
+ DrawStyle::VIEWBACKGROUND.ft=DrawStyle::GradientLinear;
+ DrawStyle::VIEWBACKGROUND.x1=0.0;
+ DrawStyle::VIEWBACKGROUND.y1=0.0;
+ DrawStyle::VIEWBACKGROUND.x2=0.0;
+ DrawStyle::VIEWBACKGROUND.y2=1.0;
+
+ DrawStyle::TABVIEWBACKGROUND=DrawStyle(0, 0, 120);
+
+
+ DrawStyle::TITLEBARBACKGROUND=DrawStyle(0, 0, 160);
+ DrawStyle::TITLEBARBACKGROUND.grad_col[0]=Colour(0,0,250);
+ DrawStyle::TITLEBARBACKGROUND.num_colors=1;
+ DrawStyle::TITLEBARBACKGROUND.ft=DrawStyle::GradientLinear;
+ DrawStyle::TITLEBARBACKGROUND.x1=0.0;
+ DrawStyle::TITLEBARBACKGROUND.y1=0.0;
+ DrawStyle::TITLEBARBACKGROUND.x2=0.0;
+ DrawStyle::TITLEBARBACKGROUND.y2=1.0;
+
+
+ DrawStyle::SELECTHIGHLIGHT=DrawStyle(120, 125, 40);
+ DrawStyle::SELECTHIGHLIGHT.grad_col[0]=DrawStyle(240, 250, 80);
+ DrawStyle::SELECTHIGHLIGHT.num_colors=1;
+ DrawStyle::SELECTHIGHLIGHT.ft=DrawStyle::GradientLinear;
+ DrawStyle::SELECTHIGHLIGHT.x1=0.0;
+ DrawStyle::SELECTHIGHLIGHT.y1=0.0;
+ DrawStyle::SELECTHIGHLIGHT.x2=0.0;
+ DrawStyle::SELECTHIGHLIGHT.y2=1.0;
+
+
+ DrawStyle::SELECTDARKHIGHLIGHT=DrawStyle(120, 125, 40);
+ DrawStyle::LIGHTTEXT=DrawStyle(255, 255, 255);
+ DrawStyle::DARKTEXT=DrawStyle(0, 0, 100);
+ DrawStyle::DANGER=DrawStyle(200, 0, 0);
+
+ DrawStyle::BUTTONBACKGROUND=DrawStyle(0, 0, 100);
+ DrawStyle::BUTTONBACKGROUND.grad_col[0]=DrawStyle(0, 0, 200);
+ DrawStyle::BUTTONBACKGROUND.num_colors=1;
+ DrawStyle::BUTTONBACKGROUND.ft=DrawStyle::GradientLinear;
+ DrawStyle::BUTTONBACKGROUND.x1=0.0;
+ DrawStyle::BUTTONBACKGROUND.y1=0.0;
+ DrawStyle::BUTTONBACKGROUND.x2=0.0;
+ DrawStyle::BUTTONBACKGROUND.y2=1.0;
+
+
+ DrawStyle::PROGRAMMEB=DrawStyle(40, 40, 120); // two colours used as alterating backgrounds for individual programmes in EPG
+ DrawStyle::PROGRAMMEB.grad_col[0]=DrawStyle(80, 80, 240);
+ DrawStyle::PROGRAMMEB.num_colors=1;
+ DrawStyle::PROGRAMMEB.ft=DrawStyle::GradientLinear;
+ DrawStyle::PROGRAMMEB.x1=0.0;
+ DrawStyle::PROGRAMMEB.y1=0.0;
+ DrawStyle::PROGRAMMEB.x2=0.0;
+ DrawStyle::PROGRAMMEB.y2=1.0;
+
+
+ DrawStyle::PROGRAMMEA=DrawStyle(80, 80, 240); // TODO fit epg style (colours) in with rest of application
+ DrawStyle::PROGRAMMEA.grad_col[0]=DrawStyle(40, 40, 120);
+ DrawStyle::PROGRAMMEA.num_colors=1;
+ DrawStyle::PROGRAMMEA.ft=DrawStyle::GradientLinear;
+ DrawStyle::PROGRAMMEA.x1=0.0;
+ DrawStyle::PROGRAMMEA.y1=0.0;
+ DrawStyle::PROGRAMMEA.x2=0.0;
+ DrawStyle::PROGRAMMEA.y2=1.0;
+
+
+ DrawStyle::NOPROGRAMME=DrawStyle(180, 180, 180); // no programme details colour
+ DrawStyle::NOPROGRAMME.grad_col[0]=DrawStyle(90, 90, 90);
+ DrawStyle::NOPROGRAMME.num_colors=1;
+ DrawStyle::NOPROGRAMME.ft=DrawStyle::GradientLinear;
+ DrawStyle::NOPROGRAMME.x1=0.0;
+ DrawStyle::NOPROGRAMME.y1=0.0;
+ DrawStyle::NOPROGRAMME.x2=0.0;
+ DrawStyle::NOPROGRAMME.y2=1.0;
+
+
+ /*
+Silly colours
+
+Colour Colour::VIDEOBLUE(250, 0, 0);
+Colour Colour::VIEWBACKGROUND(100, 0, 100);
+Colour Colour::TITLEBARBACKGROUND(100, 0, 200);
+Colour Colour::SELECTHIGHLIGHT(240, 250, 180);
+Colour Colour::LIGHTTEXT(255, 0, 255);
+Colour Colour::DARKTEXT(0, 0, 255);
+Colour Colour::DANGER(200, 200, 0);
+Colour Colour::BUTTONBACKGROUND(255, 255, 255);
+ */
+}
{
public:
DrawStyle()
- { red = 0; green = 0; blue = 0; alpha = 255; }
+ { red = 0; green = 0; blue = 0; alpha = 255; ft=Color;ct=Global; }
DrawStyle(int Tred, int Tgreen, int Tblue)
- { red = Tred; green = Tgreen; blue = Tblue; alpha = 255; }
+ { red = Tred; green = Tgreen; blue = Tblue; alpha = 255 ;ft=Color;ct=Global; }
DrawStyle(int Tred, int Tgreen, int Tblue, int Talpha)
- { red = Tred; green = Tgreen; blue = Tblue; alpha = Talpha; }
+ { red = Tred; green = Tgreen; blue = Tblue; alpha = Talpha; ft=Color;ct=Global;}
+
+ enum FillType {
+ Color,
+ GradientLinear,
+ GradientRadial,
+ };
+ enum CoordType {
+ Global,
+ Local
+ };
+
+ enum FillType ft;
+ enum CoordType ct; //not implemented yet
+ float x1,y1,x2,y2,r; // Parameter for gradient either relative to object or to global coordinate system
+ int num_colors; //max is 4, min is 0
+ Colour grad_col[4];
+ float grad_pos[3]; //Last position is alway 1.0 and first 0.0
static DrawStyle BLACK;
static DrawStyle RED;
static DrawStyle GREEN;
static DrawStyle YELLOW;
static DrawStyle BLUE;
+ static DrawStyle GREY;
+ static DrawStyle DARKGREY;
static DrawStyle VIDEOBLUE;
static DrawStyle VIEWBACKGROUND;
static DrawStyle TABVIEWBACKGROUND;
};
+class SkinFactory {
+public:
+ static void InitDefaultSkin();
+ static void InitEnhancedSkin();
+};
+
#endif
initted = 0;
return 0;
}
+#ifdef GRADIENT_DRAWING
+ SkinFactory::InitEnhancedSkin();
+#else
+ SkinFactory::InitDefaultSkin();
+#endif
+
#ifndef WIN32
pthread_mutex_init(&masterLock, NULL);
#else
#define PLAYER_MAX_STREAMING_BUFFERS 120 // for video in uints of 50000 KB
#define TV_NORM_SWITCHABLE
#define HANDLE_VT_SWITCHING
+ #define GRADIENT_DRAWING
#define VOMP_LINUX_CLOCK CLOCK_MONOTONIC
{
VGfloat save_matrix[9];
+ VGfloat save_matrix2[9];
switch (command.instr) {
case DrawPath: {
vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
vgGetMatrix(save_matrix);
vgTranslate(command.x,command.y);
+
+
+
+
//vgScale(command.w,command.h);
+ VGfloat imagewidth=vgGetParameteri((VGImage) command.target.image, VG_IMAGE_WIDTH);
+ VGfloat imageheight=vgGetParameteri((VGImage) command.target.image, VG_IMAGE_HEIGHT);
if (command.reference) { //special behaviout for bw images they act as a mask on the current paint
vgSetPaint((VGPaint) command.reference,VG_FILL_PATH);
vgSetPaint((VGPaint) command.reference,VG_STROKE_PATH);
vgSeti(VG_IMAGE_MODE,VG_DRAW_IMAGE_STENCIL);
vgSeti(VG_BLEND_MODE, VG_BLEND_SRC_OVER);
vgScale(aspect_correction,1.f);
+ vgSeti(VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER);
+ vgGetMatrix(save_matrix2);
+ vgScale(0.2f,0.2f);
} else {
- VGfloat imagewidth=vgGetParameteri((VGImage) command.target.image, VG_IMAGE_WIDTH);
- VGfloat imageheight=vgGetParameteri((VGImage) command.target.image, VG_IMAGE_HEIGHT);
+
//vgScale(720.f/((float)BACKBUFFER_WIDTH), 576.f/((float)BACKBUFFER_HEIGHT));
float scalex=command.w/imagewidth;
float scaley=command.h/imageheight;
if (command.reference) {
vgSeti(VG_IMAGE_MODE,VG_DRAW_IMAGE_NORMAL);
vgSeti(VG_BLEND_MODE, VG_BLEND_SRC);
+ vgSeti(VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER);
+ vgLoadMatrix(save_matrix2);
}
+
+ vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
vgLoadMatrix(save_matrix);
} break;
case DrawGlyph: {
case OVGcreateColorRef :{
VGPaint handle;
handle=vgCreatePaint();
- vgSetParameteri(handle, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
- vgSetColor(handle,command.param1);
- VGuint rgba;
- rgba = vgGetColor((VGPaint)handle);
- Log::getInstance()->log("OSD", Log::DEBUG, "Draw Paint %d %x %x",handle,command.param1,rgba);
+ DrawStyle *style=(DrawStyle*)command.data;
+ switch (style->ft) {
+ case DrawStyle::Color: {
+ vgSetParameteri(handle, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
+ vgSetColor(handle,command.param1);
+ VGuint rgba;
+ rgba = vgGetColor((VGPaint)handle);
+ Log::getInstance()->log("OSD", Log::DEBUG, "Draw Paint %d %x %x",handle,command.param1,rgba);
+ } break;
+ case DrawStyle::GradientLinear: {
+ vgSetParameteri(handle, VG_PAINT_TYPE, VG_PAINT_TYPE_LINEAR_GRADIENT);
+ VGfloat params[]={style->x1,style->y1,style->x2,style->y2,style->r};
+ Log::getInstance()->log("OSD", Log::DEBUG, "Draw Gradient %d %g %g %g %g",handle,params[0],params[1],params[2],params[3]);
+ vgSetParameterfv(handle,VG_PAINT_LINEAR_GRADIENT,4,params);
+
+
+
+ } break;
+ case DrawStyle::GradientRadial: {
+ vgSetParameteri(handle, VG_PAINT_TYPE, VG_PAINT_TYPE_RADIAL_GRADIENT);
+ VGfloat params[]={style->x1,style->y1,style->x2,style->y2,style->r};
+ vgSetParameterfv(handle,VG_PAINT_RADIAL_GRADIENT,5,params);
+
+
+
+ } break;
+ };
+ if (style->ft==DrawStyle::GradientLinear ||style->ft==DrawStyle::GradientRadial) {
+ VGfloat colorramp[5*5];
+ colorramp[0+0*5]=0.f;
+ colorramp[1+0*5]=((float)style->red)/255.f;
+ colorramp[2+0*5]=((float)style->green)/255.f;
+ colorramp[3+0*5]=((float)style->blue)/255.f;
+ colorramp[4+0*5]=((float)style->alpha)/255.f;
+ for (int i=0;i<(style->num_colors-1);i++) {
+ colorramp[0+(i+1)*5]=style->grad_pos[i];
+ colorramp[1+(i+1)*5]=((float)style->grad_col[i].red)/255.f;
+ colorramp[2+(i+1)*5]=((float)style->grad_col[i].green)/255.f;
+ colorramp[3+(i+1)*5]=((float)style->grad_col[i].blue)/255.f;
+ colorramp[4+(i+1)*5]=((float)style->grad_col[i].alpha)/255.f;
+ }
+ colorramp[0+(style->num_colors)*5]=1.f;
+ colorramp[1+(style->num_colors)*5]=((float)style->grad_col[style->num_colors-1].red)/255.f;
+ colorramp[2+(style->num_colors)*5]=((float)style->grad_col[style->num_colors-1].green)/255.f;
+ colorramp[3+(style->num_colors)*5]=((float)style->grad_col[style->num_colors-1].blue)/255.f;
+ colorramp[4+(style->num_colors)*5]=((float)style->grad_col[style->num_colors-1].alpha)/255.f;
+ vgSetParameteri(handle, VG_PAINT_COLOR_RAMP_SPREAD_MODE,VG_COLOR_RAMP_SPREAD_REFLECT);
+ vgSetParameteri(handle, VG_PAINT_COLOR_RAMP_PREMULTIPLIED,VG_FALSE);
+ vgSetParameterfv(handle,VG_PAINT_COLOR_RAMP_STOPS,5+(style->num_colors)*5,colorramp);
+ }
+
return handle;
} break;
case OVGimageUploadLine: {
}
void Surface::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,
- unsigned int width, Colour& nextColour) {
+ unsigned int width, DrawStyle& nextColour) {
startFastDraw();
int x, y;
unsigned int bytesIn, bitsIn;
virtual void drawVertLine(int x, int y1, int y2, const DrawStyle& c)=0;
virtual void drawBitmap(int x, int y, const Bitmap& bm,const DisplayRegion & region)=0;
virtual void drawPoint(int x, int y, DrawStyle& c, bool fastdraw=false); // This draws a point, must not be a pixel
- virtual void drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,unsigned int width, Colour& nextColour);
+ virtual void drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,unsigned int width, DrawStyle& nextColour);
virtual int updateToScreen(int sx, int sy, int w, int h, int dx, int dy)=0;
virtual void readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b)=0;
virtual void screenShot(const char* fileName)=0;
commands.push_back(SVGCommand(x,y,1,1,Point,ref));
if (!fastdraw) command_mutex.Unlock();
}
-void SurfaceVector::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,unsigned int width, Colour& nextColour)
+void SurfaceVector::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,unsigned int width, DrawStyle& nextColour)
{
command_mutex.Lock();
ImageIndex image=osd->getMonoBitmapRef(base,width,height);
- unsigned int ref=osd->getColorRef(nextColour);
+ unsigned int ref=osd->getStyleRef(nextColour);
commands.push_back(SVGCommand(dx,dy,height,width,image,ref));
command_mutex.Unlock();
}
void drawVertLine(int x, int y1, int y2, const DrawStyle& c);
void drawBitmap(int x, int y, const Bitmap& bm,const DisplayRegion & region);
void drawPoint(int x, int y, DrawStyle& c, bool fastdraw=false); // This draws a point, must not be a pixel
- void drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,unsigned int width, Colour& nextColour);
+ void drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,unsigned int width, DrawStyle& nextColour);
int updateToScreen(int sx, int sy, int w, int h, int dx, int dy);
char showing[200];
sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
-
+#ifndef GRADIENT_DRAWING
rectangle(220, 385,160, 25, DrawStyle::VIEWBACKGROUND);
+#endif
drawText(showing, 220, 385, DrawStyle::LIGHTTEXT);
}
+void VChannelList::quickUpdate() { //only quick for plattform that need it!
+#ifdef GRADIENT_DRAWING
+ draw();
+#else
+ sl.draw();
+ doShowingBar();
+#endif
+}
+
int VChannelList::handleCommand(int command)
{
switch(command)
case Remote::UP:
{
sl.up();
- sl.draw();
+ quickUpdate();
- doShowingBar();
boxstack->update(this);
return 2;
}
case Remote::DOWN:
{
sl.down();
- sl.draw();
+ quickUpdate();
- doShowingBar();
boxstack->update(this);
return 2;
}
case Remote::SKIPBACK:
{
sl.pageUp();
- sl.draw();
+ quickUpdate();
- doShowingBar();
boxstack->update(this);
return 2;
}
case Remote::SKIPFORWARD:
{
sl.pageDown();
- sl.draw();
+ quickUpdate();
- doShowingBar();
boxstack->update(this);
return 2;
}
{
if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
- sl.draw();
- doShowingBar();
+ quickUpdate();
boxstack->update(this);
}
}
{
public:
VChannelList(ULONG type);
- ~VChannelList();
+ virtual ~VChannelList();
void setList(ChannelList* chanList);
void highlightChannel(Channel* channel);
WSelectList sl;
void doShowingBar();
+ void quickUpdate();
};
#endif
UINT keyx = chanListbox.getRootBoxOffsetX();
UINT keyy = chanListbox.getRootBoxOffsetY() + chanListbox.getHeight() + 2;
- DrawStyle ref1 = DrawStyle(100, 100, 100, 255); //to do global definition for skin
- rectangle(keyx, keyy, 605, getFontHeight() * 2 + 14, ref1);
+ rectangle(keyx, keyy, 605, getFontHeight() * 2 + 14, DrawStyle::DARKGREY);
WSymbol w;
TEMPADD(&w);
drawText(tr("OK"), keyx + 18, keyy + 20, DrawStyle::LIGHTTEXT);
- DrawStyle ref2 = DrawStyle(200, 0, 0, 255);
- rectangle(keyx + 72, keyy + 4, 104, getFontHeight() + 2, ref2);
+ rectangle(keyx + 72, keyy + 4, 104, getFontHeight() + 2, DrawStyle::RED);
drawText(tr("Page up"), keyx + 74, keyy + 5, DrawStyle::LIGHTTEXT);
- DrawStyle ref3 = DrawStyle(0, 200, 0, 255);
- rectangle(keyx + 72, keyy + getFontHeight() + 8, 104, getFontHeight() + 2, ref3);
+ rectangle(keyx + 72, keyy + getFontHeight() + 8, 104, getFontHeight() + 2, DrawStyle::GREEN);
drawText(tr("Page down"), keyx + 74, keyy + getFontHeight() + 9, DrawStyle::LIGHTTEXT);
- DrawStyle ref4 = DrawStyle(200, 200, 0, 255);
- rectangle(keyx + 180, keyy + 4, 104, getFontHeight() + 2, ref4);
+ rectangle(keyx + 180, keyy + 4, 104, getFontHeight() + 2, DrawStyle::YELLOW);
drawText(tr("-24 hours"), keyx + 182, keyy + 5, DrawStyle::LIGHTTEXT);
- DrawStyle ref5 = DrawStyle(0, 0, 200, 255);
- rectangle(keyx + 180, keyy + getFontHeight() + 8, 104, getFontHeight() + 2, ref5);
+ rectangle(keyx + 180, keyy + getFontHeight() + 8, 104, getFontHeight() + 2, DrawStyle::BLUE);
drawText(tr("+24 hours"), keyx + 182, keyy + getFontHeight() + 9, DrawStyle::LIGHTTEXT);
- DrawStyle ref6 = DrawStyle(180, 180, 180, 255);
- rectangle(keyx + 290, keyy + 4, 180, getFontHeight() + 2, ref6);
+ rectangle(keyx + 290, keyy + 4, 180, getFontHeight() + 2, DrawStyle::GREY);
drawText(tr("Guide / Back: Close"), keyx + 292 , keyy + 5, DrawStyle::LIGHTTEXT);
- DrawStyle ref7 = DrawStyle(180, 180, 180, 255);
- rectangle(keyx + 290, keyy + getFontHeight() + 8, 180, getFontHeight() + 2, ref7);
+ rectangle(keyx + 290, keyy + getFontHeight() + 8, 180, getFontHeight() + 2, DrawStyle::GREY);
DrawStyle red = DrawStyle(130, 0, 0);
drawText(tr("Rec: Set timer"), keyx + 292, keyy + getFontHeight() + 9, red);
- DrawStyle ref8 = DrawStyle(180, 180, 180, 255);
- rectangle(keyx + 474, keyy + 4, 128, getFontHeight() + 2, ref8);
+ rectangle(keyx + 474, keyy + 4, 128, getFontHeight() + 2, DrawStyle::GREY);
w.nextSymbol = WSymbol::PLAY;
w.setPosition(keyx + 476, keyy + 5);
w.draw();
drawText(tr("Sel channel"), keyx + 496, keyy + 5, DrawStyle::LIGHTTEXT);
- DrawStyle ref9 = DrawStyle(180, 180, 180, 255);
- rectangle(keyx + 474, keyy + getFontHeight() + 8, 128, getFontHeight() + 2, ref9);
+ rectangle(keyx + 474, keyy + getFontHeight() + 8, 128, getFontHeight() + 2, DrawStyle::GREY);
drawText(tr("Go: Preview"), keyx + 476, keyy + getFontHeight() + 9, DrawStyle::LIGHTTEXT);
{
int topOption = sl.getTopOption() + 1;
if (sl.getNumOptions() == 0) topOption = 0;
-
+#ifndef GRADIENT_DRAWING
rectangle(220, 385, 180, 25, DrawStyle::VIEWBACKGROUND);
+#endif
char showing[200];
sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
drawText(showing, 220, 385, DrawStyle::LIGHTTEXT);
}
+void VRecordingList::quickUpdate() { //only quick for plattform that need it!
+#ifdef GRADIENT_DRAWING
+ draw();
+#else
+ sl.draw();
+ doShowingBar();
+#endif
+}
+
void VRecordingList::processMessage(Message* m)
{
Log::getInstance()->log("VRecordingList", Log::DEBUG, "Got message value %lu", m->message);
{
if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
- sl.draw();
- doShowingBar();
+ quickUpdate();
boxstack->update(this);
}
}
case Remote::UP:
{
sl.up();
- sl.draw();
+ quickUpdate();
- doShowingBar();
boxstack->update(this);
return 2;
}
case Remote::DOWN:
{
sl.down();
- sl.draw();
+ quickUpdate();
- doShowingBar();
boxstack->update(this);
return 2;
}
case Remote::SKIPBACK:
{
sl.pageUp();
- sl.draw();
+ quickUpdate();
- doShowingBar();
boxstack->update(this);
return 2;
}
case Remote::SKIPFORWARD:
{
sl.pageDown();
- sl.draw();
+ quickUpdate();
- doShowingBar();
boxstack->update(this);
return 2;
}
{
public:
VRecordingList();
- ~VRecordingList();
+ virtual ~VRecordingList();
int handleCommand(int command);
void processMessage(Message* m);
WSelectList sl;
+ void quickUpdate();
void doShowingBar();
void doDeleteSelected();
int doPlay(bool resume);
{
int topOption = sl.getTopOption() + 1;
if (sl.getNumOptions() == 0) topOption = 0;
-
+#ifndef GRADIENT_DRAWING
rectangle(220, 385, 180, 25, DrawStyle::VIEWBACKGROUND);
+#endif
char showing[200];
sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
drawText(showing, 220, 385, DrawStyle::LIGHTTEXT);
}
+void VTimerList::quickUpdate() { //only quick for plattform that need it!
+#ifdef GRADIENT_DRAWING
+ draw();
+#else
+ sl.draw();
+ drawShowing();
+ drawIndicators();
+#endif
+}
+
void VTimerList::drawIndicators()
{
int top = sl.getTopOption();
int bottom = sl.getBottomOption();
int yinc = getFontHeight() + 1;
RecTimer* recTimer;
-
+#ifndef GRADIENT_DRAWING
rectangle(6, 44, 18, 15*yinc, DrawStyle::VIEWBACKGROUND);
-
+#endif
// The indexes recorded from the wselectlist into the index member of the RecTimer
// Is the same as the position in the vector of RecTimers
// Because they are in order, they don't change order and wselectlist starts from 0 up consecutively
case Remote::UP:
{
sl.up();
- sl.draw();
- drawShowing();
- drawIndicators();
+ quickUpdate();
BoxStack::getInstance()->update(this);
return 2;
}
case Remote::DOWN:
{
sl.down();
- sl.draw();
- drawShowing();
- drawIndicators();
+ quickUpdate();
BoxStack::getInstance()->update(this);
return 2;
}
case Remote::SKIPBACK:
{
sl.pageUp();
- sl.draw();
- drawShowing();
- drawIndicators();
+ quickUpdate();
BoxStack::getInstance()->update(this);
return 2;
}
case Remote::SKIPFORWARD:
{
sl.pageDown();
- sl.draw();
- drawShowing();
- drawIndicators();
+ quickUpdate();
BoxStack::getInstance()->update(this);
return 2;
}
{
if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY()))
{
- sl.draw();
+ quickUpdate();
BoxStack::getInstance()->update(this);
}
}
void drawShowing();
void drawData();
void drawIndicators();
+ void quickUpdate();
Region clockRegion;
Region indicatorsRegion;
//TODO add vector based Symbols
void draw();
UCHAR nextSymbol;
- Colour nextColour;
+ DrawStyle nextColour;
bool mouseLBDOWN(int x, int y);