vdr  2.4.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Static Private Attributes | Friends | List of all members
cOsdProvider Class Referenceabstract

#include <osd.h>

Public Member Functions

 cOsdProvider (void)
 
virtual ~cOsdProvider ()
 

Static Public Member Functions

static cOsdNewOsd (int Left, int Top, uint Level=OSD_LEVEL_DEFAULT)
 
static void UpdateOsdSize (bool Force=false)
 
static bool OsdSizeChanged (int &State)
 
static bool SupportsTrueColor (void)
 
static int StoreImage (const cImage &Image)
 
static void DropImage (int ImageHandle)
 
static void Shutdown (void)
 

Protected Member Functions

virtual cOsdCreateOsd (int Left, int Top, uint Level)=0
 
virtual bool ProvidesTrueColor (void)
 
virtual int StoreImageData (const cImage &Image)
 
virtual void DropImageData (int ImageHandle)
 

Static Protected Member Functions

static const cImageGetImageData (int ImageHandle)
 

Static Private Attributes

static cOsdProviderosdProvider = NULL
 
static int oldWidth = 0
 
static int oldHeight = 0
 
static double oldAspect = 1.0
 
static cImageimages [MAXOSDIMAGES] = { NULL }
 
static int osdState = 0
 

Friends

class cPixmapMemory
 

Detailed Description

Definition at line 961 of file osd.h.

Constructor & Destructor Documentation

◆ cOsdProvider()

cOsdProvider::cOsdProvider ( void  )

Definition at line 2006 of file osd.c.

References osdProvider.

◆ ~cOsdProvider()

cOsdProvider::~cOsdProvider ( )
virtual

Definition at line 2012 of file osd.c.

References osdProvider.

Member Function Documentation

◆ CreateOsd()

virtual cOsd* cOsdProvider::CreateOsd ( int  Left,
int  Top,
uint  Level 
)
protectedpure virtual

Returns a pointer to a newly created cOsd object, which will be located at the given coordinates.

Implemented in cHdffOsdProvider.

Referenced by NewOsd().

◆ DropImage()

void cOsdProvider::DropImage ( int  ImageHandle)
static

Drops the image referenced by the given ImageHandle.

If ImageHandle has an invalid value, nothing happens.

Definition at line 2118 of file osd.c.

References DropImageData(), and osdProvider.

Referenced by DrawImages().

◆ DropImageData()

void cOsdProvider::DropImageData ( int  ImageHandle)
protectedvirtual

Drops the image data referenced by ImageHandle.

Definition at line 2094 of file osd.c.

References images, LOCK_PIXMAPS, and MAXOSDIMAGES.

Referenced by DropImage().

◆ GetImageData()

const cImage * cOsdProvider::GetImageData ( int  ImageHandle)
staticprotected

Gets the image data referenced by ImageHandle.

Definition at line 2103 of file osd.c.

References images, LOCK_PIXMAPS, and MAXOSDIMAGES.

Referenced by cPixmapMemory::DrawImage().

◆ NewOsd()

cOsd * cOsdProvider::NewOsd ( int  Left,
int  Top,
uint  Level = OSD_LEVEL_DEFAULT 
)
static

◆ OsdSizeChanged()

bool cOsdProvider::OsdSizeChanged ( int &  State)
static

Checks if the OSD size has changed and a currently displayed OSD needs to be redrawn.

An internal reference value is incremented on every size change and is compared against State when calling the method. OsdSizeChanged() can be called with an uninitialized State to just get the current value of State.

Definition at line 2064 of file osd.c.

References cOsd::mutex, and osdState.

Referenced by cDisplayChannel::cDisplayChannel(), cOsdMenu::cOsdMenu(), cOsdMenu::Display(), main(), and cDisplayChannel::ProcessKey().

◆ ProvidesTrueColor()

virtual bool cOsdProvider::ProvidesTrueColor ( void  )
inlineprotectedvirtual

Returns true if this OSD provider is able to handle a true color OSD.

Reimplemented in cHdffOsdProvider.

Definition at line 974 of file osd.h.

Referenced by SupportsTrueColor().

◆ Shutdown()

void cOsdProvider::Shutdown ( void  )
static

Shuts down the OSD provider facility by deleting the current OSD provider.

Definition at line 2124 of file osd.c.

References osdProvider.

Referenced by main().

◆ StoreImage()

int cOsdProvider::StoreImage ( const cImage Image)
static

Stores the given Image for later use with DrawImage() on an OSD or pixmap.

The returned number is a handle that must be used when referencing this image in a call to DrawImage() or DropImage(). The image data is copied, so any later changes to Image will have no effect on the stored image. A derived class may be able to copy frequently used images to some space where they can be retrieved faster than using a cImage in each call. If this is not a true color OSD, or if the image data can't be stored for any reason, this function returns 0 and nothing is stored.

Definition at line 2111 of file osd.c.

References osdProvider, and StoreImageData().

Referenced by DrawImages().

◆ StoreImageData()

int cOsdProvider::StoreImageData ( const cImage Image)
protectedvirtual

Copies the given Image and returns a handle for later reference.

A derived class can implement its own image storing mechanism by reimplementing this function as well as DropImageData(). The base class implementation simply copies the image data to allow plugins to always use this interface, no matter if the actual device provides support for storing image data or not. The handles returned by the default implementation are positive integers. A derived class might want to use negative integers as handles, so that it can fall back to using the base class image storing mechanism if, e.g., it runs out of memory.

Definition at line 2082 of file osd.c.

References images, LOCK_PIXMAPS, and MAXOSDIMAGES.

Referenced by StoreImage().

◆ SupportsTrueColor()

bool cOsdProvider::SupportsTrueColor ( void  )
static

Returns true if the current OSD provider is able to handle a true color OSD.

Definition at line 2072 of file osd.c.

References esyslog, osdProvider, and ProvidesTrueColor().

Referenced by cPluginOsddemo::MainMenuAction().

◆ UpdateOsdSize()

void cOsdProvider::UpdateOsdSize ( bool  Force = false)
static

Friends And Related Function Documentation

◆ cPixmapMemory

friend class cPixmapMemory
friend

Definition at line 962 of file osd.h.

Member Data Documentation

◆ images

cImage * cOsdProvider::images = { NULL }
staticprivate

Definition at line 968 of file osd.h.

Referenced by DropImageData(), GetImageData(), and StoreImageData().

◆ oldAspect

double cOsdProvider::oldAspect = 1.0
staticprivate

Definition at line 967 of file osd.h.

Referenced by UpdateOsdSize().

◆ oldHeight

int cOsdProvider::oldHeight = 0
staticprivate

Definition at line 966 of file osd.h.

Referenced by UpdateOsdSize().

◆ oldWidth

int cOsdProvider::oldWidth = 0
staticprivate

Definition at line 965 of file osd.h.

Referenced by UpdateOsdSize().

◆ osdProvider

cOsdProvider * cOsdProvider::osdProvider = NULL
staticprivate

◆ osdState

int cOsdProvider::osdState = 0
staticprivate

Definition at line 969 of file osd.h.

Referenced by OsdSizeChanged(), and UpdateOsdSize().


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