vdr  2.2.0
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
cCursesOsd Class Reference

Public Member Functions

 cCursesOsd (int Left, int Top)
 
virtual ~cCursesOsd ()
 
virtual void SaveRegion (int x1, int y1, int x2, int y2)
 
virtual void RestoreRegion (void)
 
virtual void DrawText (int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width=0, int Height=0, int Alignment=taDefault)
 
virtual void DrawRectangle (int x1, int y1, int x2, int y2, tColor Color)
 
virtual void Flush (void)
 
- Public Member Functions inherited from cOsd
virtual ~cOsd ()
 
bool IsTrueColor (void) const
 
int Left (void)
 
int Top (void)
 
int Width (void)
 
int Height (void)
 
void SetAntiAliasGranularity (uint FixedColors, uint BlendColors)
 
cBitmapGetBitmap (int Area)
 
virtual cPixmapCreatePixmap (int Layer, const cRect &ViewPort, const cRect &DrawPort=cRect::Null)
 
virtual void DestroyPixmap (cPixmap *Pixmap)
 
virtual void DrawImage (const cPoint &Point, const cImage &Image)
 
virtual void DrawImage (const cPoint &Point, int ImageHandle)
 
virtual eOsdError CanHandleAreas (const tArea *Areas, int NumAreas)
 
virtual eOsdError SetAreas (const tArea *Areas, int NumAreas)
 
virtual eOsdError SetPalette (const cPalette &Palette, int Area)
 
virtual void DrawPixel (int x, int y, tColor Color)
 
virtual void DrawBitmap (int x, int y, const cBitmap &Bitmap, tColor ColorFg=0, tColor ColorBg=0, bool ReplacePalette=false, bool Overlay=false)
 
virtual void DrawScaledBitmap (int x, int y, const cBitmap &Bitmap, double FactorX, double FactorY, bool AntiAlias=false)
 
virtual void DrawEllipse (int x1, int y1, int x2, int y2, tColor Color, int Quadrants=0)
 
virtual void DrawSlope (int x1, int y1, int x2, int y2, tColor Color, int Type)
 

Private Types

enum  { MaxColorPairs = 16 }
 

Private Member Functions

void SetColor (int colorFg, int colorBg=clrBackground)
 

Private Attributes

WINDOW * savedRegion
 
WINDOW * window
 
int colorPairs [MaxColorPairs]
 

Additional Inherited Members

- Static Public Member Functions inherited from cOsd
static int OsdLeft (void)
 
static int OsdTop (void)
 
static int OsdWidth (void)
 
static int OsdHeight (void)
 
static void SetOsdPosition (int Left, int Top, int Width, int Height)
 
static int IsOpen (void)
 
- Protected Member Functions inherited from cOsd
 cOsd (int Left, int Top, uint Level)
 
bool Active (void)
 
virtual void SetActive (bool On)
 
cPixmapAddPixmap (cPixmap *Pixmap)
 
cPixmapRenderPixmaps (void)
 

Detailed Description

Definition at line 59 of file skincurses.c.

Member Enumeration Documentation

anonymous enum
private
Enumerator
MaxColorPairs 

Definition at line 63 of file skincurses.c.

Constructor & Destructor Documentation

cCursesOsd::cCursesOsd ( int  Left,
int  Top 
)
cCursesOsd::~cCursesOsd ( )
virtual

Definition at line 89 of file skincurses.c.

References Flush(), and window.

Member Function Documentation

void cCursesOsd::DrawRectangle ( int  x1,
int  y1,
int  x2,
int  y2,
tColor  Color 
)
virtual

Draws a filled rectangle defined by the upper left (x1, y1) and lower right (x2, y2) corners with the given Color.

Reimplemented from cOsd.

Definition at line 174 of file skincurses.c.

References SetColor(), and window.

Referenced by DrawText().

void cCursesOsd::DrawText ( int  x,
int  y,
const char *  s,
tColor  ColorFg,
tColor  ColorBg,
const cFont Font,
int  Width = 0,
int  Height = 0,
int  Alignment = taDefault 
)
virtual

Draws the given string at coordinates (x, y) with the given foreground and background color and font.

If Width and Height are given, the text will be drawn into a rectangle with the given size and the given Alignment (default is top-left). If ColorBg is clrTransparent, no background pixels will be drawn, which allows drawing "transparent" text.

Reimplemented from cOsd.

Definition at line 136 of file skincurses.c.

References DrawRectangle(), cFont::Height(), ScOsdWidth, SetColor(), taBottom, taLeft, taRight, taTop, cFont::Width(), and window.

void cCursesOsd::Flush ( void  )
virtual

Actually commits all data to the OSD hardware.

Flush() should return as soon as possible. For a true color OSD using the default implementation with in memory pixmaps, the Flush() function should basically do something like this:

LOCK_PIXMAPS; while (cPixmapMemory *pm = dynamic_cast<cPixmapMemory *>(RenderPixmaps())) { int w = pm->ViewPort().Width(); int h = pm->ViewPort().Height(); int d = w * sizeof(tColor); MyOsdDrawPixmap(Left() + pm->ViewPort().X(), Top() + pm->ViewPort().Y(), pm->Data(), w, h, h * d); DestroyPixmap(pm); }

If a plugin uses a derived cPixmap implementation, it needs to use that type instead of cPixmapMemory.

Reimplemented from cOsd.

Definition at line 184 of file skincurses.c.

Referenced by cSkinCursesDisplayMenu::GetTextAreaFont(), cSkinCursesDisplayTracks::SetAudioChannel(), and ~cCursesOsd().

void cCursesOsd::RestoreRegion ( void  )
virtual

Restores the region previously saved by a call to SaveRegion().

If SaveRegion() has not been called before, nothing will happen.

Reimplemented from cOsd.

Definition at line 127 of file skincurses.c.

References savedRegion, and window.

void cCursesOsd::SaveRegion ( int  x1,
int  y1,
int  x2,
int  y2 
)
virtual

Saves the region defined by the given coordinates for later restoration through RestoreRegion().

Only one saved region can be active at any given time.

Reimplemented from cOsd.

Definition at line 117 of file skincurses.c.

References savedRegion, and window.

void cCursesOsd::SetColor ( int  colorFg,
int  colorBg = clrBackground 
)
private

Definition at line 99 of file skincurses.c.

References colorPairs, MaxColorPairs, and window.

Referenced by DrawRectangle(), and DrawText().

Member Data Documentation

int cCursesOsd::colorPairs[MaxColorPairs]
private

Definition at line 64 of file skincurses.c.

Referenced by cCursesOsd(), and SetColor().

WINDOW* cCursesOsd::savedRegion
private

Definition at line 61 of file skincurses.c.

Referenced by cCursesOsd(), RestoreRegion(), and SaveRegion().

WINDOW* cCursesOsd::window
private

The documentation for this class was generated from the following file: