diff --git a/HISTORY b/HISTORY index 2bf08514..9abd54ee 100644 --- a/HISTORY +++ b/HISTORY @@ -2864,3 +2864,5 @@ Video Disk Recorder Revision History CA ids to be added to the channel definitions (thanks to Wayne Keer for reporting this one, and Marcel Wiesweg for fixing it). - Fixed handling colors in cDvbSpuPalette::yuv2rgb() (thanks to Marco Schlüßler). +- Made some functions of cFont virtual to allow implementing dummy fonts for the + 'curses' skin. diff --git a/font.c b/font.c index 9a5b31e3..bd6a3b11 100644 --- a/font.c +++ b/font.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: font.c 1.7 2004/05/16 10:50:59 kls Exp $ + * $Id: font.c 1.8 2004/05/31 14:09:00 kls Exp $ */ #include "config.h" @@ -54,9 +54,13 @@ cFont::cFont(void *Data) void cFont::SetData(void *Data) { - height = ((tCharData *)Data)->height; - for (int i = 0; i < NUMCHARS; i++) - data[i] = (tCharData *)&((tPixelData *)Data)[(i < 32 ? 0 : i - 32) * (height + 2)]; + if (Data) { + height = ((tCharData *)Data)->height; + for (int i = 0; i < NUMCHARS; i++) + data[i] = (tCharData *)&((tPixelData *)Data)[(i < 32 ? 0 : i - 32) * (height + 2)]; + } + else + height = 0; } int cFont::Width(const char *s) const diff --git a/font.h b/font.h index 3803960b..36aab9dc 100644 --- a/font.h +++ b/font.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: font.h 1.7 2004/05/16 10:49:44 kls Exp $ + * $Id: font.h 1.8 2004/05/31 14:09:00 kls Exp $ */ #ifndef __FONT_H @@ -43,15 +43,15 @@ private: public: cFont(void *Data); void SetData(void *Data); - int Width(unsigned char c) const { return data[c]->width; } + virtual int Width(unsigned char c) const { return data[c]->width; } ///< Returns the width of the given character. - int Width(const char *s) const; + virtual int Width(const char *s) const; ///< Returns the width of the given string. - int Height(unsigned char c) const { return data[c]->height; } + virtual int Height(unsigned char c) const { return data[c]->height; } ///< Returns the height of the given character. - int Height(const char *s) const; + virtual int Height(const char *s) const; ///< Returns the height of the given string. - int Height(void) const { return height; } + virtual int Height(void) const { return height; } ///< Returns the height of this font (all characters have the same height). const tCharData *CharData(unsigned char c) const { return data[c]; } static bool SetCode(const char *Code); diff --git a/osd.h b/osd.h index c942acc0..de0db694 100644 --- a/osd.h +++ b/osd.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osd.h 1.42 2004/05/28 15:25:58 kls Exp $ + * $Id: osd.h 1.43 2004/05/31 14:09:00 kls Exp $ */ #ifndef __OSD_H @@ -290,7 +290,7 @@ public: ///< -1..-8 draws the inverted part of the given quadrant(s) ///< If Quadrants is not 0, the coordinates are those of the actual area, not ///< the full circle! - void DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type); + virtual void DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type); ///< Draws a "slope" into the rectangle defined by the upper left (x1, y1) and ///< lower right (x2, y2) corners with the given Color. Type controls the ///< direction of the slope and which side of it will be drawn: diff --git a/skinclassic.c b/skinclassic.c index cc32f9f0..9dd90942 100644 --- a/skinclassic.c +++ b/skinclassic.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinclassic.c 1.6 2004/05/29 13:29:00 kls Exp $ + * $Id: skinclassic.c 1.7 2004/05/31 14:09:00 kls Exp $ */ #include "skinclassic.h" @@ -71,7 +71,7 @@ THEME_CLR(Theme, clrReplayProgressCurrent, clrRed); // --- cSkinClassicDisplayChannel -------------------------------------------- -class cSkinClassicDisplayChannel : public cSkinDisplayChannel{ +class cSkinClassicDisplayChannel : public cSkinDisplayChannel { private: cOsd *osd; int lineHeight; diff --git a/skinsttng.c b/skinsttng.c index b1027cb3..ec7cac73 100644 --- a/skinsttng.c +++ b/skinsttng.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinsttng.c 1.4 2004/05/29 13:14:09 kls Exp $ + * $Id: skinsttng.c 1.5 2004/05/31 14:09:00 kls Exp $ */ // Star Trek: The Next Generation® is a registered trademark of Paramount Pictures @@ -116,7 +116,7 @@ THEME_CLR(Theme, clrReplayProgressCurrent, clrRed); // --- cSkinSTTNGDisplayChannel ---------------------------------------------- -class cSkinSTTNGDisplayChannel : public cSkinDisplayChannel{ +class cSkinSTTNGDisplayChannel : public cSkinDisplayChannel { private: cOsd *osd; int x0, x1, x2, x3, x4, x5, x6, x7;