From bdccbbe93e9729944787d3158bee7a755d3bf286 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 18 May 2002 14:03:22 +0200 Subject: Completely moved OSD handling out of the cDvbApi class, into the new cOsd --- osd.h | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'osd.h') diff --git a/osd.h b/osd.h index 174bf099..88c986c8 100644 --- a/osd.h +++ b/osd.h @@ -4,14 +4,19 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osd.h 1.30 2002/05/18 12:36:30 kls Exp $ + * $Id: osd.h 1.31 2002/05/18 14:00:15 kls Exp $ */ #ifndef __OSD_H #define __OSD_H +#if defined(DEBUG_OSD) || defined(REMOTE_KBD) +#include +#endif #include "config.h" +#include "dvbosd.h" #include "interface.h" +#include "osdbase.h" #include "tools.h" #define MAXOSDITEMS (Setup.OSDheight - 4) @@ -47,6 +52,38 @@ enum eOSState { osUnknown, osUser10, }; +class cOsd { +private: + enum { charWidth = 12, // average character width + lineHeight = 27 // smallest text height + }; +#ifdef DEBUG_OSD + static WINDOW *window; + enum { MaxColorPairs = 16 }; + static int colorPairs[MaxColorPairs]; + static void SetColor(eDvbColor colorFg, eDvbColor colorBg = clrBackground); +#else + static cDvbOsd *osd; +#endif + static int cols, rows; +public: + static void Initialize(void); + static void Shutdown(void); + static void Open(int w, int h); + static void Close(void); + static void Clear(void); + static void Fill(int x, int y, int w, int h, eDvbColor color = clrBackground); + static void SetBitmap(int x, int y, const cBitmap &Bitmap); + static void ClrEol(int x, int y, eDvbColor color = clrBackground); + static int CellWidth(void); + static int LineHeight(void); + static int Width(unsigned char c); + static int WidthInCells(const char *s); + static eDvbFont SetFont(eDvbFont Font); + static void Text(int x, int y, const char *s, eDvbColor colorFg = clrWhite, eDvbColor colorBg = clrBackground); + static void Flush(void); + }; + class cOsdItem : public cListObject { private: const char *text; -- cgit v1.2.3