vdr-plugin-skindesigner/displayplugin.c

201 lines
4.5 KiB
C
Raw Normal View History

2015-03-12 17:28:35 +01:00
#include "config.h"
#include "displayplugin.h"
2015-03-12 17:28:35 +01:00
cSkinDisplayPlugin::cSkinDisplayPlugin(cTemplate *pluginTemplate, int subViewID) {
2015-02-12 18:50:58 +01:00
if (!pluginTemplate) {
doOutput = false;
return;
} else {
doOutput = true;
}
initial = true;
2015-03-12 17:28:35 +01:00
if (subViewID > -1) {
cTemplateView *subView = pluginTemplate->GetRootView()->GetSubView((eSubView)subViewID);
if (!subView) {
doOutput = false;
return;
}
pluginView = new cDisplayPluginView(subView, false);
} else {
pluginView = new cDisplayPluginView(pluginTemplate->GetRootView(), true);
}
if (!pluginView->createOsd() && subViewID < 0) {
2015-02-12 18:50:58 +01:00
doOutput = false;
return;
}
pluginView->DrawDebugGrid();
}
2015-02-12 18:50:58 +01:00
cSkinDisplayPlugin::~cSkinDisplayPlugin(void) {
if (pluginView) {
delete pluginView;
pluginView = NULL;
}
}
2015-03-12 17:28:35 +01:00
void cSkinDisplayPlugin::Deactivate(bool hide) {
if (!doOutput) {
return;
}
pluginView->Deactivate(hide);
}
void cSkinDisplayPlugin::Activate(void) {
if (!doOutput) {
return;
}
pluginView->Activate();
}
void cSkinDisplayPlugin::ClearViewElement(int id) {
if (!doOutput) {
return;
}
pluginView->CleanViewElement(id);
}
void cSkinDisplayPlugin::DisplayViewElement(int id) {
if (!doOutput) {
return;
}
pluginView->DisplayViewElement(id);
}
2015-02-12 18:50:58 +01:00
void cSkinDisplayPlugin::SetViewElementIntTokens(map<string,int> *intTokens) {
if (pluginView)
pluginView->SetIntTokens(intTokens);
}
void cSkinDisplayPlugin::SetViewElementStringTokens(map<string,string> *stringTokens) {
if (pluginView)
pluginView->SetStringTokens(stringTokens);
}
void cSkinDisplayPlugin::SetViewElementLoopTokens(map<string,vector<map<string,string> > > *loopTokens) {
if (pluginView)
pluginView->SetLoopTokens(loopTokens);
}
void cSkinDisplayPlugin::InitGrids(int viewGridID) {
if (!doOutput) {
return;
}
pluginView->InitGrids(viewGridID);
}
void cSkinDisplayPlugin::SetGrid(int viewGridID, long gridID,
double x, double y, double width, double height,
map<string,int> *intTokens, map<string,string> *stringTokens) {
if (!doOutput) {
return;
}
pluginView->SetGrid(viewGridID, gridID, x, y, width, height, intTokens, stringTokens);
}
void cSkinDisplayPlugin::SetGridCurrent(int viewGridID, long gridID, bool current) {
if (!doOutput) {
return;
}
pluginView->SetGridCurrent(viewGridID, gridID, current);
}
void cSkinDisplayPlugin::DeleteGrid(int viewGridID, long gridID) {
if (!doOutput) {
return;
}
pluginView->DeleteGrid(viewGridID, gridID);
}
void cSkinDisplayPlugin::DisplayGrids(int viewGridID) {
if (!doOutput) {
return;
}
pluginView->DisplayGrids(viewGridID);
}
void cSkinDisplayPlugin::ClearGrids(int viewGridID) {
if (!doOutput) {
return;
}
pluginView->ClearGrids(viewGridID);
}
2015-03-12 17:28:35 +01:00
void cSkinDisplayPlugin::SetTabIntTokens(map<string,int> *intTokens) {
if (!doOutput) {
return;
}
pluginView->SetTabIntTokens(intTokens);
}
void cSkinDisplayPlugin::SetTabStringTokens(map<string,string> *stringTokens) {
if (!doOutput) {
return;
}
pluginView->SetTabStringTokens(stringTokens);
}
void cSkinDisplayPlugin::SetTabLoopTokens(map<string,vector<map<string,string> > > *loopTokens) {
if (!doOutput) {
return;
}
pluginView->SetTabLoopTokens(loopTokens);
}
void cSkinDisplayPlugin::SetTabs(void) {
if (!doOutput) {
return;
}
pluginView->SetTabs();
}
void cSkinDisplayPlugin::TabLeft(void) {
if (!doOutput) {
return;
}
pluginView->TabLeft();
}
void cSkinDisplayPlugin::TabRight(void) {
if (!doOutput) {
return;
}
pluginView->TabRight();
}
void cSkinDisplayPlugin::TabUp(void) {
if (!doOutput) {
return;
}
pluginView->TabUp();
}
void cSkinDisplayPlugin::TabDown(void) {
if (!doOutput) {
return;
}
pluginView->TabDown();
}
void cSkinDisplayPlugin::DisplayTabs(void) {
if (!doOutput) {
return;
}
pluginView->DisplayTab();
}
2015-02-12 18:50:58 +01:00
void cSkinDisplayPlugin::Flush(void) {
if (initial) {
pluginView->DoStart();
initial = false;
}
pluginView->Flush();
2015-03-12 17:28:35 +01:00
}
bool cSkinDisplayPlugin::ChannelLogoExists(string channelId) {
return imgCache->LogoExists(channelId);
}
string cSkinDisplayPlugin::GetEpgImagePath(void) {
return *config.epgImagePath;
}