vdr
1.7.27
|
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) |
Private Types | |
enum | { MaxColorPairs = 16 } |
Private Member Functions | |
void | SetColor (int colorFg, int colorBg=clrBackground) |
Private Attributes | |
WINDOW * | savedRegion |
WINDOW * | window |
int | colorPairs [MaxColorPairs] |
Definition at line 58 of file skincurses.c.
anonymous enum [private] |
Definition at line 62 of file skincurses.c.
cCursesOsd::cCursesOsd | ( | int | Left, |
int | Top | ||
) |
Definition at line 75 of file skincurses.c.
References colorPairs, savedRegion, ScOsdHeight, ScOsdWidth, and window.
cCursesOsd::~cCursesOsd | ( | ) | [virtual] |
Definition at line 88 of file skincurses.c.
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 173 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 135 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 = 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); delete pm; }
Reimplemented from cOsd.
Definition at line 183 of file skincurses.c.
Referenced by ~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 126 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 116 of file skincurses.c.
References savedRegion, and window.
void cCursesOsd::SetColor | ( | int | colorFg, |
int | colorBg = clrBackground |
||
) | [private] |
Definition at line 98 of file skincurses.c.
References colorPairs, MaxColorPairs, and window.
Referenced by DrawRectangle(), and DrawText().
int cCursesOsd::colorPairs[MaxColorPairs] [private] |
Definition at line 63 of file skincurses.c.
Referenced by cCursesOsd(), and SetColor().
WINDOW* cCursesOsd::savedRegion [private] |
Definition at line 60 of file skincurses.c.
Referenced by cCursesOsd(), RestoreRegion(), and SaveRegion().
WINDOW* cCursesOsd::window [private] |
Definition at line 61 of file skincurses.c.
Referenced by cCursesOsd(), DrawRectangle(), DrawText(), RestoreRegion(), SaveRegion(), SetColor(), and ~cCursesOsd().