From d4c8c6511f15385bc8ba54ba9700c7b3f56d6be2 Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Fri, 21 Sep 2012 20:39:35 +0200 Subject: [PATCH] Interface changes, introducing DrawStyle, preparation for Vector based OSD --- boxx.cc | 28 +++++++------- boxx.h | 20 +++++----- colour.cc | 36 +++++++++--------- colour.h | 55 +++++++++++++++++---------- command.cc | 6 +-- surface.cc | 15 ++++---- surface.h | 14 +++---- surfacemvp.cc | 8 ++-- surfacemvp.h | 6 +-- surfaceopengl.cc | 8 ++-- surfaceopengl.h | 6 +-- surfacewin.cc | 9 +++-- surfacewin.h | 6 +-- tbboxx.cc | 10 ++--- tbboxx.h | 4 +- vaudioselector.cc | 6 +-- vaudioselector.h | 2 +- vchannellist.cc | 6 +-- vchannelselect.cc | 6 +-- vepg.cc | 86 +++++++++++++++++++++--------------------- vepg.h | 2 +- vepgsettimer.cc | 10 ++--- vinfo.cc | 8 ++-- vmute.cc | 2 +- vopts.cc | 2 +- vpicturebanner.cc | 14 +++---- vquestion.cc | 2 +- vradiorec.cc | 24 ++++++------ vradiorec.h | 2 +- vrecmove.cc | 4 +- vrecording.cc | 4 +- vrecordinglist.cc | 18 ++++----- vrecordingmenu.cc | 4 +- vscreensaver.cc | 9 +++-- vserverselect.cc | 2 +- vsleeptimer.cc | 10 ++--- vtimeredit.cc | 44 ++++++++++----------- vtimerlist.cc | 28 +++++++------- vvideolivetv.cc | 25 ++++++------ vvideolivetv.h | 3 +- vvideomedia.cc | 12 +++--- vvideomedia.h | 4 +- vvideorec.cc | 26 ++++++------- vvideorec.h | 4 +- vvolume.cc | 2 +- vwelcome.cc | 4 +- wbutton.cc | 12 +++--- woptionbox.cc | 16 ++++---- woptionpane.cc | 2 +- wprogressbar.cc | 10 ++--- wremoteconfig.cc | 10 ++--- wselectlist.cc | 15 ++++---- wselectlist.h | 8 ++-- wsymbol.cc | 2 +- wtabbar.cc | 32 ++++++++-------- wtextbox.cc | 7 ++-- wtextbox.h | 6 +-- wwinaudiofilter.cc | 18 ++++----- wwinmp3audiofilter.cc | 18 ++++----- wwinvideofilter.cc | 18 ++++----- wwinvideoh264filter.cc | 18 ++++----- 61 files changed, 412 insertions(+), 386 deletions(-) diff --git a/boxx.cc b/boxx.cc index e8ca58a..1e0935f 100644 --- a/boxx.cc +++ b/boxx.cc @@ -113,7 +113,7 @@ void Boxx::setParent(Boxx* newParent) parent = newParent; } -void Boxx::setBackgroundColour(const Colour& Tcolour) +void Boxx::setBackgroundColour(const DrawStyle& Tcolour) { backgroundColour = Tcolour; backgroundColourSet = true; @@ -234,12 +234,12 @@ void Boxx::getRootBoxRegion(Region* r) // Level 1 drawing functions -void Boxx::fillColour(const Colour& colour) +void Boxx::fillColour(const DrawStyle& colour) { rectangle(0, 0, area.w, area.h, colour); } -void Boxx::drawPara(const char* text, int x, int y, const Colour& colour) +void Boxx::drawPara(const char* text, int x, int y, const DrawStyle& colour) { char line[256]; int lineHeight = getFontHeight() + paraVSpace; @@ -315,41 +315,41 @@ void Boxx::drawPara(const char* text, int x, int y, const Colour& colour) } } -void Boxx::rectangle(Region& region, const Colour& colour) +void Boxx::rectangle(Region& region, const DrawStyle& colour) { rectangle(region.x, region.y, region.w, region.h, colour); } // Level 0 drawing functions -void Boxx::rectangle(UINT x, UINT y, UINT w, UINT h, const Colour& colour) +void Boxx::rectangle(UINT x, UINT y, UINT w, UINT h, const DrawStyle& colour) { if (parent) parent->rectangle(area.x + x, area.y + y, w, h, colour); - else surface->fillblt(x, y, w, h, colour.rgba()); + else surface->fillblt(x, y, w, h, colour); } -void Boxx::drawText(const char* text, int x, int y, const Colour& colour) +void Boxx::drawText(const char* text, int x, int y, const DrawStyle& colour) { if (parent) parent->drawText(text, area.x + x, area.y + y, colour); - else surface->drawText(text, x, y, colour.rgba()); + else surface->drawText(text, x, y, colour); } -void Boxx::drawText(const char* text, int x, int y, int width, const Colour& colour) +void Boxx::drawText(const char* text, int x, int y, int width, const DrawStyle& colour) { if (parent) parent->drawText(text, area.x + x, area.y + y, width, colour); - else surface->drawText(text, x, y, width, colour.rgba()); + else surface->drawText(text, x, y, width, colour); } -void Boxx::drawTextRJ(const char* text, int x, int y, const Colour& colour) +void Boxx::drawTextRJ(const char* text, int x, int y, const DrawStyle& colour) { if (parent) parent->drawTextRJ(text, area.x + x, area.y + y, colour); - else surface->drawTextRJ(text, x, y, colour.rgba()); + else surface->drawTextRJ(text, x, y, colour); } -void Boxx::drawTextCentre(const char* text, int x, int y, const Colour& colour) +void Boxx::drawTextCentre(const char* text, int x, int y, const DrawStyle& colour) { if (parent) parent->drawTextCentre(text, area.x + x, area.y + y, colour); - else surface->drawTextCentre(text, x, y, colour.rgba()); + else surface->drawTextCentre(text, x, y, colour); } // Now deprecated /* diff --git a/boxx.h b/boxx.h index 02f8f5f..a97c895 100644 --- a/boxx.h +++ b/boxx.h @@ -49,7 +49,7 @@ class Boxx void setGap(UINT gap); - void setBackgroundColour(const Colour& colour); + void setBackgroundColour(const DrawStyle& colour); void setVisible(bool isVisible); @@ -90,17 +90,17 @@ class Boxx void getRootBoxRegion(Region*); // Drawing functions level 1 - void fillColour(const Colour& colour); - void drawPara(const char* text, int x, int y, const Colour& colour); + void fillColour(const DrawStyle & colour); + void drawPara(const char* text, int x, int y, const DrawStyle& colour); // Drawing functions level 0 - void rectangle(UINT x, UINT y, UINT w, UINT h, const Colour& colour); - void rectangle(Region& region, const Colour& colour); + void rectangle(UINT x, UINT y, UINT w, UINT h, const DrawStyle& colour); + void rectangle(Region& region, const DrawStyle& colour); - void drawText(const char* text, int x, int y, const Colour& colour); - void drawText(const char* text, int x, int y, int width, const Colour& colour); - void drawTextRJ(const char* text, int x, int y, const Colour& colour); - void drawTextCentre(const char* text, int x, int y, const Colour& colour); + void drawText(const char* text, int x, int y, const DrawStyle& colour); + void drawText(const char* text, int x, int y, int width, const DrawStyle& colour); + void drawTextRJ(const char* text, int x, int y, const DrawStyle& colour); + void drawTextCentre(const char* text, int x, int y, const DrawStyle& colour); //Now deprecated //void drawPixel(UINT x, UINT y, const Colour& colour, bool fastdraw=false); void drawBitmap(UINT x, UINT y, const Bitmap& bm); @@ -146,7 +146,7 @@ class Boxx static const int paraMargin = 10; UINT paraVSpace; - Colour backgroundColour; + DrawStyle backgroundColour; bool backgroundColourSet; bool visible; diff --git a/colour.cc b/colour.cc index f1b8f68..82bfa83 100644 --- a/colour.cc +++ b/colour.cc @@ -23,24 +23,24 @@ /* Real colours */ -Colour Colour::BLACK(0, 0, 0); -Colour Colour::RED(255, 0, 0); -Colour Colour::GREEN(0, 255, 0); -Colour Colour::BLUE(0, 0, 255); -Colour Colour::YELLOW(255, 255, 0); -Colour Colour::VIDEOBLUE(0, 0, 150); -Colour Colour::VIEWBACKGROUND(0, 0, 100); -Colour Colour::TABVIEWBACKGROUND(0, 0, 120); -Colour Colour::TITLEBARBACKGROUND(0, 0, 200); -Colour Colour::SELECTHIGHLIGHT(240, 250, 80); -Colour Colour::SELECTDARKHIGHLIGHT(120, 125, 40); -Colour Colour::LIGHTTEXT(255, 255, 255); -Colour Colour::DARKTEXT(0, 0, 100); -Colour Colour::DANGER(200, 0, 0); -Colour Colour::BUTTONBACKGROUND(0, 0, 200); -Colour Colour::PROGRAMMEB(80, 80, 240); // two colours used as alterating backgrounds for individual programmes in EPG -Colour Colour::PROGRAMMEA(40, 40, 120); // TODO fit epg style (colours) in with rest of application -Colour Colour::NOPROGRAMME(180, 180, 180); // no programme details colour +DrawStyle DrawStyle::BLACK(0, 0, 0); +DrawStyle DrawStyle::RED(255, 0, 0); +DrawStyle DrawStyle::GREEN(0, 255, 0); +DrawStyle DrawStyle::BLUE(0, 0, 255); +DrawStyle DrawStyle::YELLOW(255, 255, 0); +DrawStyle DrawStyle::VIDEOBLUE(0, 0, 150); +DrawStyle DrawStyle::VIEWBACKGROUND(0, 0, 100); +DrawStyle DrawStyle::TABVIEWBACKGROUND(0, 0, 120); +DrawStyle DrawStyle::TITLEBARBACKGROUND(0, 0, 200); +DrawStyle DrawStyle::SELECTHIGHLIGHT(240, 250, 80); +DrawStyle DrawStyle::SELECTDARKHIGHLIGHT(120, 125, 40); +DrawStyle DrawStyle::LIGHTTEXT(255, 255, 255); +DrawStyle DrawStyle::DARKTEXT(0, 0, 100); +DrawStyle DrawStyle::DANGER(200, 0, 0); +DrawStyle DrawStyle::BUTTONBACKGROUND(0, 0, 200); +DrawStyle DrawStyle::PROGRAMMEB(80, 80, 240); // two colours used as alterating backgrounds for individual programmes in EPG +DrawStyle DrawStyle::PROGRAMMEA(40, 40, 120); // TODO fit epg style (colours) in with rest of application +DrawStyle DrawStyle::NOPROGRAMME(180, 180, 180); // no programme details colour /* diff --git a/colour.h b/colour.h index 9c9687c..9f358c3 100644 --- a/colour.h +++ b/colour.h @@ -39,7 +39,7 @@ class Colour void set(int Tred, int Tgreen, int Tblue, int Talpha) { red = Tred; green = Tgreen; blue = Tblue; alpha = Talpha; } - unsigned long rgba() const + inline unsigned long rgba() const { return (alpha << 24) | (red << 16) | (green << 8) | blue; } @@ -49,26 +49,43 @@ class Colour int blue; int alpha; - static Colour BLACK; - static Colour RED; - static Colour GREEN; - static Colour YELLOW; - static Colour BLUE; - static Colour VIDEOBLUE; - static Colour VIEWBACKGROUND; - static Colour TABVIEWBACKGROUND; - static Colour TITLEBARBACKGROUND; - static Colour SELECTHIGHLIGHT; - static Colour SELECTDARKHIGHLIGHT; - static Colour LIGHTTEXT; - static Colour DARKTEXT; - static Colour DANGER; - static Colour BUTTONBACKGROUND; - static Colour PROGRAMMEA; - static Colour PROGRAMMEB; - static Colour NOPROGRAMME; + +}; + +// TODO move to seperate File +class DrawStyle: public Colour +{ +public: + DrawStyle() + { red = 0; green = 0; blue = 0; alpha = 255; } + + DrawStyle(int Tred, int Tgreen, int Tblue) + { red = Tred; green = Tgreen; blue = Tblue; alpha = 255; } + + DrawStyle(int Tred, int Tgreen, int Tblue, int Talpha) + { red = Tred; green = Tgreen; blue = Tblue; alpha = Talpha; } + + static DrawStyle BLACK; + static DrawStyle RED; + static DrawStyle GREEN; + static DrawStyle YELLOW; + static DrawStyle BLUE; + static DrawStyle VIDEOBLUE; + static DrawStyle VIEWBACKGROUND; + static DrawStyle TABVIEWBACKGROUND; + static DrawStyle TITLEBARBACKGROUND; + static DrawStyle SELECTHIGHLIGHT; + static DrawStyle SELECTDARKHIGHLIGHT; + static DrawStyle LIGHTTEXT; + static DrawStyle DARKTEXT; + static DrawStyle DANGER; + static DrawStyle BUTTONBACKGROUND; + static DrawStyle PROGRAMMEA; + static DrawStyle PROGRAMMEB; + static DrawStyle NOPROGRAMME; + }; #endif diff --git a/command.cc b/command.cc index c7ce89c..a60e39f 100644 --- a/command.cc +++ b/command.cc @@ -132,7 +132,7 @@ void Command::doWallpaper() Boxx* bbg = new Boxx(); bbg->setSize(video->getScreenWidth(), video->getScreenHeight()); bbg->createBuffer(); - bbg->fillColour(Colour::VIDEOBLUE); + bbg->fillColour(DrawStyle::VIDEOBLUE); boxstack->add(bbg); boxstack->update(bbg); boxstack->remove(bbg); @@ -566,7 +566,7 @@ void Command::doFromTheTop(bool which) connLost->setOneLiner(tr("Connection lost")); connLost->setDropThrough(); connLost->setBorderOn(1); - connLost->setTitleBarColour(Colour::DANGER); + connLost->setTitleBarColour(DrawStyle::DANGER); connLost->okButton(); connLost->draw(); boxstack->add(connLost); @@ -633,7 +633,7 @@ void Command::buildCrashedBox() crash->setPosition(180, 96); crash->setMainText("Oops, vomp crashed.. :(\nPlease report this crash to the author, with as much detail as possible about what you were doing at the time that might have caused the crash."); crash->setBorderOn(1); - crash->setTitleBarColour(Colour::DANGER); + crash->setTitleBarColour(DrawStyle::DANGER); crash->okButton(); crash->setExitable(); crash->draw(); diff --git a/surface.cc b/surface.cc index 6860cfa..f8556fa 100644 --- a/surface.cc +++ b/surface.cc @@ -89,12 +89,12 @@ Surface* Surface::getScreen() return screen; } -int Surface::drawText(const char* text, int x, int y, ULONG rgba) +int Surface::drawText(const char* text, int x, int y, const DrawStyle& c) { - return drawText(text, x, y, 2000, rgba); + return drawText(text, x, y, 2000, c); } -int Surface::drawText(const char* text, int x, int y, int width, ULONG rgba) +int Surface::drawText(const char* text, int x, int y, int width, const DrawStyle& c) { int h, n, i; int Y, X, cx; @@ -104,6 +104,7 @@ int Surface::drawText(const char* text, int x, int y, int width, ULONG rgba) X = 0; cx = 0; + ULONG rgba=c.rgba(); startFastDraw(); for (i=0; iEndPainting(); srf_mutex.Unlock(); - unsigned int my_c=InternalColour(c); + unsigned int my_c=InternalColour(c.rgba()); int iheight=height; if (height+y>sheight) iheight=sheight-y; @@ -188,12 +188,12 @@ void SurfaceOpenGL::drawPixel(int x, int y, unsigned int c, bool fastdraw) { } -void SurfaceOpenGL::drawHorzLine(int x1, int x2, int y, unsigned int c) +void SurfaceOpenGL::drawHorzLine(int x1, int x2, int y, const DrawStyle& c) { fillblt(x1, y, x2-x1, 1, c); } -void SurfaceOpenGL::drawVertLine(int x, int y1, int y2, unsigned int c) +void SurfaceOpenGL::drawVertLine(int x, int y1, int y2, const DrawStyle& c) { fillblt(x, y1, 1, y2-y1, c); } diff --git a/surfaceopengl.h b/surfaceopengl.h index 48b3509..51198c9 100644 --- a/surfaceopengl.h +++ b/surfaceopengl.h @@ -38,10 +38,10 @@ class SurfaceOpenGL : public Surface void startFastDraw(); void endFastDraw(); - int fillblt(int x, int y, int width, int height, unsigned int c); + int fillblt(int x, int y, int width, int height, const DrawStyle& c); - void drawHorzLine(int x1, int x2, int y, unsigned int c); - void drawVertLine(int x, int y1, int y2, unsigned int c); + void drawHorzLine(int x1, int x2, int y, const DrawStyle& c); + void drawVertLine(int x, int y1, int y2, const DrawStyle& c); void drawBitmap(int x, int y, const Bitmap& bm); int updateToScreen(int sx, int sy, int w, int h, int dx, int dy); void readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b); diff --git a/surfacewin.cc b/surfacewin.cc index 373a0c7..c3477de 100644 --- a/surfacewin.cc +++ b/surfacewin.cc @@ -92,7 +92,7 @@ void SurfaceWin::display() { } -int SurfaceWin::fillblt(int x, int y, int width, int height, unsigned int c) +int SurfaceWin::fillblt(int x, int y, int width, int height, const DrawStyle& c) { WaitForSingleObject(event,INFINITE); //since this might be called before surface //allocation we will wait in this case, hopefully without deadlocks @@ -101,6 +101,7 @@ int SurfaceWin::fillblt(int x, int y, int width, int height, unsigned int c) if (!d3dsurface) { return 0; //why does this happen } + ULONG col=c.rgba(); LPDIRECT3DDEVICE9 d3ddev=osd->getD3dDev(); @@ -126,7 +127,7 @@ int SurfaceWin::fillblt(int x, int y, int width, int height, unsigned int c) for (line=0;linelog("TBBoxx", Log::DEBUG, "Draw: %d",this); - fillColour(Colour::VIEWBACKGROUND); + fillColour(DrawStyle::VIEWBACKGROUND); if (borderOn) { rectangle(0, 0, area.w, area.h, titleBarColour); - rectangle(5, 5, area.w-10, area.h-10, Colour::VIEWBACKGROUND); + rectangle(5, 5, area.w-10, area.h-10, DrawStyle::VIEWBACKGROUND); } if (titleBarOn) @@ -60,15 +60,15 @@ void TBBoxx::draw() rectangle(0, 0, area.w, 30, titleBarColour); if (titleText) { - if (titleBarTextWidth) drawText(titleText, 5, 5, titleBarTextWidth, Colour::LIGHTTEXT); - else drawText(titleText, 5, 5, Colour::LIGHTTEXT); + if (titleBarTextWidth) drawText(titleText, 5, 5, titleBarTextWidth, DrawStyle::LIGHTTEXT); + else drawText(titleText, 5, 5, DrawStyle::LIGHTTEXT); } } Boxx::draw(); } -void TBBoxx::setTitleBarColour(const Colour& Tcolour) +void TBBoxx::setTitleBarColour(const DrawStyle& Tcolour) { titleBarColour = Tcolour; } diff --git a/tbboxx.h b/tbboxx.h index cde6cdd..182366e 100644 --- a/tbboxx.h +++ b/tbboxx.h @@ -41,7 +41,7 @@ class TBBoxx : public Boxx void setTitleBarOn(UCHAR on); void setTitleText(const char* title, int width=0); - void setTitleBarColour(const Colour& colour); + void setTitleBarColour(const DrawStyle& colour); char* getTitleText() { return titleText; }; private: @@ -50,7 +50,7 @@ class TBBoxx : public Boxx int titleBarTextWidth; protected: - Colour titleBarColour; + DrawStyle titleBarColour; UCHAR titleBarOn; }; diff --git a/vaudioselector.cc b/vaudioselector.cc index 4908b4f..c6103c7 100644 --- a/vaudioselector.cc +++ b/vaudioselector.cc @@ -448,10 +448,10 @@ void VAudioSelector::draw() // FIXME bad drawing - rectangle(0, 0, area.w, 30, Colour::TITLEBARBACKGROUND); - drawText(tr("Audio"), 45, 5, Colour::LIGHTTEXT); + rectangle(0, 0, area.w, 30, DrawStyle::TITLEBARBACKGROUND); + drawText(tr("Audio"), 45, 5, DrawStyle::LIGHTTEXT); if (subtitles) { - drawText(tr("Subtitles"), 45+200, 5, Colour::LIGHTTEXT); + drawText(tr("Subtitles"), 45+200, 5, DrawStyle::LIGHTTEXT); ssl.setBackgroundColour(backgroundColour); ssl.draw(); } diff --git a/vaudioselector.h b/vaudioselector.h index 09d8afc..bf2f36d 100644 --- a/vaudioselector.h +++ b/vaudioselector.h @@ -66,7 +66,7 @@ class VAudioSelector : public TBBoxx VAudioSelector(void* parent, Channel* channel); - ~VAudioSelector(); + virtual ~VAudioSelector(); int handleCommand(int command); void processMessage(Message* m); diff --git a/vchannellist.cc b/vchannellist.cc index 3ec7713..d49955c 100644 --- a/vchannellist.cc +++ b/vchannellist.cc @@ -55,7 +55,7 @@ VChannelList::VChannelList(ULONG type) { setTitleText(tr("Radio Stations")); } - setTitleBarColour(Colour::TITLEBARBACKGROUND); + setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); sl.setPosition(10, 30 + 5); sl.setSize(area.w - 20, area.h - 30 - 15 - 30); @@ -149,8 +149,8 @@ void VChannelList::doShowingBar() char showing[200]; sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions()); - rectangle(220, 385, 220+160, 385+25, Colour::VIEWBACKGROUND); - drawText(showing, 220, 385, Colour::LIGHTTEXT); + rectangle(220, 385, 220+160, 385+25, DrawStyle::VIEWBACKGROUND); + drawText(showing, 220, 385, DrawStyle::LIGHTTEXT); } int VChannelList::handleCommand(int command) diff --git a/vchannelselect.cc b/vchannelselect.cc index 5408ee1..8871008 100644 --- a/vchannelselect.cc +++ b/vchannelselect.cc @@ -45,7 +45,7 @@ VChannelSelect::VChannelSelect(Boxx* v) setSize((numWidth*10) + 22, 30); // 10 px = width of number chars in font createBuffer(); setPosition(80, 60); - setBackgroundColour(Colour::VIEWBACKGROUND); + setBackgroundColour(DrawStyle::VIEWBACKGROUND); } VChannelSelect::~VChannelSelect() @@ -82,12 +82,12 @@ void VChannelSelect::draw() { if (input[i] == -1) { - drawText("_", 7 + ((numWidth - 1 - i) * 10), 5, Colour::LIGHTTEXT); + drawText("_", 7 + ((numWidth - 1 - i) * 10), 5, DrawStyle::LIGHTTEXT); } else { sprintf(text, "%i", input[i]); - drawText(text, 7 + ((numWidth - 1 - i) * 10), 5, Colour::LIGHTTEXT); + drawText(text, 7 + ((numWidth - 1 - i) * 10), 5, DrawStyle::LIGHTTEXT); } } } diff --git a/vepg.cc b/vepg.cc index 5505eb8..a8c79b2 100644 --- a/vepg.cc +++ b/vepg.cc @@ -106,19 +106,19 @@ VEpg::VEpg(void* tparent, UINT tcurrentChannelIndex, ULONG streamType) setPosition(xpos, ypos); // beautify -// Colour transparent = Colour(0, 0, 0, 0); +// DrawStyle transparent = DrawStyle(0, 0, 0, 0); // setBackgroundColour(transparent); // progTitle.setSurface(surface); progTitle.setPosition(0,0); progTitle.setSize(300,(getFontHeight() + 4) * 2 + 16); //paragraph line seperation is 4 pixels - progTitle.setBackgroundColour(Colour::TITLEBARBACKGROUND); + progTitle.setBackgroundColour(DrawStyle::TITLEBARBACKGROUND); progTitle.setTextPos(5, 16); progTitle.setGap(4); add(&progTitle); // progInfo.setSurface(surface); - progInfo.setBackgroundColour(Colour::VIEWBACKGROUND); + progInfo.setBackgroundColour(DrawStyle::VIEWBACKGROUND); progInfo.setPosition(0, progTitle.getY2()); progInfo.setSize(300,((getFontHeight() + 4) * summaryLines) + summaryLowerPadding); progInfo.setGap(4); @@ -127,7 +127,7 @@ VEpg::VEpg(void* tparent, UINT tcurrentChannelIndex, ULONG streamType) // chanName.setSurface(surface); chanName.setSize(510, (getFontHeight() + 4)); chanName.setPosition(305, chanNameYpos); - Colour t1(0, 0, 0, 90); + DrawStyle t1(0, 0, 0, 90); chanName.setBackgroundColour(t1); add(&chanName); @@ -227,7 +227,7 @@ void VEpg::draw() { // View::draw(); // draw pallet // beautify - Colour transparent = Colour(0, 0, 0, 0); + DrawStyle transparent = DrawStyle(0, 0, 0, 0); fillColour(transparent); @@ -237,7 +237,7 @@ void VEpg::draw() UINT keyx = chanListbox.getRootBoxOffsetX(); UINT keyy = chanListbox.getRootBoxOffsetY() + chanListbox.getHeight() + 2; - Colour ref1 = Colour(100, 100, 100, 255); + DrawStyle ref1 = DrawStyle(100, 100, 100, 255); //to do global definition for skin rectangle(keyx, keyy, 605, getFontHeight() * 2 + 14, ref1); WSymbol w; @@ -259,43 +259,43 @@ void VEpg::draw() w.setPosition(keyx + 50, keyy + 20); w.draw(); - drawText(tr("OK"), keyx + 18, keyy + 20, Colour::LIGHTTEXT); + drawText(tr("OK"), keyx + 18, keyy + 20, DrawStyle::LIGHTTEXT); - Colour ref2 = Colour(200, 0, 0, 255); + DrawStyle ref2 = DrawStyle(200, 0, 0, 255); rectangle(keyx + 72, keyy + 4, 104, getFontHeight() + 2, ref2); - drawText(tr("Page up"), keyx + 74, keyy + 5, Colour::LIGHTTEXT); + drawText(tr("Page up"), keyx + 74, keyy + 5, DrawStyle::LIGHTTEXT); - Colour ref3 = Colour(0, 200, 0, 255); + DrawStyle ref3 = DrawStyle(0, 200, 0, 255); rectangle(keyx + 72, keyy + getFontHeight() + 8, 104, getFontHeight() + 2, ref3); - drawText(tr("Page down"), keyx + 74, keyy + getFontHeight() + 9, Colour::LIGHTTEXT); + drawText(tr("Page down"), keyx + 74, keyy + getFontHeight() + 9, DrawStyle::LIGHTTEXT); - Colour ref4 = Colour(200, 200, 0, 255); + DrawStyle ref4 = DrawStyle(200, 200, 0, 255); rectangle(keyx + 180, keyy + 4, 104, getFontHeight() + 2, ref4); - drawText(tr("-24 hours"), keyx + 182, keyy + 5, Colour::LIGHTTEXT); + drawText(tr("-24 hours"), keyx + 182, keyy + 5, DrawStyle::LIGHTTEXT); - Colour ref5 = Colour(0, 0, 200, 255); + DrawStyle ref5 = DrawStyle(0, 0, 200, 255); rectangle(keyx + 180, keyy + getFontHeight() + 8, 104, getFontHeight() + 2, ref5); - drawText(tr("+24 hours"), keyx + 182, keyy + getFontHeight() + 9, Colour::LIGHTTEXT); + drawText(tr("+24 hours"), keyx + 182, keyy + getFontHeight() + 9, DrawStyle::LIGHTTEXT); - Colour ref6 = Colour(180, 180, 180, 255); + DrawStyle ref6 = DrawStyle(180, 180, 180, 255); rectangle(keyx + 290, keyy + 4, 180, getFontHeight() + 2, ref6); - drawText(tr("Guide / Back: Close"), keyx + 292 , keyy + 5, Colour::LIGHTTEXT); + drawText(tr("Guide / Back: Close"), keyx + 292 , keyy + 5, DrawStyle::LIGHTTEXT); - Colour ref7 = Colour(180, 180, 180, 255); + DrawStyle ref7 = DrawStyle(180, 180, 180, 255); rectangle(keyx + 290, keyy + getFontHeight() + 8, 180, getFontHeight() + 2, ref7); - Colour red = Colour(130, 0, 0); + DrawStyle red = DrawStyle(130, 0, 0); drawText(tr("Rec: Set timer"), keyx + 292, keyy + getFontHeight() + 9, red); - Colour ref8 = Colour(180, 180, 180, 255); + DrawStyle ref8 = DrawStyle(180, 180, 180, 255); rectangle(keyx + 474, keyy + 4, 128, getFontHeight() + 2, ref8); w.nextSymbol = WSymbol::PLAY; w.setPosition(keyx + 476, keyy + 5); w.draw(); - drawText(tr("Sel channel"), keyx + 496, keyy + 5, Colour::LIGHTTEXT); + drawText(tr("Sel channel"), keyx + 496, keyy + 5, DrawStyle::LIGHTTEXT); - Colour ref9 = Colour(180, 180, 180, 255); + DrawStyle ref9 = DrawStyle(180, 180, 180, 255); rectangle(keyx + 474, keyy + getFontHeight() + 8, 128, getFontHeight() + 2, ref9); - drawText(tr("Go: Preview"), keyx + 476, keyy + getFontHeight() + 9, Colour::LIGHTTEXT); + drawText(tr("Go: Preview"), keyx + 476, keyy + getFontHeight() + 9, DrawStyle::LIGHTTEXT); // Draw all the dynamic data @@ -313,7 +313,7 @@ void VEpg::drawData() chanListbox.getRootBoxOffsetY() - getFontHeight() - 3, 155 + WINDOW_WIDTH * MINUTE_SCALE, chanListbox.getHeight() + getFontHeight() + 4, - Colour::BLACK); + DrawStyle::BLACK); chanListbox.draw(); drawgrid(); @@ -529,7 +529,7 @@ void VEpg::drawgrid() // redraws grid and select programme updateEventList(); } // draw time scale - Colour white = Colour(255, 255, 255, 255); + DrawStyle white = DrawStyle(255, 255, 255, 255); t = ltime; struct tm* tms; @@ -537,29 +537,29 @@ void VEpg::drawgrid() // redraws grid and select programme strftime(timeString, 19, "%a %d %b", tms); int timey = chanListbox.getRootBoxOffsetY() - getFontHeight() - 3; int timex = 135; - drawTextRJ(timeString, timex - 10, timey, Colour::LIGHTTEXT); // print date + drawTextRJ(timeString, timex - 10, timey, DrawStyle::LIGHTTEXT); // print date strftime(timeString, 19, "%H:%M", tms); - drawText(timeString, timex, timey, Colour::LIGHTTEXT); // print left time + drawText(timeString, timex, timey, DrawStyle::LIGHTTEXT); // print left time rectangle(155, timey + getFontHeight(), 2, 7, white); t = t + 3600; tms = localtime(&t); strftime(timeString, 19, "%H:%M", tms); - drawText(timeString, timex + 180, timey, Colour::LIGHTTEXT); // print middle time + drawText(timeString, timex + 180, timey, DrawStyle::LIGHTTEXT); // print middle time rectangle(335, timey + getFontHeight(), 2, 7, white); t = t + 3600; tms = localtime(&t); strftime(timeString, 19, "%H:%M", tms); - drawText(timeString, timex + 360, timey, Colour::LIGHTTEXT); // print right time + drawText(timeString, timex + 360, timey, DrawStyle::LIGHTTEXT); // print right time rectangle(515, timey + getFontHeight(), 2, 7, white); // pointer to selTime - //rectangle(155 + (selTime - ltime) / 20, timey + getFontHeight(), 2, 7, Colour(255, 50, 50, 255)); + //rectangle(155 + (selTime - ltime) / 20, timey + getFontHeight(), 2, 7, DrawStyle(255, 50, 50, 255)); // current time line time(&t); if ((t >= ltime) && (t < (ltime + 9000))) { - rectangle(155 + (t - ltime) / 20, timey + getFontHeight(), 2, ((getFontHeight() + 2) * 7) + 7 + 2, Colour::RED); + rectangle(155 + (t - ltime) / 20, timey + getFontHeight(), 2, ((getFontHeight() + 2) * 7) + 7 + 2, DrawStyle::RED); } // TODO should the above two comditional statements be combined to avoid calling updateEventList() twice? @@ -573,7 +573,7 @@ void VEpg::drawgrid() // redraws grid and select programme bool swapColour = false; // alternate cell colour bool currentRow = false; int y = chanListbox.getRootBoxOffsetY() + 5; // vertical position of cell - Colour bg, fg; // background colour of cells in grid + DrawStyle bg, fg; // background colour of cells in grid // for each displayed channel, find programmes that fall in 2.5 hour time window for(UINT listIndex = 0; listIndex < gridRows; listIndex++) { @@ -583,7 +583,7 @@ void VEpg::drawgrid() // redraws grid and select programme noevent.time = ltime; noevent.duration = WINDOW_WIDTH * 60; noevent.settitle(""); - paintCell(&noevent, y, Colour::NOPROGRAMME, Colour::LIGHTTEXT); // fill row with no programme colour to be painted ove with valid programmes + paintCell(&noevent, y, DrawStyle::NOPROGRAMME, DrawStyle::LIGHTTEXT); // fill row with no programme colour to be painted ove with valid programmes if (currentRow) { thisEvent.setdescription(tr("There are no programme details available for this period")); @@ -597,7 +597,7 @@ void VEpg::drawgrid() // redraws grid and select programme sort(eventLista[listIndex]->begin(), eventLista[listIndex]->end(), EventSorter()); for(e = 0; e < (eventLista[listIndex])->size(); e++) // step through events for this channel { - fg = Colour::LIGHTTEXT; + fg = DrawStyle::LIGHTTEXT; event = (*eventLista[listIndex])[e]; if (event) { @@ -607,7 +607,7 @@ void VEpg::drawgrid() // redraws grid and select programme if(end <= UINT(ltime)) // programme ends before LHS of window continue; // this event is before the window - let's try the next event // this event is one we are interested in - bg = (swapColour)?Colour::PROGRAMMEA:Colour::PROGRAMMEB; // alternate cell colour + bg = (swapColour)?DrawStyle::PROGRAMMEA:DrawStyle::PROGRAMMEB; // alternate cell colour swapColour = !swapColour; // it wil be the other colour next time if(event->time <= UINT(selTime) && end > UINT(selTime) && currentRow) { @@ -619,8 +619,8 @@ void VEpg::drawgrid() // redraws grid and select programme thisEvent.id = event->id; if(thisEvent.id == 0) thisEvent.id = 1; - bg = Colour::SELECTHIGHLIGHT; // highlight cell - fg = Colour::DARKTEXT; + bg = DrawStyle::SELECTHIGHLIGHT; // highlight cell + fg = DrawStyle::DARKTEXT; } else { @@ -641,14 +641,14 @@ void VEpg::drawgrid() // redraws grid and select programme // no event list for this channel. Already painted noevent colour so just highlight if selected if (currentRow) { - bg = Colour::SELECTHIGHLIGHT; // highlight cell - fg = Colour::DARKTEXT; + bg = DrawStyle::SELECTHIGHLIGHT; // highlight cell + fg = DrawStyle::DARKTEXT; paintCell(&thisEvent, y, bg, fg); } else { - bg = Colour::NOPROGRAMME; - fg = Colour::LIGHTTEXT; + bg = DrawStyle::NOPROGRAMME; + fg = DrawStyle::LIGHTTEXT; noevent.settitle(tr("No programme details")); paintCell(&noevent, y, bg, fg); } @@ -681,7 +681,7 @@ void VEpg::setCurrentChannel() boxstack->update(this, &r); } -void VEpg::paintCell(Event* event, int yOffset, const Colour& bg, const Colour& fg) +void VEpg::paintCell(Event* event, int yOffset, const DrawStyle& bg, const DrawStyle& fg) { int w, x, y, h; w = x = 0; // keep compiler happy @@ -725,7 +725,7 @@ void VEpg::paintCell(Event* event, int yOffset, const Colour& bg, const Colour& { strncpy(tT, tt, textWidth - 1); tT[textWidth - 1] = '\0'; - surface->drawText(tT, x+2, y, fg.rgba()); + surface->drawText(tT, x+2, y, fg); } delete tT; diff --git a/vepg.h b/vepg.h index edef8a6..2f37e3f 100644 --- a/vepg.h +++ b/vepg.h @@ -80,7 +80,7 @@ class VEpg : public Boxx, public TimerReceiver int listWindowSize; void updateChanList(); void updateEventList(); - void paintCell(Event* event, int yOffset, const Colour& bg, const Colour& fg); + void paintCell(Event* event, int yOffset, const DrawStyle& bg, const DrawStyle& fg); time_t prevHour(time_t* t); void* parent; BoxStack* boxstack; diff --git a/vepgsettimer.cc b/vepgsettimer.cc index 4e00ab6..0a2d714 100644 --- a/vepgsettimer.cc +++ b/vepgsettimer.cc @@ -53,7 +53,7 @@ VEpgSetTimer::VEpgSetTimer(Event* tevent, Channel* tchannel) } setTitleBarOn(1); - setTitleBarColour(Colour::TITLEBARBACKGROUND); + setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); setBorderOn(true); setTitleText(tr("Set Timer")); @@ -173,8 +173,8 @@ void VEpgSetTimer::swap() void VEpgSetTimer::draw() { TBBoxx::draw(); - drawPara(event->title, 10, 40, Colour::LIGHTTEXT); - drawText(channel->name, 10, 40 + (2 * getFontHeight()), Colour::LIGHTTEXT); + drawPara(event->title, 10, 40, DrawStyle::LIGHTTEXT); + drawText(channel->name, 10, 40 + (2 * getFontHeight()), DrawStyle::LIGHTTEXT); char fullString[20]; time_t t; @@ -197,8 +197,8 @@ void VEpgSetTimer::draw() strcat(fullString, timeString); // put it in our buffer - drawText(fullString, 10, 40 + (3 * getFontHeight()), Colour::LIGHTTEXT); - drawText(tr("Create this timer?"), 10, 40 + (5 * getFontHeight()), Colour::LIGHTTEXT); + drawText(fullString, 10, 40 + (3 * getFontHeight()), DrawStyle::LIGHTTEXT); + drawText(tr("Create this timer?"), 10, 40 + (5 * getFontHeight()), DrawStyle::LIGHTTEXT); buttonYes.draw(); buttonNo.draw(); diff --git a/vinfo.cc b/vinfo.cc index eb05c00..202a6d1 100644 --- a/vinfo.cc +++ b/vinfo.cc @@ -32,7 +32,7 @@ VInfo::VInfo() dropThrough = 0; setTitleBarOn(1); - setTitleBarColour(Colour::TITLEBARBACKGROUND); + setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); } VInfo::~VInfo() @@ -74,13 +74,13 @@ void VInfo::draw() { if (mainTextType == NORMAL) { - drawPara(mainText, 10, 45, Colour::LIGHTTEXT); + drawPara(mainText, 10, 45, DrawStyle::LIGHTTEXT); } if (mainTextType == ONELINER) { - if (titleBarOn) drawTextCentre(mainText, area.w / 2, 75, Colour::LIGHTTEXT); - else drawTextCentre(mainText, area.w / 2, 55, Colour::LIGHTTEXT); + if (titleBarOn) drawTextCentre(mainText, area.w / 2, 75, DrawStyle::LIGHTTEXT); + else drawTextCentre(mainText, area.w / 2, 55, DrawStyle::LIGHTTEXT); } } } diff --git a/vmute.cc b/vmute.cc index 043a3ce..c371caf 100644 --- a/vmute.cc +++ b/vmute.cc @@ -54,7 +54,7 @@ VMute::~VMute() void VMute::draw() { // draw background? - fillColour(Colour::VIEWBACKGROUND); + fillColour(DrawStyle::VIEWBACKGROUND); WSymbol w; TEMPADD(&w); diff --git a/vopts.cc b/vopts.cc index 57419ce..2772167 100644 --- a/vopts.cc +++ b/vopts.cc @@ -41,7 +41,7 @@ VOpts::VOpts() { setTitleBarOn(1); - setTitleBarColour(Colour::TITLEBARBACKGROUND); + setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); setTitleText(tr("Options")); diff --git a/vpicturebanner.cc b/vpicturebanner.cc index ba800e2..c1ceef6 100644 --- a/vpicturebanner.cc +++ b/vpicturebanner.cc @@ -57,19 +57,19 @@ void VPictureBanner::draw() // View::draw(); if (shortInfo) { if (info) { - drawText(info,5,area.h-25,Colour::LIGHTTEXT); + drawText(info,5,area.h-25,DrawStyle::LIGHTTEXT); } - else drawText(tr("Loading"),5,3,Colour::LIGHTTEXT); + else drawText(tr("Loading"),5,3,DrawStyle::LIGHTTEXT); } else { int x=5; - rectangle(x, area.h - 24, 18, 16, Colour::RED); + rectangle(x, area.h - 24, 18, 16, DrawStyle::RED); x+=18+3; - drawText(tr("rotate"), x, area.h - 25, Colour::LIGHTTEXT); + drawText(tr("rotate"), x, area.h - 25, DrawStyle::LIGHTTEXT); x+=rotsize+3; - rectangle(x, area.h - 24, 18, 16, Colour::GREEN); + rectangle(x, area.h - 24, 18, 16, DrawStyle::GREEN); x+=18+3; - drawText(tr("info"), 5+18+3+rotsize+3+18+3, area.h - 25, Colour::LIGHTTEXT); + drawText(tr("info"), 5+18+3+rotsize+3+18+3, area.h - 25, DrawStyle::LIGHTTEXT); x+=infsize+3; WSymbol w; TEMPADD(&w); @@ -83,7 +83,7 @@ void VPictureBanner::draw() w.draw(); x+=20+3; if (info) { - drawText(info,x,area.h - 25,Colour::LIGHTTEXT); + drawText(info,x,area.h - 25,DrawStyle::LIGHTTEXT); } } } diff --git a/vquestion.cc b/vquestion.cc index 6ad12b6..5dca6c4 100644 --- a/vquestion.cc +++ b/vquestion.cc @@ -59,7 +59,7 @@ void VQuestion::draw() { TBBoxx::draw(); - if (mainText) drawPara(mainText, 10, 45, Colour::LIGHTTEXT); + if (mainText) drawPara(mainText, 10, 45, DrawStyle::LIGHTTEXT); } void VQuestion::swap() diff --git a/vradiorec.cc b/vradiorec.cc index ec0d3a5..566274e 100644 --- a/vradiorec.cc +++ b/vradiorec.cc @@ -112,7 +112,7 @@ VRadioRec::~VRadioRec() void VRadioRec::draw() { - fillColour(Colour::BLACK); + fillColour(DrawStyle::BLACK); } void VRadioRec::go() @@ -288,7 +288,7 @@ void VRadioRec::processMessage(Message* m) doBar(3); return; // int progressWidth = 302 * currentFrameNum / lengthFrames; - // rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, Colour::SELECTHIGHLIGHT); + // rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, DrawStyle::SELECTHIGHLIGHT); } } else @@ -429,7 +429,7 @@ void VRadioRec::drawBarClocks() time(&t); struct tm* tms = localtime(&t); strftime(timeString, 19, "%H:%M", tms); - drawText(timeString, barRegion.x + 624, barRegion.y + 12, Colour::LIGHTTEXT); + drawText(timeString, barRegion.x + 624, barRegion.y + 12, DrawStyle::LIGHTTEXT); // Draw clocks @@ -492,12 +492,12 @@ void VRadioRec::drawBarClocks() strcpy(buffer, "-:--:-- / -:--:--"); } - drawText(buffer, clocksRegion.x, clocksRegion.y, Colour::LIGHTTEXT); + drawText(buffer, clocksRegion.x, clocksRegion.y, DrawStyle::LIGHTTEXT); // Draw progress bar int progBarXbase = barRegion.x + 300; - rectangle(barRegion.x + progBarXbase, barRegion.y + 12, 310, 24, Colour::LIGHTTEXT); + rectangle(barRegion.x + progBarXbase, barRegion.y + 12, 310, 24, DrawStyle::LIGHTTEXT); rectangle(barRegion.x + progBarXbase + 2, barRegion.y + 14, 306, 20, barBlue); if (currentSeconds > lengthSeconds) return; @@ -505,7 +505,7 @@ void VRadioRec::drawBarClocks() // Draw yellow portion int progressWidth = 302 * currentSeconds / lengthSeconds; - rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, Colour::SELECTHIGHLIGHT); + rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, DrawStyle::SELECTHIGHLIGHT); /* if (myRec->recInfo->timerEnd > time(NULL)) // if chasing @@ -515,7 +515,7 @@ void VRadioRec::drawBarClocks() Log::getInstance()->log("GVASDF", Log::DEBUG, "Length Frames: %lu", lengthFrames); // Log::getInstance()->log("GVASDF", Log::DEBUG, "Player lf: %lu", player->getLengthFrames()); Log::getInstance()->log("GVASDF", Log::DEBUG, "NR WDITH: %i", nrWidth); - rectangle(barRegion.x + progBarXbase + 4 + 302 - nrWidth, barRegion.y + 16, nrWidth, 16, Colour::RED); + rectangle(barRegion.x + progBarXbase + 4 + 302 - nrWidth, barRegion.y + 16, nrWidth, 16, DrawStyle::RED); } */ @@ -527,13 +527,13 @@ void VRadioRec::drawBarClocks() posPix = 302 * startMargin / lengthSeconds; logger->log("VRadioRec", Log::DEBUG, "posPix %i", posPix); - rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, Colour::LIGHTTEXT); - rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, Colour::LIGHTTEXT); + rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, DrawStyle::LIGHTTEXT); + rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, DrawStyle::LIGHTTEXT); posPix = 302 * (lengthSeconds - endMargin) / lengthSeconds; - rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, Colour::LIGHTTEXT); - rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, Colour::LIGHTTEXT); + rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, DrawStyle::LIGHTTEXT); + rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, DrawStyle::LIGHTTEXT); } void VRadioRec::removeBar() @@ -541,7 +541,7 @@ void VRadioRec::removeBar() if (!barShowing) return; timers->cancelTimer(this, 2); barShowing = false; - rectangle(barRegion, Colour::BLACK); + rectangle(barRegion, DrawStyle::BLACK); boxstack->update(this, &barRegion); } diff --git a/vradiorec.h b/vradiorec.h index eeaaf4c..70bf3ec 100644 --- a/vradiorec.h +++ b/vradiorec.h @@ -58,7 +58,7 @@ class VRadioRec : public Boxx, public TimerReceiver Recording* myRec; BoxStack* boxstack; - Colour barBlue; + DrawStyle barBlue; bool playing; bool barShowing; diff --git a/vrecmove.cc b/vrecmove.cc index 0ba3b16..61f132c 100644 --- a/vrecmove.cc +++ b/vrecmove.cc @@ -52,7 +52,7 @@ VRecMove::VRecMove(RecMan* trecman) setTitleBarOn(1); setBorderOn(1); setTitleText(tr("Move recording")); - setTitleBarColour(Colour::TITLEBARBACKGROUND); + setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); sl.setPosition(10, 30 + 5); sl.setSize(area.w - 40, area.h - 30 - 15); @@ -92,7 +92,7 @@ void VRecMove::draw() { TBBoxx::draw(); - rectangle(area.w - 30, 30 + 5, 20, area.h - 30 - 15, Colour::VIEWBACKGROUND); + rectangle(area.w - 30, 30 + 5, 20, area.h - 30 - 15, DrawStyle::VIEWBACKGROUND); WSymbol w; TEMPADD(&w); diff --git a/vrecording.cc b/vrecording.cc index 104ff5b..c3b2461 100644 --- a/vrecording.cc +++ b/vrecording.cc @@ -60,7 +60,7 @@ VRecording::VRecording(RecMan* trecman, Recording* trec) setTitleBarOn(1); setBorderOn(1); setTitleText(rec->getProgName()); - setTitleBarColour(Colour::TITLEBARBACKGROUND); + setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); summary.setPosition(10, 30 + 5); summary.setSize(area.w - 20, area.h - 30 - 15 - 50); @@ -177,7 +177,7 @@ int VRecording::handleCommand(int command) VQuestion* v = new VQuestion(this); v->setSize(260, 180); v->createBuffer(); - v->setTitleBarColour(Colour::DANGER); + v->setTitleBarColour(DrawStyle::DANGER); v->setTitleBarOn(1); v->setBorderOn(1); v->setTitleText(tr("Delete recording")); diff --git a/vrecordinglist.cc b/vrecordinglist.cc index f46050c..5e872c6 100644 --- a/vrecordinglist.cc +++ b/vrecordinglist.cc @@ -56,7 +56,7 @@ VRecordingList::VRecordingList() } setTitleBarOn(1); - setTitleBarColour(Colour::TITLEBARBACKGROUND); + setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); sl.setPosition(10, 30 + 5); sl.setSize(area.w - 20, area.h - 30 - 15 - 30); @@ -147,14 +147,14 @@ void VRecordingList::draw(bool doIndexPop) if (loading) { - drawText(tr("Loading..."), 240, 180, Colour::LIGHTTEXT); + drawText(tr("Loading..."), 240, 180, DrawStyle::LIGHTTEXT); } else { char freeSpace[50]; int gigFree = recman->getFreeSpace() / 1024; SNPRINTF(freeSpace, 49, tr("%lu%% used, %iGB free"), recman->getUsedPercent(), gigFree); - drawTextRJ(freeSpace, 560, 5, Colour::LIGHTTEXT); + drawTextRJ(freeSpace, 560, 5, DrawStyle::LIGHTTEXT); // Symbols WSymbol w; @@ -174,7 +174,7 @@ void VRecordingList::draw(bool doIndexPop) w.nextSymbol = WSymbol::PLAY; w.setPosition(150, 385); w.draw(); - drawTextRJ(tr("[ok] = menu"), 560, 385, Colour::LIGHTTEXT); + drawTextRJ(tr("[ok] = menu"), 560, 385, DrawStyle::LIGHTTEXT); // All static stuff done drawData(doIndexPop); @@ -186,10 +186,10 @@ void VRecordingList::doShowingBar() int topOption = sl.getTopOption() + 1; if (sl.getNumOptions() == 0) topOption = 0; - rectangle(220, 385, 180, 25, Colour::VIEWBACKGROUND); + rectangle(220, 385, 180, 25, DrawStyle::VIEWBACKGROUND); char showing[200]; sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions()); - drawText(showing, 220, 385, Colour::LIGHTTEXT); + drawText(showing, 220, 385, DrawStyle::LIGHTTEXT); } void VRecordingList::processMessage(Message* m) @@ -269,7 +269,7 @@ void VRecordingList::doDeleteSelected() vi->setOneLiner(tr("Failed to delete recording")); vi->setExitable(); vi->setBorderOn(1); - vi->setTitleBarColour(Colour::DANGER); + vi->setTitleBarColour(DrawStyle::DANGER); vi->okButton(); vi->draw(); boxstack->add(vi); @@ -309,7 +309,7 @@ void VRecordingList::doMoveRecording(Directory* toDir) vi->setOneLiner(tr("Failed to move recording")); vi->setExitable(); vi->setBorderOn(1); - vi->setTitleBarColour(Colour::DANGER); + vi->setTitleBarColour(DrawStyle::DANGER); vi->okButton(); vi->draw(); boxstack->add(vi); @@ -354,7 +354,7 @@ int VRecordingList::doPlay(bool resume) vi->setOneLiner(tr("H264 video not supported")); vi->setExitable(); vi->setBorderOn(1); - vi->setTitleBarColour(Colour::DANGER); + vi->setTitleBarColour(DrawStyle::DANGER); vi->okButton(); vi->draw(); boxstack->add(vi); diff --git a/vrecordingmenu.cc b/vrecordingmenu.cc index a527f53..d78c9ef 100644 --- a/vrecordingmenu.cc +++ b/vrecordingmenu.cc @@ -55,7 +55,7 @@ VRecordingMenu::VRecordingMenu(RecMan* trecman) setTitleBarOn(1); setBorderOn(1); setTitleText(tr("Programme menu")); - setTitleBarColour(Colour::TITLEBARBACKGROUND); + setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); sl.setPosition(10, 30 + 5); sl.setSize(area.w - 20, area.h - 30 - 15); @@ -163,7 +163,7 @@ int VRecordingMenu::handleCommand(int command) VQuestion* v = new VQuestion(this); v->setSize(260, 180); v->createBuffer(); - v->setTitleBarColour(Colour::DANGER); + v->setTitleBarColour(DrawStyle::DANGER); v->setTitleBarOn(1); v->setBorderOn(1); v->setTitleText(tr("Delete recording")); diff --git a/vscreensaver.cc b/vscreensaver.cc index 2c6c86b..91e8543 100644 --- a/vscreensaver.cc +++ b/vscreensaver.cc @@ -46,7 +46,7 @@ VScreensaver::~VScreensaver() void VScreensaver::draw() { - fillColour(Colour::BLACK); + fillColour(DrawStyle::BLACK); threadStart(); } @@ -83,6 +83,9 @@ void VScreensaver::threadMethod() fx = x[0] = 50; fy = y[0] = 50; + Colour black=(Colour)DrawStyle::BLACK; + Colour light=(Colour)DrawStyle::SELECTHIGHLIGHT; + while(1) { if (++head == h) head = 0; @@ -91,7 +94,7 @@ void VScreensaver::threadMethod() if (tail == h) tail = 0; // Undraw oldest point - if (x[tail] != -1) surface->drawPoint(x[tail], y[tail], Colour::BLACK);// was rgba + if (x[tail] != -1) surface->drawPoint(x[tail], y[tail], black);// was rgba dd = ((rand() / (double)RAND_MAX) * deviation) - halfdeviation; direction += dd; @@ -110,7 +113,7 @@ void VScreensaver::threadMethod() x[head] = (int)fx; y[head] = (int)fy; - surface->drawPoint(x[head], y[head], Colour::SELECTHIGHLIGHT); // was rgba + surface->drawPoint(x[head], y[head], light); // was rgba MILLISLEEP(10); } } diff --git a/vserverselect.cc b/vserverselect.cc index 16f4b0c..f1922be 100644 --- a/vserverselect.cc +++ b/vserverselect.cc @@ -48,7 +48,7 @@ VServerSelect::VServerSelect(vector& servers, void* treplyTo) } setTitleBarOn(1); - setTitleBarColour(Colour::TITLEBARBACKGROUND); + setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); setTitleText(tr("Choose a VDR server")); sl.setPosition(10, 30 + 5); diff --git a/vsleeptimer.cc b/vsleeptimer.cc index d4ab1ca..964ac26 100644 --- a/vsleeptimer.cc +++ b/vsleeptimer.cc @@ -223,7 +223,7 @@ VSleeptimer::~VSleeptimer() void VSleeptimer::draw() { - fillColour(Colour::VIEWBACKGROUND); + fillColour(DrawStyle::VIEWBACKGROUND); WSymbol w; TEMPADD(&w); w.nextSymbol = WSymbol::CLOCK; @@ -231,7 +231,7 @@ void VSleeptimer::draw() w.draw(); Boxx::draw(); - drawText(displaySleeptimer,50,2,Colour::LIGHTTEXT); + drawText(displaySleeptimer,50,2,DrawStyle::LIGHTTEXT); Timers::getInstance()->setTimerD(this, 1, 2); } @@ -290,16 +290,16 @@ VCountdown::~VCountdown() void VCountdown::draw(const char* sec) { - fillColour(Colour::VIEWBACKGROUND); + fillColour(DrawStyle::VIEWBACKGROUND); WSymbol w; TEMPADD(&w); w.nextSymbol = WSymbol::CLOCK; - w.nextColour = Colour::RED; + w.nextColour = DrawStyle::RED; w.setPosition(3, 0); w.draw(); Boxx::draw(); - drawText(sec,50,2,Colour::RED); + drawText(sec,50,2,DrawStyle::RED); Timers::getInstance()->setTimerD(this, 1, 1); } diff --git a/vtimeredit.cc b/vtimeredit.cc index 9b8ae1c..6f5aa20 100644 --- a/vtimeredit.cc +++ b/vtimeredit.cc @@ -56,7 +56,7 @@ VTimerEdit::VTimerEdit(RecTimer* trt) setTitleBarOn(1); setTitleText(tr("Edit Timer")); - setTitleBarColour(Colour::TITLEBARBACKGROUND); + setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); } VTimerEdit::~VTimerEdit() @@ -75,18 +75,18 @@ void VTimerEdit::draw() int xpos = 20; int ypos = 50; int fontheight=getFontHeight(); - drawText(tr("Active"), xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; - drawText(tr("Channel"), xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; - drawText(tr("Name"), xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; - drawText(tr("Directory"), xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; + drawText(tr("Active"), xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; + drawText(tr("Channel"), xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; + drawText(tr("Name"), xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; + drawText(tr("Directory"), xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; ypos += fontheight; - drawText(tr("Start"), xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; - drawText(tr("Stop"), xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; - drawText(tr("Priority"), xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; - drawText(tr("Lifetime"), xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; + drawText(tr("Start"), xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; + drawText(tr("Stop"), xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; + drawText(tr("Priority"), xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; + drawText(tr("Lifetime"), xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; ypos += fontheight; - drawText(tr("Current"), xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; - drawText(tr("Recording"), xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; + drawText(tr("Current"), xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; + drawText(tr("Recording"), xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; // Temp @@ -98,50 +98,50 @@ void VTimerEdit::draw() // Active if (recTimer->active) strcpy(buffer, "Yes"); else strcpy(buffer, "No"); - drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; + drawText(buffer, xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; // Channel SNPRINTF(buffer, 999, "%lu", recTimer->channelNumber); - drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; + drawText(buffer, xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; // Name SNPRINTF(buffer, 999, "%s", recTimer->getName()); - drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; + drawText(buffer, xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; // Directory if (recTimer->getDirectory()) SNPRINTF(buffer, 999, "%s", recTimer->getDirectory()); else strcpy(buffer, ""); - drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; + drawText(buffer, xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; ypos += fontheight; // Start tms = localtime((time_t*)&recTimer->startTime); strftime(buffer, 999, "%d/%m %H:%M", tms); - drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; + drawText(buffer, xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; // Stop tms = localtime((time_t*)&recTimer->stopTime); strftime(buffer, 999, "%d/%m %H:%M", tms); - drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; + drawText(buffer, xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; // Priority SNPRINTF(buffer, 999, "%lu", recTimer->priority); - drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; + drawText(buffer, xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; // Lifetime SNPRINTF(buffer, 999, "%lu", recTimer->lifeTime); - drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; + drawText(buffer, xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; ypos += fontheight; // Current if (recTimer->pending) strcpy(buffer, "Yes"); else strcpy(buffer, "No"); - drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; + drawText(buffer, xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; // Recording now if (recTimer->recording) strcpy(buffer, "Yes"); else strcpy(buffer, "No"); - drawText(buffer, xpos, ypos, Colour::LIGHTTEXT); ypos += fontheight; + drawText(buffer, xpos, ypos, DrawStyle::LIGHTTEXT); ypos += fontheight; } void VTimerEdit::swap() @@ -206,7 +206,7 @@ int VTimerEdit::handleCommand(int command) VQuestion* v = new VQuestion(this); v->setSize(260, 180); v->createBuffer(); - v->setTitleBarColour(Colour::DANGER); + v->setTitleBarColour(DrawStyle::DANGER); v->setTitleBarOn(1); v->setBorderOn(1); v->setTitleText("Delete timer"); diff --git a/vtimerlist.cc b/vtimerlist.cc index 3eb5f1e..2cc3558 100644 --- a/vtimerlist.cc +++ b/vtimerlist.cc @@ -66,7 +66,7 @@ VTimerList::VTimerList() setTitleBarOn(1); setTitleText(tr("Timers")); - setTitleBarColour(Colour::TITLEBARBACKGROUND); + setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); sl.setPosition(30, 30 + 5); sl.setSize(area.w - 40, area.h - 30 - 15 - 30); @@ -117,7 +117,7 @@ void VTimerList::draw() w.setPosition(115, 385); w.draw(); - drawTextRJ("[ok] = edit", 560, 385, Colour::LIGHTTEXT); + drawTextRJ("[ok] = edit", 560, 385, DrawStyle::LIGHTTEXT); drawClock(); drawShowing(); @@ -167,7 +167,7 @@ void VTimerList::drawClock() time(&t); struct tm* tms = localtime(&t); strftime(timeString, 19, "%d/%m %H:%M:%S", tms); - drawTextRJ(timeString, 560, 5, Colour::LIGHTTEXT); + drawTextRJ(timeString, 560, 5, DrawStyle::LIGHTTEXT); Timers::getInstance()->setTimerT(this, 1, t + 1); } @@ -177,10 +177,10 @@ void VTimerList::drawShowing() int topOption = sl.getTopOption() + 1; if (sl.getNumOptions() == 0) topOption = 0; - rectangle(220, 385, 180, 25, Colour::VIEWBACKGROUND); + rectangle(220, 385, 180, 25, DrawStyle::VIEWBACKGROUND); char showing[200]; sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions()); - drawText(showing, 220, 385, Colour::LIGHTTEXT); + drawText(showing, 220, 385, DrawStyle::LIGHTTEXT); } void VTimerList::drawIndicators() @@ -190,7 +190,7 @@ void VTimerList::drawIndicators() int yinc = getFontHeight() + 1; RecTimer* recTimer; - rectangle(6, 44, 18, 15*yinc, Colour::VIEWBACKGROUND); + rectangle(6, 44, 18, 15*yinc, DrawStyle::VIEWBACKGROUND); // The indexes recorded from the wselectlist into the index member of the RecTimer // Is the same as the position in the vector of RecTimers @@ -205,23 +205,23 @@ void VTimerList::drawIndicators() { if (flipflop) { - rectangle(6, ypos, 18, 16, Colour::RED); - drawText("R", 8, ypos-3, Colour::LIGHTTEXT); + rectangle(6, ypos, 18, 16, DrawStyle::RED); + drawText("R", 8, ypos-3, DrawStyle::LIGHTTEXT); } } else if (recTimer->pending) { - rectangle(6, ypos, 18, 16, Colour::RED); - drawText("X", 8, ypos-3, Colour::BLACK); + rectangle(6, ypos, 18, 16, DrawStyle::RED); + drawText("X", 8, ypos-3, DrawStyle::BLACK); } else if (recTimer->active == 0) { - rectangle(6, ypos, 18, 16, Colour::SELECTHIGHLIGHT); - drawText("X", 8, ypos-3, Colour::BLACK); + rectangle(6, ypos, 18, 16, DrawStyle::SELECTHIGHLIGHT); + drawText("X", 8, ypos-3, DrawStyle::BLACK); } else { -// if (flipflop) rectangle(6, ypos, 18, 16, Colour::GREEN); +// if (flipflop) rectangle(6, ypos, 18, 16, DrawStyle::GREEN); } ypos += yinc; @@ -359,7 +359,7 @@ void VTimerList::processMessage(Message* m) errorBox->setExitable(); errorBox->setBorderOn(1); - errorBox->setTitleBarColour(Colour::DANGER); + errorBox->setTitleBarColour(DrawStyle::DANGER); errorBox->okButton(); errorBox->draw(); BoxStack::getInstance()->add(errorBox); diff --git a/vvideolivetv.cc b/vvideolivetv.cc index af5ac6d..6e0771a 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -44,6 +44,7 @@ #include "vteletextview.h" VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, VChannelList* tvchannelList) +: osdBack(0, 0, 0, 128) { vdr = VDR::getInstance(); boxstack = BoxStack::getInstance(); @@ -93,7 +94,7 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V setSize(video->getScreenWidth(), video->getScreenHeight()); createBuffer(); - Colour transparent(0, 0, 0, 0); + DrawStyle transparent(0, 0, 0, 0); setBackgroundColour(transparent); #ifdef PAL_WSS dowss = false; @@ -121,8 +122,8 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V // This is only used on old remotes to stop up/down buttons being used for osd-epg scrolling okTriggeredOSD = false; - Colour osdBack = Colour(0, 0, 0, 128); + osd.setBackgroundColour(osdBack); osd.setPosition(0, video->getScreenHeight() - 150); osd.setSize(video->getScreenWidth(), 150); @@ -144,22 +145,22 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V osdChanName.setSize(300, 30); osd.add(&osdChanName); - boxRed.setBackgroundColour(Colour::RED); + boxRed.setBackgroundColour(DrawStyle::RED); boxRed.setPosition(54, 104); boxRed.setSize(18, 16); osd.add(&boxRed); - boxGreen.setBackgroundColour(Colour::GREEN); + boxGreen.setBackgroundColour(DrawStyle::GREEN); boxGreen.setPosition(220, 104); boxGreen.setSize(18, 16); osd.add(&boxGreen); - boxYellow.setBackgroundColour(Colour::YELLOW); + boxYellow.setBackgroundColour(DrawStyle::YELLOW); boxYellow.setPosition(390, 104); boxYellow.setSize(18, 16); osd.add(&boxYellow); - boxBlue.setBackgroundColour(Colour::BLUE); + boxBlue.setBackgroundColour(DrawStyle::BLUE); boxBlue.setPosition(560, 104); boxBlue.setSize(18, 16); osd.add(&boxBlue); @@ -210,13 +211,13 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V textSummary.setParaMode(true); summary.add(&textSummary); - summaryBlackLine.setBackgroundColour(Colour::BLACK); + summaryBlackLine.setBackgroundColour(DrawStyle::BLACK); summaryBlackLine.setPosition(0, summary.getHeight() - 4); summaryBlackLine.setSize(summary.getWidth(), 4); summary.add(&summaryBlackLine); sAspectRatio.setPosition(osd.getWidth() - 90, 40); - sAspectRatio.nextColour = Colour::SELECTHIGHLIGHT; + sAspectRatio.nextColour = DrawStyle::SELECTHIGHLIGHT; sAspectRatio.setVisible(false); osd.add(&sAspectRatio); @@ -226,7 +227,7 @@ VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, V osd.add(&bufferBar); sAudioChannels.setPosition(osd.getWidth() - 130, 40); - sAudioChannels.nextColour = Colour::SELECTHIGHLIGHT; + sAudioChannels.nextColour = DrawStyle::SELECTHIGHLIGHT; sAudioChannels.setVisible(false); osd.add(&sAudioChannels); @@ -645,7 +646,7 @@ void VVideoLiveTV::doAudioSelector() // Draw the selector vas = new VAudioSelector(this, (*chanList)[currentChannelIndex], ((PlayerLiveTV*)player)->getCurrentAudioChannel(), subtitleType,subtitleChannel,NULL); - Colour osdBack = Colour(0, 0, 0, 128); + vas->setBackgroundColour(osdBack); vas->setPosition(0, osd.getScreenY() - vas->getHeight()); vas->draw(); @@ -1186,7 +1187,7 @@ void VVideoLiveTV::drawOSDBitmap(UINT posX, UINT posY, const Bitmap& bm) void VVideoLiveTV::clearOSD() { - rectangle(area, Colour(0,0,0,0)); + rectangle(area, DrawStyle(0,0,0,0)); boxstack->update(this, &area); } @@ -1194,6 +1195,6 @@ void VVideoLiveTV::clearOSDArea(UINT posX, UINT posY, UINT width, UINT height) { Region r; r.x = posX; r.y = posY; r.w = width; r.h = height; - rectangle(r, Colour(0,0,0,0)); + rectangle(r, DrawStyle(0,0,0,0)); boxstack->update(this, &r); } diff --git a/vvideolivetv.h b/vvideolivetv.h index 7473086..3c9eede 100644 --- a/vvideolivetv.h +++ b/vvideolivetv.h @@ -52,7 +52,7 @@ class VVideoLiveTV : public Boxx, public TimerReceiver, public OSDReceiver { public: VVideoLiveTV(ChannelList* chanList, ULONG initialChannelNumber, VChannelList* vchannelList); - ~VVideoLiveTV(); + virtual ~VVideoLiveTV(); void preDelete(); int handleCommand(int command); void processMessage(Message* m); @@ -148,6 +148,7 @@ class VVideoLiveTV : public Boxx, public TimerReceiver, public OSDReceiver Boxx summary; WTextbox textSummary; Boxx summaryBlackLine; + DrawStyle osdBack; Region osdSummaryRegion; diff --git a/vvideomedia.cc b/vvideomedia.cc index 9365a7c..f4b069e 100644 --- a/vvideomedia.cc +++ b/vvideomedia.cc @@ -356,7 +356,7 @@ void VVideoMedia::processMessage(Message* m) doBar(3); return; // int progressWidth = 302 * currentFrameNum / lengthFrames; - // rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, Colour::SELECTHIGHLIGHT); + // rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, DrawStyle::SELECTHIGHLIGHT); } } else @@ -559,7 +559,7 @@ void VVideoMedia::doBar(int action) { char text[5]; SNPRINTF(text, 5, "%ux", scanrate); - drawText(text, barRegion.x + 102, barRegion.y + 12, Colour::LIGHTTEXT); + drawText(text, barRegion.x + 102, barRegion.y + 12, DrawStyle::LIGHTTEXT); } } @@ -617,7 +617,7 @@ void VVideoMedia::drawBarClocks() time(&t); struct tm* tms = localtime(&t); strftime(timeString, 19, "%H:%M", tms); - drawText(timeString, barRegion.x + 624, barRegion.y + 12, Colour::LIGHTTEXT); + drawText(timeString, barRegion.x + 624, barRegion.y + 12, DrawStyle::LIGHTTEXT); ULLONG lenPTS=player->getLenPTS(); // Draw clocks @@ -640,7 +640,7 @@ void VVideoMedia::drawBarClocks() } logger->log("VVideoMedia", Log::DEBUG, "cur %llu,len %llu, txt %s",currentPTS,lenPTS,buffer); - drawText(buffer, clocksRegion.x, clocksRegion.y, Colour::LIGHTTEXT); + drawText(buffer, clocksRegion.x, clocksRegion.y, DrawStyle::LIGHTTEXT); @@ -652,14 +652,14 @@ void VVideoMedia::drawBarClocks() int progBarXbase = barRegion.x + 300; if (lenPTS == 0) return; - rectangle(barRegion.x + progBarXbase, barRegion.y + 12, 310, 24, Colour::LIGHTTEXT); + rectangle(barRegion.x + progBarXbase, barRegion.y + 12, 310, 24, DrawStyle::LIGHTTEXT); rectangle(barRegion.x + progBarXbase + 2, barRegion.y + 14, 306, 20, barBlue); if (currentPTS > lenPTS) return; // Draw yellow portion int progressWidth = 302 * currentPTS / lenPTS; - rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, Colour::SELECTHIGHLIGHT); + rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, DrawStyle::SELECTHIGHLIGHT); } diff --git a/vvideomedia.h b/vvideomedia.h index 3572e0e..bc3a932 100644 --- a/vvideomedia.h +++ b/vvideomedia.h @@ -63,8 +63,8 @@ class VVideoMedia : public Boxx, public TimerReceiver VAudioSelector* vas; - Colour transparent; - Colour barBlue; + DrawStyle transparent; + DrawStyle barBlue; UCHAR videoMode; void toggleChopSides(); diff --git a/vvideorec.cc b/vvideorec.cc index faafb65..7824329 100644 --- a/vvideorec.cc +++ b/vvideorec.cc @@ -481,7 +481,7 @@ void VVideoRec::processMessage(Message* m) if (loopMark->pos) { posPix = 302 * loopMark->pos / lengthFrames; - rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 3, 28, Colour::DANGER); + rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 3, 28, DrawStyle::DANGER); if (x>=barRegion.x + progBarXbase + 2 + posPix && x<=barRegion.x + progBarXbase + 2 + posPix+3 && y>=barRegion.y + 12 - 2 @@ -506,7 +506,7 @@ void VVideoRec::processMessage(Message* m) doBar(3); return; // int progressWidth = 302 * currentFrameNum / lengthFrames; - // rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, Colour::SELECTHIGHLIGHT); + // rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, DrawStyle::SELECTHIGHLIGHT); } } else @@ -844,7 +844,7 @@ void VVideoRec::doBar(int action) { char text[5]; SNPRINTF(text, 5, "%ux", scanrate); - drawText(text, barRegion.x + 102, barRegion.y + 12, Colour::LIGHTTEXT); + drawText(text, barRegion.x + 102, barRegion.y + 12, DrawStyle::LIGHTTEXT); } } @@ -931,7 +931,7 @@ void VVideoRec::drawBarClocks() time(&t); struct tm* tms = localtime(&t); strftime(timeString, 19, "%H:%M", tms); - drawText(timeString, barRegion.x + 624, barRegion.y + 12, Colour::LIGHTTEXT); + drawText(timeString, barRegion.x + 624, barRegion.y + 12, DrawStyle::LIGHTTEXT); // Draw clocks @@ -964,7 +964,7 @@ void VVideoRec::drawBarClocks() logger->log("VVideoRec", Log::DEBUG, buffer); } - drawText(buffer, clocksRegion.x, clocksRegion.y, Colour::LIGHTTEXT); + drawText(buffer, clocksRegion.x, clocksRegion.y, DrawStyle::LIGHTTEXT); @@ -975,7 +975,7 @@ void VVideoRec::drawBarClocks() // Draw progress bar int progBarXbase = barRegion.x + 300; - rectangle(barRegion.x + progBarXbase, barRegion.y + 12, 310, 24, Colour::LIGHTTEXT); + rectangle(barRegion.x + progBarXbase, barRegion.y + 12, 310, 24, DrawStyle::LIGHTTEXT); rectangle(barRegion.x + progBarXbase + 2, barRegion.y + 14, 306, 20, barBlue); if (currentFrameNum > lengthFrames) return; @@ -983,7 +983,7 @@ void VVideoRec::drawBarClocks() // Draw yellow portion int progressWidth = 302 * currentFrameNum / lengthFrames; - rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, Colour::SELECTHIGHLIGHT); + rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 16, progressWidth, 16, DrawStyle::SELECTHIGHLIGHT); if (myRec->recInfo->timerEnd > time(NULL)) // if chasing { @@ -992,7 +992,7 @@ void VVideoRec::drawBarClocks() Log::getInstance()->log("GVASDF", Log::DEBUG, "Length Frames: %lu", lengthFrames); Log::getInstance()->log("GVASDF", Log::DEBUG, "Player lf: %lu", player->getLengthFrames()); Log::getInstance()->log("GVASDF", Log::DEBUG, "NR WDITH: %i", nrWidth); - rectangle(barRegion.x + progBarXbase + 4 + 302 - nrWidth, barRegion.y + 16, nrWidth, 16, Colour::RED); + rectangle(barRegion.x + progBarXbase + 4 + 302 - nrWidth, barRegion.y + 16, nrWidth, 16, DrawStyle::RED); } int posPix; @@ -1012,7 +1012,7 @@ void VVideoRec::drawBarClocks() { logger->log("VVideoRec", Log::DEBUG, "Drawing mark at frame %i", loopMark->pos); posPix = 302 * loopMark->pos / lengthFrames; - rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 3, 28, Colour::DANGER); + rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 3, 28, DrawStyle::DANGER); } } } @@ -1022,13 +1022,13 @@ void VVideoRec::drawBarClocks() posPix =(int) (302. * myRec->recInfo->fps * ((double)startMargin) /((double) lengthFrames)); - rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, Colour::LIGHTTEXT); - rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, Colour::LIGHTTEXT); + rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, DrawStyle::LIGHTTEXT); + rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, DrawStyle::LIGHTTEXT); posPix = (int)(302. * ((double)lengthFrames - ((double)endMargin) * myRec->recInfo->fps) / ((double)lengthFrames)); - rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, Colour::LIGHTTEXT); - rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, Colour::LIGHTTEXT); + rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 - 2, 2, 2, DrawStyle::LIGHTTEXT); + rectangle(barRegion.x + progBarXbase + 2 + posPix, barRegion.y + 12 + 24, 2, 2, DrawStyle::LIGHTTEXT); } } diff --git a/vvideorec.h b/vvideorec.h index 383b8ef..ab7dd6f 100644 --- a/vvideorec.h +++ b/vvideorec.h @@ -80,8 +80,8 @@ class VVideoRec : public Boxx, public TimerReceiver, public OSDReceiver VAudioSelector* vas; - Colour transparent; - Colour barBlue; + DrawStyle transparent; + DrawStyle barBlue; UCHAR videoMode; void toggleChopSides(); diff --git a/vvolume.cc b/vvolume.cc index c68b7a4..02cbf74 100644 --- a/vvolume.cc +++ b/vvolume.cc @@ -55,7 +55,7 @@ void VVolume::draw() { Boxx::draw(); - fillColour(Colour::VIEWBACKGROUND); + fillColour(DrawStyle::VIEWBACKGROUND); WSymbol w; TEMPADD(&w); diff --git a/vwelcome.cc b/vwelcome.cc index 28cc489..258bb56 100644 --- a/vwelcome.cc +++ b/vwelcome.cc @@ -59,7 +59,7 @@ VWelcome::VWelcome() } setTitleBarOn(1); - setTitleBarColour(Colour::TITLEBARBACKGROUND); + setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); sl.setPosition(20, 40); sl.setSize(200, 160); @@ -118,7 +118,7 @@ void VWelcome::drawClock() time(&t); struct tm* tms = localtime(&t); strftime(timeString, 19, "%H:%M", tms); - drawTextRJ(timeString, 450, 5, Colour::LIGHTTEXT); + drawTextRJ(timeString, 450, 5, DrawStyle::LIGHTTEXT); time_t dt = 60 - (t % 60); // seconds to the next minute if (dt == 0) dt = 60; // advance a whole minute if necessary diff --git a/wbutton.cc b/wbutton.cc index 5f4a6fc..40d74e2 100644 --- a/wbutton.cc +++ b/wbutton.cc @@ -62,18 +62,18 @@ void WButton::draw() { if (dimmed) { - fillColour(Colour::BLACK); - drawTextCentre(mytext, area.w / 2, 0, Colour::SELECTHIGHLIGHT); + fillColour(DrawStyle::BLACK); + drawTextCentre(mytext, area.w / 2, 0, DrawStyle::SELECTHIGHLIGHT); } else if (active) { - fillColour(Colour::SELECTHIGHLIGHT); - drawTextCentre(mytext, area.w / 2, 0, Colour::DARKTEXT); + fillColour(DrawStyle::SELECTHIGHLIGHT); + drawTextCentre(mytext, area.w / 2, 0, DrawStyle::DARKTEXT); } else { - fillColour(Colour::BUTTONBACKGROUND); - drawTextCentre(mytext, area.w / 2, 0, Colour::LIGHTTEXT); + fillColour(DrawStyle::BUTTONBACKGROUND); + drawTextCentre(mytext, area.w / 2, 0, DrawStyle::LIGHTTEXT); } } diff --git a/woptionbox.cc b/woptionbox.cc index 6e43230..9d1316f 100644 --- a/woptionbox.cc +++ b/woptionbox.cc @@ -76,17 +76,17 @@ void WOptionBox::setData() if (active) { - textbox.setForegroundColour(Colour::DARKTEXT); - textbox.setBackgroundColour(Colour::SELECTHIGHLIGHT); - leftArrow.nextColour = Colour::SELECTHIGHLIGHT; - rightArrow.nextColour = Colour::SELECTHIGHLIGHT; + textbox.setForegroundColour(DrawStyle::DARKTEXT); + textbox.setBackgroundColour(DrawStyle::SELECTHIGHLIGHT); + leftArrow.nextColour = DrawStyle::SELECTHIGHLIGHT; + rightArrow.nextColour = DrawStyle::SELECTHIGHLIGHT; } else { - textbox.setForegroundColour(Colour::LIGHTTEXT); - textbox.setBackgroundColour(Colour::BUTTONBACKGROUND); - leftArrow.nextColour = Colour::BUTTONBACKGROUND; - rightArrow.nextColour = Colour::BUTTONBACKGROUND; + textbox.setForegroundColour(DrawStyle::LIGHTTEXT); + textbox.setBackgroundColour(DrawStyle::BUTTONBACKGROUND); + leftArrow.nextColour = DrawStyle::BUTTONBACKGROUND; + rightArrow.nextColour = DrawStyle::BUTTONBACKGROUND; } textbox.setText(options[currentOption]); diff --git a/woptionpane.cc b/woptionpane.cc index 00df782..690ab79 100644 --- a/woptionpane.cc +++ b/woptionpane.cc @@ -45,7 +45,7 @@ WOptionPane::~WOptionPane() void WOptionPane::draw() { Boxx::draw(); - drawText(tr("Press back to exit, <, > or [ok] to change"), 10, area.h - 30, Colour::LIGHTTEXT); + drawText(tr("Press back to exit, <, > or [ok] to change"), 10, area.h - 30, DrawStyle::LIGHTTEXT); } void WOptionPane::saveOpts() diff --git a/wprogressbar.cc b/wprogressbar.cc index b025a88..9ce9892 100644 --- a/wprogressbar.cc +++ b/wprogressbar.cc @@ -45,12 +45,12 @@ void WProgressBar::draw() // Hmm, can't draw two boxes because should not paint on areas // not needing it - this class does not know the background colour - rectangle(0, 0, area.w, 2, Colour::LIGHTTEXT); // top - rectangle(0, area.h - 2, area.w, 2, Colour::LIGHTTEXT); // bottom - rectangle(0, 0, 2, area.h, Colour::LIGHTTEXT); // left - rectangle(area.w - 2, 0, 2, area.h, Colour::LIGHTTEXT); // right + rectangle(0, 0, area.w, 2, DrawStyle::LIGHTTEXT); // top + rectangle(0, area.h - 2, area.w, 2, DrawStyle::LIGHTTEXT); // bottom + rectangle(0, 0, 2, area.h, DrawStyle::LIGHTTEXT); // left + rectangle(area.w - 2, 0, 2, area.h, DrawStyle::LIGHTTEXT); // right int progressWidth = (int)((area.w - 4) * (float)percent / 100); - rectangle(2, 2, progressWidth, area.h - 4, Colour::SELECTHIGHLIGHT); + rectangle(2, 2, progressWidth, area.h - 4, DrawStyle::SELECTHIGHLIGHT); } diff --git a/wremoteconfig.cc b/wremoteconfig.cc index 3d6e7ef..f982b7f 100644 --- a/wremoteconfig.cc +++ b/wremoteconfig.cc @@ -85,17 +85,17 @@ void WRemoteConfig::draw() { Boxx::draw(); - drawText(tr("Command"), 15, 4, Colour::LIGHTTEXT); - drawText(tr("Hard wired"), 165, 4, Colour::LIGHTTEXT); - drawText(tr("User assignable"), 315, 4, Colour::LIGHTTEXT); + drawText(tr("Command"), 15, 4, DrawStyle::LIGHTTEXT); + drawText(tr("Hard wired"), 165, 4, DrawStyle::LIGHTTEXT); + drawText(tr("User assignable"), 315, 4, DrawStyle::LIGHTTEXT); if (learnmode) { - drawText(tr("Learning! Press any hardwired key to exit."), 15, area.h - 30, Colour::SELECTHIGHLIGHT); + drawText(tr("Learning! Press any hardwired key to exit."), 15, area.h - 30, DrawStyle::SELECTHIGHLIGHT); } else { - drawText(tr("Press [ok] for learning or MENU to reset to defaults."), 15, area.h - 30, Colour::LIGHTTEXT); + drawText(tr("Press [ok] for learning or MENU to reset to defaults."), 15, area.h - 30, DrawStyle::LIGHTTEXT); } } diff --git a/wselectlist.cc b/wselectlist.cc index 73177f4..9707b99 100644 --- a/wselectlist.cc +++ b/wselectlist.cc @@ -23,7 +23,8 @@ #include "colour.h" #include "log.h" -WSelectList::WSelectList() +WSelectList::WSelectList(): +backgroundColour(DrawStyle::VIEWBACKGROUND) { selectedOption = 0; topOption = 0; @@ -33,7 +34,7 @@ WSelectList::WSelectList() gap = 1; showseloption = true; darkseloption = false; - backgroundColour = Colour::VIEWBACKGROUND; + } WSelectList::~WSelectList() @@ -61,7 +62,7 @@ void WSelectList::setNoLoop() noLoop = 1; } -void WSelectList::setBackgroundColour(const Colour& colour) +void WSelectList::setBackgroundColour(const DrawStyle& colour) { backgroundColour = colour; } @@ -119,14 +120,14 @@ void WSelectList::draw() if (i == selectedOption && showseloption) { - rectangle(0, ypos, area.w, fontHeight, darkseloption ? Colour::SELECTDARKHIGHLIGHT: Colour::SELECTHIGHLIGHT); + rectangle(0, ypos, area.w, fontHeight, darkseloption ? DrawStyle::SELECTDARKHIGHLIGHT: DrawStyle::SELECTHIGHLIGHT); - drawOptionLine(options[i].text, 5, ypos, area.w - 5, Colour::DARKTEXT); + drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::DARKTEXT); } else { - drawOptionLine(options[i].text, 5, ypos, area.w - 5, Colour::LIGHTTEXT); + drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::LIGHTTEXT); } ypos += ySeperation; } @@ -139,7 +140,7 @@ void WSelectList::addColumn(int x) columns[numColumns++] = x; } -void WSelectList::drawOptionLine(char* text, int xpos, int ypos, int width, const Colour& colour) +void WSelectList::drawOptionLine(char* text, int xpos, int ypos, int width, const DrawStyle& colour) { if (!numColumns) { diff --git a/wselectlist.h b/wselectlist.h index c27f73e..9d5a62b 100644 --- a/wselectlist.h +++ b/wselectlist.h @@ -41,7 +41,7 @@ class WSelectList : public Boxx { public: WSelectList(); - ~WSelectList(); + virtual ~WSelectList(); void clear(); void addColumn(int x); @@ -50,7 +50,7 @@ class WSelectList : public Boxx void setDarkSelOption(bool set) { darkseloption = set; }; int addOption(const char* text, ULONG data, int selected); void draw(); - void setBackgroundColour(const Colour& colour); + void setBackgroundColour(const DrawStyle& colour); void down(); void up(); @@ -71,7 +71,7 @@ class WSelectList : public Boxx virtual bool mouseAndroidScroll(int x, int y,int sx, int sy); private: - void drawOptionLine(char* text, int xpos, int ypos, int width, const Colour& colour); + void drawOptionLine(char* text, int xpos, int ypos, int width, const DrawStyle& colour); int getMouseLine(int x, int y); vector options; @@ -84,7 +84,7 @@ class WSelectList : public Boxx bool showseloption, darkseloption; UINT gap; - Colour backgroundColour; + DrawStyle &backgroundColour; }; #endif diff --git a/wsymbol.cc b/wsymbol.cc index 6d4035f..99b0857 100644 --- a/wsymbol.cc +++ b/wsymbol.cc @@ -1060,7 +1060,7 @@ UCHAR WSymbol::symbols[] = { WSymbol::WSymbol() { nextSymbol = 0; - nextColour = Colour::LIGHTTEXT; + nextColour = DrawStyle::LIGHTTEXT; } void WSymbol::draw() diff --git a/wtabbar.cc b/wtabbar.cc index eb8ec53..a33bae7 100644 --- a/wtabbar.cc +++ b/wtabbar.cc @@ -28,15 +28,15 @@ WTabBar::WTabBar() { buttonBarActive = true; visiblePane = 0; - setBackgroundColour(Colour::VIEWBACKGROUND); + setBackgroundColour(DrawStyle::VIEWBACKGROUND); symbolLeft.setPosition(0, 4); - symbolLeft.nextColour = Colour::BUTTONBACKGROUND; + symbolLeft.nextColour = DrawStyle::BUTTONBACKGROUND; symbolLeft.nextSymbol = WSymbol::LEFTARROW; add(&symbolLeft); symbolRight.setPosition(0, 4); // will be reset in addtab - symbolRight.nextColour = Colour::BUTTONBACKGROUND; + symbolRight.nextColour = DrawStyle::BUTTONBACKGROUND; symbolRight.nextSymbol = WSymbol::RIGHTARROW; add(&symbolRight); } @@ -88,7 +88,7 @@ void WTabBar::addTab(const char* name, Boxx* boxx) { newButton->setActive(false); boxx->setVisible(false); - symbolRight.nextColour = Colour::SELECTHIGHLIGHT; // if this is the 2nd+ tab, ensure right arrow goes active + symbolRight.nextColour = DrawStyle::SELECTHIGHLIGHT; // if this is the 2nd+ tab, ensure right arrow goes active } // WTabbar doesn't know its width during the constructor @@ -124,8 +124,8 @@ int WTabBar::handleCommand(int command) { buttonBarActive = true; tabs[visiblePane].button->setActive(true); - if (visiblePane != 0) symbolLeft.nextColour = Colour::SELECTHIGHLIGHT; - if (visiblePane != tabs.size() - 1) symbolRight.nextColour = Colour::SELECTHIGHLIGHT; + if (visiblePane != 0) symbolLeft.nextColour = DrawStyle::SELECTHIGHLIGHT; + if (visiblePane != tabs.size() - 1) symbolRight.nextColour = DrawStyle::SELECTHIGHLIGHT; draw(); return 1; } @@ -154,8 +154,8 @@ int WTabBar::handleCommand(int command) { buttonBarActive = false; tabs[visiblePane].button->dim(); - symbolLeft.nextColour = Colour::BUTTONBACKGROUND; - symbolRight.nextColour = Colour::BUTTONBACKGROUND; + symbolLeft.nextColour = DrawStyle::BUTTONBACKGROUND; + symbolRight.nextColour = DrawStyle::BUTTONBACKGROUND; if (tabs[visiblePane].pane->handleCommand(command) == 1) // shouldn't return anything else at this point?! { draw(); @@ -178,8 +178,8 @@ bool WTabBar::left() tabs[visiblePane].button->setActive(true); tabs[visiblePane].pane->setVisible(true); - if (visiblePane == 0) symbolLeft.nextColour = Colour::BUTTONBACKGROUND; - symbolRight.nextColour = Colour::SELECTHIGHLIGHT; + if (visiblePane == 0) symbolLeft.nextColour = DrawStyle::BUTTONBACKGROUND; + symbolRight.nextColour = DrawStyle::SELECTHIGHLIGHT; // Move the buttons.. if (tabs[visiblePane].button->getVisible() == false) @@ -212,8 +212,8 @@ bool WTabBar::right() tabs[visiblePane].button->setActive(true); tabs[visiblePane].pane->setVisible(true); - if (visiblePane == tabs.size() - 1) symbolRight.nextColour = Colour::BUTTONBACKGROUND; - symbolLeft.nextColour = Colour::SELECTHIGHLIGHT; + if (visiblePane == tabs.size() - 1) symbolRight.nextColour = DrawStyle::BUTTONBACKGROUND; + symbolLeft.nextColour = DrawStyle::SELECTHIGHLIGHT; // Move the buttons.. if (tabs[visiblePane].button->getVisible() == false) @@ -256,8 +256,8 @@ bool WTabBar::mouseMove(int x, int y) { if (buttonBarActive){ buttonBarActive = false; tabs[visiblePane].button->dim(); - symbolLeft.nextColour = Colour::BUTTONBACKGROUND; - symbolRight.nextColour = Colour::BUTTONBACKGROUND; + symbolLeft.nextColour = DrawStyle::BUTTONBACKGROUND; + symbolRight.nextColour = DrawStyle::BUTTONBACKGROUND; } draw(); @@ -287,8 +287,8 @@ bool WTabBar::mouseLBDOWN(int x, int y) { if (tabs[visiblePane].pane->mouseLBDOWN(x,y)) { buttonBarActive = false; tabs[visiblePane].button->dim(); - symbolLeft.nextColour = Colour::BUTTONBACKGROUND; - symbolRight.nextColour = Colour::BUTTONBACKGROUND; + symbolLeft.nextColour = DrawStyle::BUTTONBACKGROUND; + symbolRight.nextColour = DrawStyle::BUTTONBACKGROUND; draw(); return true; } diff --git a/wtextbox.cc b/wtextbox.cc index d065760..048bec0 100644 --- a/wtextbox.cc +++ b/wtextbox.cc @@ -22,14 +22,15 @@ #include "colour.h" -WTextbox::WTextbox(const char* ttext) +WTextbox::WTextbox(const char* ttext): +foreColour(DrawStyle::LIGHTTEXT) { // int fontHeight = Surface::getFontHeight(); //setDimensions(70, fontHeight); //setDimensions(100,100); setSize(100, 100); text = NULL; - foreColour = Colour::LIGHTTEXT; + textX = 5; textY = 2; @@ -56,7 +57,7 @@ void WTextbox::setText(const char* takeText) strcpy(text, takeText); } -void WTextbox::setForegroundColour(const Colour& fcolour) +void WTextbox::setForegroundColour(const DrawStyle& fcolour) { foreColour = fcolour; } diff --git a/wtextbox.h b/wtextbox.h index bf378bf..3bab197 100644 --- a/wtextbox.h +++ b/wtextbox.h @@ -33,17 +33,17 @@ class WTextbox : public Boxx { public: WTextbox(const char* ttext = NULL); - ~WTextbox(); + virtual ~WTextbox(); void setText(const char* text); void draw(); - void setForegroundColour(const Colour& fcolour); + void setForegroundColour(const DrawStyle& fcolour); void setTextPos(int x, int y); // optional void setParaMode(bool mode); private: char* text; - Colour foreColour; + DrawStyle& foreColour; int textX; int textY; bool paraMode; diff --git a/wwinaudiofilter.cc b/wwinaudiofilter.cc index 301e82d..126d93f 100644 --- a/wwinaudiofilter.cc +++ b/wwinaudiofilter.cc @@ -81,30 +81,30 @@ void WWinAudioFilter::draw() { Boxx::draw(); - drawText(tr("Selected Filter:"), 15, 15, Colour::LIGHTTEXT); + drawText(tr("Selected Filter:"), 15, 15, DrawStyle::LIGHTTEXT); int filselected; AudioWin *aw=(AudioWin*) Audio::getInstance(); const AudioFilterDescList *list=aw->getAudioFilterList(filselected); - if (filselected!=-1) drawText((*list)[filselected].friendlyname,215,15,Colour::LIGHTTEXT); + if (filselected!=-1) drawText((*list)[filselected].friendlyname,215,15,DrawStyle::LIGHTTEXT); sl.draw(); /* if (!(*list)[sl.getCurrentOptionData()].vmr9tested) { - rectangle(area.w - 220, 160, 200, 20, Colour::YELLOW); - drawText(tr("VMR 9 support: ?"), area.w - 220, 160, Colour::DARKTEXT); + rectangle(area.w - 220, 160, 200, 20, DrawStyle::YELLOW); + drawText(tr("VMR 9 support: ?"), area.w - 220, 160, DrawStyle::DARKTEXT); } else if ((*list)[sl.getCurrentOptionData()].vmr9) { - rectangle(area.w - 220, 160, 200, 20, Colour::GREEN); - drawText(tr("VMR 9 support: yes"), area.w - 220, 160, Colour::DARKTEXT); + rectangle(area.w - 220, 160, 200, 20, DrawStyle::GREEN); + drawText(tr("VMR 9 support: yes"), area.w - 220, 160, DrawStyle::DARKTEXT); } else { - rectangle(area.w - 220, 160, 200, 20, Colour::RED); - drawText(tr("VMR 9 support: no"), area.w - 220, 160, Colour::DARKTEXT); + rectangle(area.w - 220, 160, 200, 20, DrawStyle::RED); + drawText(tr("VMR 9 support: no"), area.w - 220, 160, DrawStyle::DARKTEXT); } */ - drawText(tr("Press [ok] to select filter! "), 15, area.h - 30, Colour::LIGHTTEXT); + drawText(tr("Press [ok] to select filter! "), 15, area.h - 30, DrawStyle::LIGHTTEXT); } diff --git a/wwinmp3audiofilter.cc b/wwinmp3audiofilter.cc index 69db75e..891f05e 100644 --- a/wwinmp3audiofilter.cc +++ b/wwinmp3audiofilter.cc @@ -85,30 +85,30 @@ void WWinMp3AudioFilter::draw() { Boxx::draw(); - drawText(tr("Selected Filter:"), 15, 15, Colour::LIGHTTEXT); + drawText(tr("Selected Filter:"), 15, 15, DrawStyle::LIGHTTEXT); int filselected; AudioWin *aw=(AudioWin*) Audio::getInstance(); const AudioFilterDescList *list=aw->getMp3AudioFilterList(filselected); - if (filselected!=-1) drawText((*list)[filselected].friendlyname,215,15,Colour::LIGHTTEXT); + if (filselected!=-1) drawText((*list)[filselected].friendlyname,215,15,DrawStyle::LIGHTTEXT); sl.draw(); /* if (!(*list)[sl.getCurrentOptionData()].vmr9tested) { - rectangle(area.w - 220, 160, 200, 20, Colour::YELLOW); - drawText(tr("VMR 9 support: ?"), area.w - 220, 160, Colour::DARKTEXT); + rectangle(area.w - 220, 160, 200, 20, DrawStyle::YELLOW); + drawText(tr("VMR 9 support: ?"), area.w - 220, 160, DrawStyle::DARKTEXT); } else if ((*list)[sl.getCurrentOptionData()].vmr9) { - rectangle(area.w - 220, 160, 200, 20, Colour::GREEN); - drawText(tr("VMR 9 support: yes"), area.w - 220, 160, Colour::DARKTEXT); + rectangle(area.w - 220, 160, 200, 20, DrawStyle::GREEN); + drawText(tr("VMR 9 support: yes"), area.w - 220, 160, DrawStyle::DARKTEXT); } else { - rectangle(area.w - 220, 160, 200, 20, Colour::RED); - drawText(tr("VMR 9 support: no"), area.w - 220, 160, Colour::DARKTEXT); + rectangle(area.w - 220, 160, 200, 20, DrawStyle::RED); + drawText(tr("VMR 9 support: no"), area.w - 220, 160, DrawStyle::DARKTEXT); } */ - drawText(tr("Press [ok] to select filter! "), 15, area.h - 30, Colour::LIGHTTEXT); + drawText(tr("Press [ok] to select filter! "), 15, area.h - 30, DrawStyle::LIGHTTEXT); diff --git a/wwinvideofilter.cc b/wwinvideofilter.cc index 7ec4911..718b9fa 100644 --- a/wwinvideofilter.cc +++ b/wwinvideofilter.cc @@ -81,30 +81,30 @@ void WWinVideoFilter::draw() { Boxx::draw(); - drawText(tr("Selected Filter:"), 15, 15, Colour::LIGHTTEXT); + drawText(tr("Selected Filter:"), 15, 15, DrawStyle::LIGHTTEXT); int filselected; VideoWin *vw=(VideoWin*) Video::getInstance(); const VideoFilterDescList *list=vw->getVideoFilterList(filselected); - if (filselected!=-1) drawText((*list)[filselected].friendlyname,215,15,Colour::LIGHTTEXT); + if (filselected!=-1) drawText((*list)[filselected].friendlyname,215,15,DrawStyle::LIGHTTEXT); sl.draw(); if (!(*list)[sl.getCurrentOptionData()].vmr9tested) { - rectangle(area.w - 220, 160, 200, 20, Colour::YELLOW); - drawText(tr("VMR 9 support: ?"), area.w - 220, 160, Colour::DARKTEXT); + rectangle(area.w - 220, 160, 200, 20, DrawStyle::YELLOW); + drawText(tr("VMR 9 support: ?"), area.w - 220, 160, DrawStyle::DARKTEXT); } else if ((*list)[sl.getCurrentOptionData()].vmr9) { - rectangle(area.w - 220, 160, 200, 20, Colour::GREEN); - drawText(tr("VMR 9 support: yes"), area.w - 220, 160, Colour::DARKTEXT); + rectangle(area.w - 220, 160, 200, 20, DrawStyle::GREEN); + drawText(tr("VMR 9 support: yes"), area.w - 220, 160, DrawStyle::DARKTEXT); } else { - rectangle(area.w - 220, 160, 200, 20, Colour::RED); - drawText(tr("VMR 9 support: no"), area.w - 220, 160, Colour::DARKTEXT); + rectangle(area.w - 220, 160, 200, 20, DrawStyle::RED); + drawText(tr("VMR 9 support: no"), area.w - 220, 160, DrawStyle::DARKTEXT); } - drawText(tr("Press [ok] to select filter! "), 15, area.h - 30, Colour::LIGHTTEXT); + drawText(tr("Press [ok] to select filter! "), 15, area.h - 30, DrawStyle::LIGHTTEXT); } diff --git a/wwinvideoh264filter.cc b/wwinvideoh264filter.cc index a4a67da..401fb1f 100644 --- a/wwinvideoh264filter.cc +++ b/wwinvideoh264filter.cc @@ -81,30 +81,30 @@ void WWinVideoH264Filter::draw() { Boxx::draw(); - drawText(tr("Selected Filter:"), 15, 15, Colour::LIGHTTEXT); + drawText(tr("Selected Filter:"), 15, 15, DrawStyle::LIGHTTEXT); int filselected; VideoWin *vw=(VideoWin*) Video::getInstance(); const VideoFilterDescList *list=vw->getVideoH264FilterList(filselected); - if (filselected!=-1) drawText((*list)[filselected].friendlyname,215,15,Colour::LIGHTTEXT); + if (filselected!=-1) drawText((*list)[filselected].friendlyname,215,15,DrawStyle::LIGHTTEXT); sl.draw(); if (!(*list)[sl.getCurrentOptionData()].vmr9tested) { - rectangle(area.w - 220, 160, 200, 20, Colour::YELLOW); - drawText(tr("VMR 9 support: ?"), area.w - 220, 160, Colour::DARKTEXT); + rectangle(area.w - 220, 160, 200, 20, DrawStyle::YELLOW); + drawText(tr("VMR 9 support: ?"), area.w - 220, 160, DrawStyle::DARKTEXT); } else if ((*list)[sl.getCurrentOptionData()].vmr9) { - rectangle(area.w - 220, 160, 200, 20, Colour::GREEN); - drawText(tr("VMR 9 support: yes"), area.w - 220, 160, Colour::DARKTEXT); + rectangle(area.w - 220, 160, 200, 20, DrawStyle::GREEN); + drawText(tr("VMR 9 support: yes"), area.w - 220, 160, DrawStyle::DARKTEXT); } else { - rectangle(area.w - 220, 160, 200, 20, Colour::RED); - drawText(tr("VMR 9 support: no"), area.w - 220, 160, Colour::DARKTEXT); + rectangle(area.w - 220, 160, 200, 20, DrawStyle::RED); + drawText(tr("VMR 9 support: no"), area.w - 220, 160, DrawStyle::DARKTEXT); } - drawText(tr("Press [ok] to select filter! "), 15, area.h - 30, Colour::LIGHTTEXT); + drawText(tr("Press [ok] to select filter! "), 15, area.h - 30, DrawStyle::LIGHTTEXT); } -- 2.39.2