cOsd Class Reference

#include <osd.h>

Inheritance diagram for cOsd:

Inheritance graph
[legend]
Collaboration diagram for cOsd:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~cOsd ()
 Shuts down the OSD.
int Left (void)
int Top (void)
int Width (void)
int Height (void)
cBitmapGetBitmap (int Area)
virtual eOsdError CanHandleAreas (const tArea *Areas, int NumAreas)
virtual eOsdError SetAreas (const tArea *Areas, int NumAreas)
virtual void SaveRegion (int x1, int y1, int x2, int y2)
virtual void RestoreRegion (void)
virtual eOsdError SetPalette (const cPalette &Palette, int Area)
 Sets the Palette for the given Area (the first area is numbered 0).
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 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 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)
virtual void Flush (void)
 Actually commits all data to the OSD hardware.

Static Public Member Functions

static int IsOpen (void)

Protected Member Functions

 cOsd (int Left, int Top)

Private Attributes

cBitmapsavedRegion
cBitmapbitmaps [MAXOSDAREAS]
int numBitmaps
int left
int top
int width
int height

Static Private Attributes

static int isOpen = 0

Friends

class cOsdProvider


Detailed Description

Definition at line 217 of file osd.h.


Constructor & Destructor Documentation

cOsd::cOsd ( int  Left,
int  Top 
) [protected]

Initializes the OSD with the given coordinates. By default it is assumed that the full area will be able to display full 32 bit graphics (ARGB with eight bit for each color and the alpha value, repectively). However, the actual hardware in use may not be able to display such a high resolution OSD, so there is an option to divide the full OSD area into several sub-areas with lower color depths and individual palettes. The sub-areas need not necessarily cover the entire OSD area, but only the OSD area actually covered by sub-areas will be available for drawing. At least one area must be defined in order to set the actual width and height of the OSD. Also, the caller must first try to use an area that consists of only one sub-area that covers the entire drawing space, and should require only the minimum necessary color depth. This is because a derived cOsd class may or may not be able to handle more than one area.

Definition at line 606 of file osd.c.

References esyslog, height, isOpen, left, numBitmaps, savedRegion, top, and width.

cOsd::~cOsd (  )  [virtual]

Shuts down the OSD.

Definition at line 618 of file osd.c.

References bitmaps, isOpen, numBitmaps, and savedRegion.


Member Function Documentation

static int cOsd::IsOpen ( void   )  [inline, static]

Definition at line 245 of file osd.h.

References isOpen.

Referenced by main(), cOsdProvider::NewOsd(), and cReplayControl::ShowMode().

int cOsd::Left ( void   )  [inline]

Definition at line 246 of file osd.h.

References left.

Referenced by cDvbOsd::Flush().

int cOsd::Top ( void   )  [inline]

Definition at line 247 of file osd.h.

References top.

Referenced by cDvbOsd::Flush().

int cOsd::Width ( void   )  [inline]

Definition at line 248 of file osd.h.

References width.

Referenced by cDvbOsd::CanHandleAreas(), cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayChannel::Flush(), cDvbOsd::Flush(), SetAreas(), cSkinClassicDisplayChannel::SetChannel(), cSkinClassicDisplayChannel::SetEvents(), cSkinClassicDisplayChannel::SetMessage(), and cSkinClassicDisplayVolume::SetVolume().

int cOsd::Height ( void   )  [inline]

Definition at line 249 of file osd.h.

References height.

Referenced by cDvbOsd::CanHandleAreas(), cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cDvbOsd::Flush(), SetAreas(), cSkinClassicDisplayChannel::SetEvents(), and cSkinClassicDisplayVolume::SetVolume().

cBitmap * cOsd::GetBitmap ( int  Area  ) 

Returns a pointer to the bitmap for the given Area, or NULL if no such bitmap exists.

Definition at line 626 of file osd.c.

References bitmaps, and numBitmaps.

Referenced by cDvbOsd::Flush(), and cDvbOsd::~cDvbOsd().

eOsdError cOsd::CanHandleAreas ( const tArea Areas,
int  NumAreas 
) [virtual]

Checks whether the OSD can display the given set of sub-areas. The return value indicates whether a call to SetAreas() with this set of areas will succeed. CanHandleAreas() may be called with an OSD that is already in use with other areas and will not interfere with the current operation of the OSD. A derived class must first call the base class CanHandleAreas() to check the basic conditions, like not overlapping etc.

Reimplemented in cDvbOsd.

Definition at line 631 of file osd.c.

References MAXOSDAREAS, oeAreasOverlap, oeOk, oeTooManyAreas, and oeWrongAlignment.

Referenced by cDvbOsd::CanHandleAreas(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), and SetAreas().

eOsdError cOsd::SetAreas ( const tArea Areas,
int  NumAreas 
) [virtual]

Sets the sub-areas to the given areas. The return value indicates whether the operation was successful. If an error is reported, nothing will have changed and the previous OSD (if any) will still be displayed as before. If the OSD has been divided into several sub-areas, all areas that are part of the rectangle that surrounds a given drawing operation will be drawn into, with the proper offsets.

Definition at line 649 of file osd.c.

References bitmaps, CanHandleAreas(), esyslog, Height(), height, max(), numBitmaps, oeOk, oeUnknown, Width(), and width.

Referenced by cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayMessage::cSkinClassicDisplayMessage(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinClassicDisplayVolume::cSkinClassicDisplayVolume(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cDvbSpuDecoder::Draw(), and cLineGame::Show().

Here is the call graph for this function:

void cOsd::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 in cCursesOsd.

Definition at line 668 of file osd.c.

References bitmaps, cBitmap::DrawBitmap(), numBitmaps, savedRegion, cBitmap::X0(), and cBitmap::Y0().

Referenced by cSkinSTTNGDisplayReplay::SetMessage(), cSkinSTTNGDisplayMenu::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinClassicDisplayReplay::SetMessage(), cSkinClassicDisplayChannel::SetMessage(), cSkinCursesDisplayReplay::SetMessage(), and cSkinCursesDisplayChannel::SetMessage().

Here is the call graph for this function:

void cOsd::RestoreRegion ( void   )  [virtual]

Restores the region previously saved by a call to SaveRegion(). If SaveRegion() has not been called before, nothing will happen.

Reimplemented in cCursesOsd.

Definition at line 676 of file osd.c.

References DrawBitmap(), savedRegion, cBitmap::X0(), and cBitmap::Y0().

Referenced by cSkinSTTNGDisplayReplay::SetMessage(), cSkinSTTNGDisplayMenu::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinClassicDisplayReplay::SetMessage(), cSkinClassicDisplayChannel::SetMessage(), cSkinCursesDisplayReplay::SetMessage(), and cSkinCursesDisplayChannel::SetMessage().

Here is the call graph for this function:

eOsdError cOsd::SetPalette ( const cPalette Palette,
int  Area 
) [virtual]

Sets the Palette for the given Area (the first area is numbered 0).

Definition at line 685 of file osd.c.

References bitmaps, numBitmaps, oeUnknown, and cPalette::Take().

Here is the call graph for this function:

void cOsd::DrawPixel ( int  x,
int  y,
tColor  Color 
) [virtual]

Sets the pixel at the given coordinates to the given Color, which is a full 32 bit ARGB value. If the OSD area has been divided into separate sub-areas, and the given coordinates don't fall into any of these sub-areas, no pixel will be set.

Definition at line 692 of file osd.c.

References bitmaps, and numBitmaps.

void cOsd::DrawBitmap ( int  x,
int  y,
const cBitmap Bitmap,
tColor  ColorFg = 0,
tColor  ColorBg = 0,
bool  ReplacePalette = false,
bool  Overlay = false 
) [virtual]

Sets the pixels in the OSD with the data from the given Bitmap, putting the upper left corner of the Bitmap at (x, y). If ColorFg or ColorBg is given, the first palette entry of the Bitmap will be mapped to ColorBg and the second palette entry will be mapped to ColorFg (palette indexes are defined so that 0 is the background and 1 is the foreground color). ReplacePalette controls whether the target area shall have its palette replaced with the one from Bitmap. If Overlay is true, any pixel in Bitmap that has color index 0 will not overwrite the corresponding pixel in the target area.

Definition at line 698 of file osd.c.

References bitmaps, and numBitmaps.

Referenced by cDvbSpuDecoder::Draw(), RestoreRegion(), cSkinSTTNGDisplayTracks::SetAudioChannel(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinSTTNGDisplayReplay::SetMode(), cSkinSTTNGDisplayReplay::SetProgress(), cSkinClassicDisplayReplay::SetProgress(), cSkinSTTNGDisplayMenu::SetScrollbar(), and cSkinSTTNGDisplayVolume::SetVolume().

void cOsd::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 in cCursesOsd.

Definition at line 704 of file osd.c.

References bitmaps, and numBitmaps.

Referenced by cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinCursesDisplayTracks::cSkinCursesDisplayTracks(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cTextScroller::DrawText(), cSkinSTTNGDisplayMenu::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinClassicDisplayChannel::Flush(), cSkinCursesDisplayMenu::Flush(), cSkinCursesDisplayChannel::Flush(), cSkinSTTNGDisplayMenu::SetButtons(), cSkinClassicDisplayMenu::SetButtons(), cSkinCursesDisplayMenu::SetButtons(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinClassicDisplayChannel::SetChannel(), cSkinCursesDisplayChannel::SetChannel(), cSkinSTTNGDisplayReplay::SetCurrent(), cSkinClassicDisplayReplay::SetCurrent(), cSkinCursesDisplayReplay::SetCurrent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinClassicDisplayMenu::SetEvent(), cSkinCursesDisplayMenu::SetEvent(), cSkinSTTNGDisplayChannel::SetEvents(), cSkinClassicDisplayChannel::SetEvents(), cSkinCursesDisplayChannel::SetEvents(), cSkinSTTNGDisplayTracks::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinClassicDisplayTracks::SetItem(), cSkinClassicDisplayMenu::SetItem(), cSkinCursesDisplayTracks::SetItem(), cSkinCursesDisplayMenu::SetItem(), cSkinSTTNGDisplayReplay::SetJump(), cSkinClassicDisplayReplay::SetJump(), cSkinCursesDisplayReplay::SetJump(), cSkinSTTNGDisplayMessage::SetMessage(), cSkinSTTNGDisplayReplay::SetMessage(), cSkinSTTNGDisplayMenu::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinClassicDisplayMessage::SetMessage(), cSkinClassicDisplayReplay::SetMessage(), cSkinClassicDisplayMenu::SetMessage(), cSkinClassicDisplayChannel::SetMessage(), cSkinCursesDisplayMessage::SetMessage(), cSkinCursesDisplayReplay::SetMessage(), cSkinCursesDisplayMenu::SetMessage(), cSkinCursesDisplayChannel::SetMessage(), cSkinSTTNGDisplayReplay::SetTitle(), cSkinSTTNGDisplayMenu::SetTitle(), cSkinClassicDisplayReplay::SetTitle(), cSkinClassicDisplayMenu::SetTitle(), cSkinCursesDisplayReplay::SetTitle(), cSkinCursesDisplayMenu::SetTitle(), cSkinSTTNGDisplayReplay::SetTotal(), cSkinClassicDisplayReplay::SetTotal(), cSkinCursesDisplayReplay::SetTotal(), cSkinClassicDisplayVolume::SetVolume(), and cSkinCursesDisplayVolume::SetVolume().

void cOsd::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 in cCursesOsd.

Definition at line 710 of file osd.c.

References bitmaps, and numBitmaps.

Referenced by cSkinSTTNGDisplayMenu::Clear(), cSkinClassicDisplayMenu::Clear(), cSkinCursesDisplayMenu::Clear(), cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinCursesDisplayChannel::cSkinCursesDisplayChannel(), cSkinCursesDisplayMenu::cSkinCursesDisplayMenu(), cSkinCursesDisplayReplay::cSkinCursesDisplayReplay(), cSkinCursesDisplayTracks::cSkinCursesDisplayTracks(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cSkinSTTNGDisplayChannel::Flush(), cLineGame::ProcessKey(), cSkinSTTNGDisplayTracks::SetAudioChannel(), cSkinSTTNGDisplayMenu::SetButtons(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinClassicDisplayChannel::SetChannel(), cSkinCursesDisplayChannel::SetChannel(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinSTTNGDisplayChannel::SetEvents(), cSkinClassicDisplayChannel::SetEvents(), cSkinCursesDisplayChannel::SetEvents(), cSkinSTTNGDisplayTracks::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinSTTNGDisplayReplay::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinClassicDisplayMenu::SetMessage(), cSkinCursesDisplayMenu::SetMessage(), cSkinCursesDisplayReplay::SetProgress(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetScrollbar(), cSkinClassicDisplayMenu::SetScrollbar(), cSkinCursesDisplayMenu::SetScrollbar(), cSkinSTTNGDisplayVolume::SetVolume(), cSkinClassicDisplayVolume::SetVolume(), cSkinCursesDisplayVolume::SetVolume(), and cLineGame::Show().

void cOsd::DrawEllipse ( int  x1,
int  y1,
int  x2,
int  y2,
tColor  Color,
int  Quadrants = 0 
) [virtual]

Draws a filled ellipse defined by the upper left (x1, y1) and lower right (x2, y2) corners with the given Color. Quadrants controls which parts of the ellipse are actually drawn: 0 draws the entire ellipse 1..4 draws only the first, second, third or fourth quadrant, respectively 5..8 draws the right, top, left or bottom half, respectively -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!

Definition at line 716 of file osd.c.

References bitmaps, and numBitmaps.

Referenced by cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinSTTNGDisplayTracks::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinSTTNGDisplayMenu::SetRecording(), and cSkinSTTNGDisplayMenu::SetScrollbar().

void cOsd::DrawSlope ( int  x1,
int  y1,
int  x2,
int  y2,
tColor  Color,
int  Type 
) [virtual]

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: 0: horizontal, rising, lower 1: horizontal, rising, upper 2: horizontal, falling, lower 3: horizontal, falling, upper 4: vertical, rising, lower 5: vertical, rising, upper 6: vertical, falling, lower 7: vertical, falling, upper

Definition at line 722 of file osd.c.

References bitmaps, and numBitmaps.

void cOsd::Flush ( void   )  [virtual]

Actually commits all data to the OSD hardware.

Reimplemented in cDvbOsd, and cCursesOsd.

Definition at line 728 of file osd.c.

Referenced by cDvbSpuDecoder::Draw(), cSkinSTTNGDisplayMessage::Flush(), cSkinSTTNGDisplayTracks::Flush(), cSkinSTTNGDisplayVolume::Flush(), cSkinSTTNGDisplayReplay::Flush(), cSkinSTTNGDisplayMenu::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinClassicDisplayMessage::Flush(), cSkinClassicDisplayTracks::Flush(), cSkinClassicDisplayVolume::Flush(), cSkinClassicDisplayReplay::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinClassicDisplayChannel::Flush(), cSkinCursesDisplayMessage::Flush(), cSkinCursesDisplayTracks::Flush(), cSkinCursesDisplayVolume::Flush(), cSkinCursesDisplayReplay::Flush(), cSkinCursesDisplayMenu::Flush(), cSkinCursesDisplayChannel::Flush(), cLineGame::ProcessKey(), and cLineGame::Show().


Friends And Related Function Documentation

friend class cOsdProvider [friend]

Definition at line 218 of file osd.h.


Member Data Documentation

int cOsd::isOpen = 0 [static, private]

Definition at line 220 of file osd.h.

Referenced by cOsd(), IsOpen(), and ~cOsd().

cBitmap* cOsd::savedRegion [private]

Reimplemented in cCursesOsd.

Definition at line 221 of file osd.h.

Referenced by cOsd(), RestoreRegion(), SaveRegion(), and ~cOsd().

cBitmap* cOsd::bitmaps[MAXOSDAREAS] [private]

Definition at line 222 of file osd.h.

Referenced by DrawBitmap(), DrawEllipse(), DrawPixel(), DrawRectangle(), DrawSlope(), DrawText(), GetBitmap(), SaveRegion(), SetAreas(), SetPalette(), and ~cOsd().

int cOsd::numBitmaps [private]

Definition at line 223 of file osd.h.

Referenced by cOsd(), DrawBitmap(), DrawEllipse(), DrawPixel(), DrawRectangle(), DrawSlope(), DrawText(), GetBitmap(), SaveRegion(), SetAreas(), SetPalette(), and ~cOsd().

int cOsd::left [private]

Definition at line 224 of file osd.h.

Referenced by cOsd(), and Left().

int cOsd::top [private]

Definition at line 224 of file osd.h.

Referenced by cOsd(), and Top().

int cOsd::width [private]

Definition at line 224 of file osd.h.

Referenced by cOsd(), SetAreas(), and Width().

int cOsd::height [private]

Definition at line 224 of file osd.h.

Referenced by cOsd(), Height(), and SetAreas().


The documentation for this class was generated from the following files:
Generated on Tue Nov 6 20:20:55 2007 for VDR by  doxygen 1.5.3-20071008