Home

Dokumentation

Impressum

Dokumentation VDR
 

Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

cOsdBase Class Reference

#include <osdbase.h>

Inheritance diagram for cOsdBase:

Inheritance graph
[legend]
Collaboration diagram for cOsdBase:

Collaboration graph
[legend]

Detailed Description

Basic interface to the On Screen Display.

Definition at line 178 of file osdbase.h.

Public Methods

 cOsdBase (int x, int y)
virtual ~cOsdBase ()
tWindowHandle Create (int x, int y, int w, int h, int Bpp, bool ClearWithBackground=true, bool Tiled=true)
void AddColor (eDvbColor Color, tWindowHandle Window=LAST_CREATED_WINDOW)
void Flush (void)
void Clear (tWindowHandle Window=ALL_TILED_WINDOWS)
void Fill (int x1, int y1, int x2, int y2, eDvbColor Color, tWindowHandle Window=ALL_TILED_WINDOWS)
void SetBitmap (int x, int y, const cBitmap &Bitmap, tWindowHandle Window=ALL_TILED_WINDOWS)
int Width (unsigned char c)
int Width (const char *s)
eDvbFont SetFont (eDvbFont Font)
void Text (int x, int y, const char *s, eDvbColor ColorFg=clrWhite, eDvbColor ColorBg=clrBackground, tWindowHandle Window=ALL_TILED_WINDOWS)
void Relocate (tWindowHandle Window, int x, int y, int NewWidth=-1, int NewHeight=-1)
void Hide (tWindowHandle Window)
void Show (tWindowHandle Window)

Protected Methods

cWindowGetWindowNr (int i)
int NumWindows (void)
int X0 (void)
int Y0 (void)
virtual bool OpenWindow (cWindow *Window)=0
virtual void CommitWindow (cWindow *Window)=0
virtual void ShowWindow (cWindow *Window)=0
virtual void HideWindow (cWindow *Window, bool Hide)=0
virtual void MoveWindow (cWindow *Window, int x, int y)=0
virtual void CloseWindow (cWindow *Window)=0

Private Methods

cWindowGetWindow (int x, int y)
cWindowGetWindow (tWindowHandle Window)

Private Attributes

int numWindows
int x0
int y0
cWindowwindow [MAXNUMWINDOWS]


Constructor & Destructor Documentation

cOsdBase::cOsdBase int    x,
int    y
 

Initializes the OSD, starting at screen coordinates (x, y).

Definition at line 347 of file osdbase.c.

References numWindows, x0, and y0.

cOsdBase::~cOsdBase   [virtual]
 

Destroys all windows and shuts down the OSD.

Definition at line 354 of file osdbase.c.

References numWindows, and window.


Member Function Documentation

void cOsdBase::AddColor eDvbColor    Color,
tWindowHandle    Window = LAST_CREATED_WINDOW
 

Adds the Color to the color palette of the given window if it is not already contained in the palette (and if the palette still has free slots for new colors). The default value LAST_CREATED_WINDOW will access the most recently created window, without the need of explicitly using a window handle.

Definition at line 385 of file osdbase.c.

References GetWindow(), cPalette::Index(), and cPalette::Reset().

Referenced by cOsd::Open().

void cOsdBase::Clear tWindowHandle    Window = ALL_TILED_WINDOWS
 

Clears the given window. If ALL_TILED_WINDOWS is given, only the tiled windows will be cleared, leaving the standalone windows untouched. If ALL_WINDOWS is given, the standalone windows will also be cleared.

Definition at line 428 of file osdbase.c.

References ALL_TILED_WINDOWS, ALL_WINDOWS, cBitmap::Clear(), GetWindow(), numWindows, cWindow::Tiled(), and window.

Referenced by cOsd::Clear().

virtual void cOsdBase::CloseWindow cWindow   Window [protected, pure virtual]
 

Close the window and release any OSD hardware resources allocated for it.

Implemented in cDvbOsd.

Referenced by Relocate().

virtual void cOsdBase::CommitWindow cWindow   Window [protected, pure virtual]
 

Write any modified data and color definitions to the OSD hardware. Use the window's Dirty() function to find out which area of data actually needs to be transferred. If the window has not yet been explicitly shown through a call to ShowWindow(), no visible activity shall take place.

Implemented in cDvbOsd.

Referenced by Flush().

tWindowHandle cOsdBase::Create int    x,
int    y,
int    w,
int    h,
int    Bpp,
bool    ClearWithBackground = true,
bool    Tiled = true
 

Creates a window at coordinates (x, y), which are relative to the OSD's origin given in the constructor, with the given width, height and color depth. ClearWithBackground controls whether the window will be filled with clrBackground when it is cleared. Setting this to 'false' may be useful for windows that don't need clrBackground but want to save this color palette entry for a different color. Tiled controls whether this will be part of a multi section OSD (with several windows that all have different color depths and palettes and form one large OSD area), or whether this is a "standalone" window that will be drawn "in front" of any windows defined *after* this one (this can be used for highlighting certain parts of the OSD, as would be done in a 'cursor'). Returns a handle that can be used to identify this window.

Definition at line 360 of file osdbase.c.

References esyslog, cWindow::Handle(), MAXNUMWINDOWS, numWindows, OpenWindow(), tWindowHandle, and window.

Referenced by cDvbSpuDecoder::DrawBmp(), and cOsd::Open().

void cOsdBase::Fill int    x1,
int    y1,
int    x2,
int    y2,
eDvbColor    Color,
tWindowHandle    Window = ALL_TILED_WINDOWS
 

Fills the rectangle defined by the upper left (x1, y2) and lower right (x2, y2) corners with the given Color. If a specific window is given, the coordinates are relative to that window's upper left corner. Otherwise they are relative to the upper left corner of the entire OSD. If all tiled windows are selected, only that window which contains the point (x1, y1) will actually be filled.

Definition at line 442 of file osdbase.c.

References ALL_TILED_WINDOWS, cWindow::Fill(), and GetWindow().

Referenced by cOsd::Fill().

void cOsdBase::Flush void   
 

Actually commits all data of all windows to the OSD.

Definition at line 412 of file osdbase.c.

References cBitmap::Clean(), CommitWindow(), numWindows, cWindow::Shown(), ShowWindow(), and window.

Referenced by cDvbSpuDecoder::Draw(), and cOsd::Flush().

cWindow * cOsdBase::GetWindow tWindowHandle    Window [private]
 

Definition at line 403 of file osdbase.c.

References LAST_CREATED_WINDOW, numWindows, and window.

cWindow * cOsdBase::GetWindow int    x,
int    y
[private]
 

Definition at line 394 of file osdbase.c.

References cWindow::Contains(), numWindows, cWindow::Tiled(), and window.

Referenced by AddColor(), Clear(), Fill(), Hide(), Relocate(), SetBitmap(), Show(), and Text().

cWindow* cOsdBase::GetWindowNr int    i [inline, protected]
 

Definition at line 186 of file osdbase.h.

References MAXNUMWINDOWS.

Referenced by cDvbOsd::~cDvbOsd().

void cOsdBase::Hide tWindowHandle    Window
 

Hides the given window.

Definition at line 503 of file osdbase.c.

References GetWindow(), and HideWindow().

virtual void cOsdBase::HideWindow cWindow   Window,
bool    Hide
[protected, pure virtual]
 

Temporarily hide the window (if 'Hide' is 'true') or make a previously hidden window visible again (if 'Hide' is 'false').

Implemented in cDvbOsd.

Referenced by Hide(), and Show().

virtual void cOsdBase::MoveWindow cWindow   Window,
int    x,
int    y
[protected, pure virtual]
 

Move the window to a new location.

Implemented in cDvbOsd.

Referenced by Relocate().

int cOsdBase::NumWindows void    [inline, protected]
 

Definition at line 187 of file osdbase.h.

Referenced by cDvbOsd::~cDvbOsd().

virtual bool cOsdBase::OpenWindow cWindow   Window [protected, pure virtual]
 

Opens the window on the OSD hardware, without actually showing it (the initial state shall be "hidden").

Implemented in cDvbOsd.

Referenced by Create(), and Relocate().

void cOsdBase::Relocate tWindowHandle    Window,
int    x,
int    y,
int    NewWidth = -1,
int    NewHeight = -1
 

Moves the given window to the new location at (x, y). If NewWidth and NewHeight are also given, the window will also be resized to the new width and height.

Definition at line 481 of file osdbase.c.

References cWindow::Bpp(), cBitmap::ClearWithBackground(), CloseWindow(), esyslog, GetWindow(), cWindow::Handle(), MoveWindow(), OpenWindow(), cWindow::Relocate(), cWindow::Tiled(), and window.

void cOsdBase::SetBitmap int    x,
int    y,
const cBitmap   Bitmap,
tWindowHandle    Window = ALL_TILED_WINDOWS
 

Sets the pixels within the given window with the data from the given Bitmap. See Fill() for details about the coordinates.

Definition at line 449 of file osdbase.c.

References ALL_TILED_WINDOWS, GetWindow(), and cWindow::SetBitmap().

Referenced by cDvbSpuDecoder::DrawBmp(), and cOsd::SetBitmap().

eDvbFont cOsdBase::SetFont eDvbFont    Font
 

Returns the width (in pixels) of the given string in the current font.

Definition at line 466 of file osdbase.c.

References eDvbFont, numWindows, cBitmap::SetFont(), and window.

Referenced by cOsd::SetFont().

void cOsdBase::Show tWindowHandle    Window
 

Shows the given window.

Definition at line 508 of file osdbase.c.

References GetWindow(), and HideWindow().

virtual void cOsdBase::ShowWindow cWindow   Window [protected, pure virtual]
 

Make the window actually visible on the OSD hardware.

Implemented in cDvbOsd.

Referenced by Flush().

void cOsdBase::Text int    x,
int    y,
const char *    s,
eDvbColor    ColorFg = clrWhite,
eDvbColor    ColorBg = clrBackground,
tWindowHandle    Window = ALL_TILED_WINDOWS
 

Writes the given string at coordinates (x, y) with the given foreground and background color into the given window (see Fill() for details about the coordinates).

Definition at line 474 of file osdbase.c.

References ALL_TILED_WINDOWS, GetWindow(), and cWindow::Text().

Referenced by cOsd::Text().

int cOsdBase::Width const char *    s
 

Returns the width (in pixels) of the given string in the current font.

Definition at line 461 of file osdbase.c.

References numWindows, cBitmap::Width(), and window.

int cOsdBase::Width unsigned char    c
 

Returns the width (in pixels) of the given character in the current font.

Definition at line 456 of file osdbase.c.

References numWindows, cBitmap::Width(), and window.

Referenced by cOsd::Width(), and cOsd::WidthInCells().

int cOsdBase::X0 void    [inline, protected]
 

Definition at line 188 of file osdbase.h.

Referenced by cDvbOsd::MoveWindow(), cDvbOsd::OpenWindow(), and cDvbOsd::ShowWindow().

int cOsdBase::Y0 void    [inline, protected]
 

Definition at line 189 of file osdbase.h.

Referenced by cDvbOsd::MoveWindow(), cDvbOsd::OpenWindow(), and cDvbOsd::ShowWindow().


Field Documentation

int cOsdBase::numWindows [private]
 

Definition at line 180 of file osdbase.h.

Referenced by Clear(), cOsdBase(), Create(), Flush(), GetWindow(), SetFont(), Width(), and ~cOsdBase().

cWindow* cOsdBase::window[MAXNUMWINDOWS] [private]
 

Definition at line 182 of file osdbase.h.

Referenced by Clear(), Create(), Flush(), GetWindow(), Relocate(), SetFont(), Width(), and ~cOsdBase().

int cOsdBase::x0 [private]
 

Definition at line 181 of file osdbase.h.

Referenced by cOsdBase().

int cOsdBase::y0 [private]
 

Definition at line 181 of file osdbase.h.

Referenced by cOsdBase().


The documentation for this class was generated from the following files:
Generated on Wed Feb 5 23:31:45 2003 for VDR by doxygen1.3-rc2