vdr  2.6.9
Public Member Functions | 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)
 
virtual const cSizeMaxPixmapSize (void) const
 
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 void DrawScaledImage (const cPoint &Point, const cImage &Image, double FactorX, double FactorY, bool AntiAlias=false)
 
virtual void DrawScaledImage (const cPoint &Point, int ImageHandle, double FactorX, double FactorY, bool AntiAlias=false)
 
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 Member Functions

void SetColor (int colorFg, int colorBg=clrBackground)
 

Private Attributes

WINDOW * savedRegion
 
cVector< int > colorPairs
 

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)
 
cBitmapGetBitmap (int Area)
 

Detailed Description

Definition at line 60 of file skincurses.c.

Constructor & Destructor Documentation

◆ cCursesOsd()

cCursesOsd::cCursesOsd ( int  Left,
int  Top 
)

Definition at line 75 of file skincurses.c.

References savedRegion, ScOsdHeight, and ScOsdWidth.

◆ ~cCursesOsd()

cCursesOsd::~cCursesOsd ( )
virtual

Definition at line 92 of file skincurses.c.

References Flush().

Member Function Documentation

◆ DrawRectangle()

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 167 of file skincurses.c.

References SetColor().

Referenced by DrawText().

◆ 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 130 of file skincurses.c.

References DrawRectangle(), Font, cOsd::Height(), cCursesFont::Height(), ScOsdWidth, SetColor(), taBottom, taLeft, taRight, taTop, cOsd::Width(), and cCursesFont::Width().

◆ Flush()

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 182 of file skincurses.c.

Referenced by ~cCursesOsd().

◆ RestoreRegion()

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 121 of file skincurses.c.

References savedRegion.

◆ SaveRegion()

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 110 of file skincurses.c.

References savedRegion.

◆ SetColor()

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

Definition at line 98 of file skincurses.c.

References cVector< T >::Append(), colorPairs, cVector< T >::IndexOf(), and cVector< T >::Size().

Referenced by DrawRectangle(), and DrawText().

Member Data Documentation

◆ colorPairs

cVector<int> cCursesOsd::colorPairs
private

Definition at line 63 of file skincurses.c.

Referenced by SetColor().

◆ savedRegion

WINDOW* cCursesOsd::savedRegion
private

Definition at line 62 of file skincurses.c.

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


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