diff options
author | louis <louis.braun@gmx.de> | 2016-01-26 18:41:40 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2016-01-26 18:41:40 +0100 |
commit | d4ef992f8256d324221d15d3bef967eb044a9a86 (patch) | |
tree | a3cc1c55d016bb107a20bbe59081662e221348fc /tvguideng.c | |
parent | c341a635d9b0c4dfdd5e2f6ab25f9d94f53ac795 (diff) | |
download | vdr-plugin-tvguideng-d4ef992f8256d324221d15d3bef967eb044a9a86.tar.gz vdr-plugin-tvguideng-d4ef992f8256d324221d15d3bef967eb044a9a86.tar.bz2 |
adaptions skindesigner 0.8.00.2.0
Diffstat (limited to 'tvguideng.c')
-rw-r--r-- | tvguideng.c | 221 |
1 files changed, 160 insertions, 61 deletions
diff --git a/tvguideng.c b/tvguideng.c index eed321a..52aeda1 100644 --- a/tvguideng.c +++ b/tvguideng.c @@ -11,15 +11,17 @@ #define DEFINE_CONFIG 1 #include "config.h" #include "setup.h" +#include "definitions.h" #include "tvguidengosd.h" -static const char *VERSION = "0.1.6"; +static const char *VERSION = "0.2.0"; static const char *DESCRIPTION = "TV Guide for Skindesigner Skins"; static const char *MAINMENUENTRY = "TV Guide NG"; class cPluginTvguideng : public cPlugin { private: - // Add any member variables or functions you may need here. + skindesignerapi::cPluginStructure *plugStruct; + void SkindesignerRegister(void); public: cPluginTvguideng(void); virtual ~cPluginTvguideng(); @@ -50,58 +52,19 @@ cPluginTvguideng::~cPluginTvguideng() { } const char *cPluginTvguideng::CommandLineHelp(void) { - return NULL; + return NULL; } bool cPluginTvguideng::ProcessArgs(int argc, char *argv[]) { - return true; + return true; } bool cPluginTvguideng::Initialize(void) { - return true; + return true; } bool cPluginTvguideng::Start(void) { - skindesignerapi::cPluginStructure plugStruct; - plugStruct.name = "tvguideng"; - plugStruct.libskindesignerAPIVersion = LIBSKINDESIGNERAPIVERSION; - plugStruct.SetView(viRootView, "root.xml"); - plugStruct.SetViewElement(viRootView, verBackgroundHor, "background_hor"); - plugStruct.SetViewElement(viRootView, verBackgroundVer, "background_ver"); - plugStruct.SetViewElement(viRootView, verHeaderHor, "header_hor"); - plugStruct.SetViewElement(viRootView, verHeaderVer, "header_ver"); - plugStruct.SetViewElement(viRootView, verTimeHor, "time_hor"); - plugStruct.SetViewElement(viRootView, verTimeVer, "time_ver"); - plugStruct.SetViewElement(viRootView, verFooterHor, "footer_hor"); - plugStruct.SetViewElement(viRootView, verFooterVer, "footer_ver"); - plugStruct.SetViewElement(viRootView, verDateTimelineHor, "datetimeline_hor"); - plugStruct.SetViewElement(viRootView, verDateTimelineVer, "datetimeline_ver"); - plugStruct.SetViewElement(viRootView, verTimeIndicatorHor, "timeindicator_hor"); - plugStruct.SetViewElement(viRootView, verTimeIndicatorVer, "timeindicator_ver"); - plugStruct.SetViewElement(viRootView, verChannelJump, "channeljump"); - plugStruct.SetViewGrid(viRootView, vgChannelsHor, "channels_hor"); - plugStruct.SetViewGrid(viRootView, vgChannelsVer, "channels_ver"); - plugStruct.SetViewGrid(viRootView, vgSchedulesHor, "schedules_hor"); - plugStruct.SetViewGrid(viRootView, vgSchedulesVer, "schedules_ver"); - plugStruct.SetViewGrid(viRootView, vgTimelineHor, "timeline_hor"); - plugStruct.SetViewGrid(viRootView, vgTimelineVer, "timeline_ver"); - plugStruct.SetViewGrid(viRootView, vgChannelGroupsHor, "channelgroups_hor"); - plugStruct.SetViewGrid(viRootView, vgChannelGroupsVer, "channelgroups_ver"); - //Detail View - plugStruct.SetSubView(viRootView, viDetailView, "detail.xml"); - plugStruct.SetViewElement(viDetailView, vedBackground, "background"); - plugStruct.SetViewElement(viDetailView, vedHeader, "header"); - plugStruct.SetViewElement(viDetailView, vedFooter, "footer"); - plugStruct.SetViewElement(viDetailView, vedTime, "time"); - //Search & Recording Menus - plugStruct.SetSubView(viRootView, viRecMenu, "recmenu.xml"); - plugStruct.SetViewElement(viRecMenu, vemBackground, "background"); - plugStruct.SetViewElement(viRecMenu, vemScrollbar, "scrollbar"); - plugStruct.SetViewGrid(viRecMenu, vgRecordingMenu, "recmenu"); - - if (!skindesignerapi::SkindesignerAPI::RegisterPlugin(&plugStruct)) { - esyslog("tvguideng: skindesigner not available"); - } + SkindesignerRegister(); return true; } @@ -115,43 +78,179 @@ void cPluginTvguideng::MainThreadHook(void) { } cString cPluginTvguideng::Active(void) { - return NULL; + return NULL; } time_t cPluginTvguideng::WakeupTime(void) { - return 0; + return 0; } cOsdObject *cPluginTvguideng::MainMenuAction(void) { - return new cTVGuideOSD(); + return new cTVGuideOSD(plugStruct); } cMenuSetupPage *cPluginTvguideng::SetupMenu(void) { - return new cTvGuideSetup(); + return new cTvGuideSetup(); } bool cPluginTvguideng::SetupParse(const char *Name, const char *Value) { - return config.SetupParse(Name, Value); + return config.SetupParse(Name, Value); } bool cPluginTvguideng::Service(const char *Id, void *Data) { - if (strcmp(Id, "MainMenuHooksPatch-v1.0::osSchedule") == 0 && config.replaceOriginalSchedule != 0) { - if (Data == NULL) - return true; - cOsdObject **guide = (cOsdObject**) Data; - if (guide) - *guide = MainMenuAction(); - return true; - } - return false; + if (strcmp(Id, "MainMenuHooksPatch-v1.0::osSchedule") == 0 && config.replaceOriginalSchedule != 0) { + if (Data == NULL) + return true; + cOsdObject **guide = (cOsdObject**) Data; + if (guide) + *guide = MainMenuAction(); + return true; + } + return false; } const char **cPluginTvguideng::SVDRPHelpPages(void) { - return NULL; + return NULL; } cString cPluginTvguideng::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode) { - return NULL; + return NULL; +} + +void cPluginTvguideng::SkindesignerRegister(void) { + plugStruct = new skindesignerapi::cPluginStructure(); + plugStruct->name = "tvguideng"; + plugStruct->libskindesignerAPIVersion = LIBSKINDESIGNERAPIVERSION; + //Root View + plugStruct->RegisterRootView("root.xml"); + skindesignerapi::cTokenContainer *tkBackground = new skindesignerapi::cTokenContainer(); + //View Elements Root View + plugStruct->RegisterViewElement((int)eViews::rootView, (int)eViewElementsRoot::backgroundHor, "background_hor", tkBackground); + plugStruct->RegisterViewElement((int)eViews::rootView, (int)eViewElementsRoot::backgroundVer, "background_ver", tkBackground); + skindesignerapi::cTokenContainer *tkHeaderHor = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewElementsRoot::headerHor, tkHeaderHor); + plugStruct->RegisterViewElement((int)eViews::rootView, (int)eViewElementsRoot::headerHor, "header_hor", tkHeaderHor); + skindesignerapi::cTokenContainer *tkHeaderVer = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewElementsRoot::headerVer, tkHeaderVer); + plugStruct->RegisterViewElement((int)eViews::rootView, (int)eViewElementsRoot::headerVer, "header_ver", tkHeaderVer); + skindesignerapi::cTokenContainer *tkTimerHor = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewElementsRoot::timeHor, tkTimerHor); + plugStruct->RegisterViewElement((int)eViews::rootView, (int)eViewElementsRoot::timeHor, "time_hor", tkTimerHor); + skindesignerapi::cTokenContainer *tkTimerVer = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewElementsRoot::timeVer, tkTimerVer); + plugStruct->RegisterViewElement((int)eViews::rootView, (int)eViewElementsRoot::timeVer, "time_ver", tkTimerVer); + skindesignerapi::cTokenContainer *tkFooterHor = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewElementsRoot::footerHor, tkFooterHor); + plugStruct->RegisterViewElement((int)eViews::rootView, (int)eViewElementsRoot::footerHor, "footer_hor", tkFooterHor); + skindesignerapi::cTokenContainer *tkFooterVer = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewElementsRoot::footerVer, tkFooterVer); + plugStruct->RegisterViewElement((int)eViews::rootView, (int)eViewElementsRoot::footerVer, "footer_ver", tkFooterVer); + skindesignerapi::cTokenContainer *tkDateTimelineHor = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewElementsRoot::dateTimelineHor, tkDateTimelineHor); + plugStruct->RegisterViewElement((int)eViews::rootView, (int)eViewElementsRoot::dateTimelineHor, "datetimeline_hor", tkDateTimelineHor); + skindesignerapi::cTokenContainer *tkDateTimelineVer = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewElementsRoot::dateTimelineVer, tkDateTimelineVer); + plugStruct->RegisterViewElement((int)eViews::rootView, (int)eViewElementsRoot::dateTimelineVer, "datetimeline_ver", tkDateTimelineVer); + skindesignerapi::cTokenContainer *tkTimeIndHor = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewElementsRoot::timeIndicatorHor, tkTimeIndHor); + plugStruct->RegisterViewElement((int)eViews::rootView, (int)eViewElementsRoot::timeIndicatorHor, "timeindicator_hor", tkTimeIndHor); + skindesignerapi::cTokenContainer *tkTimeIndVer = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewElementsRoot::timeIndicatorVer, tkTimeIndVer); + plugStruct->RegisterViewElement((int)eViews::rootView, (int)eViewElementsRoot::timeIndicatorVer, "timeindicator_ver", tkTimeIndVer); + skindesignerapi::cTokenContainer *tkChanneljump = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewElementsRoot::channelJump, tkChanneljump); + plugStruct->RegisterViewElement((int)eViews::rootView, (int)eViewElementsRoot::channelJump, "channeljump", tkChanneljump); + //View Grids Root View + skindesignerapi::cTokenContainer *tkChannelsHor = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewGridsRoot::channelsHor, tkChannelsHor); + plugStruct->RegisterViewGrid((int)eViews::rootView, (int)eViewGridsRoot::channelsHor, "channels_hor", tkChannelsHor); + skindesignerapi::cTokenContainer *tkChannelsVer = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewGridsRoot::channelsVer, tkChannelsVer); + plugStruct->RegisterViewGrid((int)eViews::rootView, (int)eViewGridsRoot::channelsVer, "channels_ver", tkChannelsVer); + skindesignerapi::cTokenContainer *tkSchedulesHor = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewGridsRoot::schedulesHor, tkSchedulesHor); + plugStruct->RegisterViewGrid((int)eViews::rootView, (int)eViewGridsRoot::schedulesHor, "schedules_hor", tkSchedulesHor); + skindesignerapi::cTokenContainer *tkSchedulesVer = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewGridsRoot::schedulesVer, tkSchedulesVer); + plugStruct->RegisterViewGrid((int)eViews::rootView, (int)eViewGridsRoot::schedulesVer, "schedules_ver", tkSchedulesVer); + skindesignerapi::cTokenContainer *tkTimelineHor = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewGridsRoot::timelineHor, tkTimelineHor); + plugStruct->RegisterViewGrid((int)eViews::rootView, (int)eViewGridsRoot::timelineHor, "timeline_hor", tkTimelineHor); + skindesignerapi::cTokenContainer *tkTimelineVer = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewGridsRoot::timelineVer, tkTimelineVer); + plugStruct->RegisterViewGrid((int)eViews::rootView, (int)eViewGridsRoot::timelineVer, "timeline_ver", tkTimelineVer); + skindesignerapi::cTokenContainer *tkChannelGroupsHor = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewGridsRoot::channelGroupsHor, tkChannelGroupsHor); + plugStruct->RegisterViewGrid((int)eViews::rootView, (int)eViewGridsRoot::channelGroupsHor, "channelgroups_hor", tkChannelGroupsHor); + skindesignerapi::cTokenContainer *tkChannelGroupsVer = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewGridsRoot::channelGroupsVer, tkChannelGroupsVer); + plugStruct->RegisterViewGrid((int)eViews::rootView, (int)eViewGridsRoot::channelGroupsVer, "channelgroups_ver", tkChannelGroupsVer); + + //Detail View + plugStruct->RegisterSubView((int)eViews::detailView, "detail.xml"); + //viewelements Detail View Menus + skindesignerapi::cTokenContainer *tkBackDetail = new skindesignerapi::cTokenContainer(); + cDetailView::DefineTokens(eViewElementsDetail::background, tkBackDetail); + plugStruct->RegisterViewElement((int)eViews::detailView, (int)eViewElementsDetail::background, "background", tkBackDetail); + skindesignerapi::cTokenContainer *tkHeaderDetail = new skindesignerapi::cTokenContainer(); + cDetailView::DefineTokens(eViewElementsDetail::header, tkHeaderDetail); + plugStruct->RegisterViewElement((int)eViews::detailView, (int)eViewElementsDetail::header, "header", tkHeaderDetail); + skindesignerapi::cTokenContainer *tkFooterDetail = new skindesignerapi::cTokenContainer(); + cDetailView::DefineTokens(eViewElementsDetail::footer, tkFooterDetail); + plugStruct->RegisterViewElement((int)eViews::detailView, (int)eViewElementsDetail::footer, "footer", tkFooterDetail); + skindesignerapi::cTokenContainer *tkTimeDetail = new skindesignerapi::cTokenContainer(); + cTVGuideOSD::DefineTokens(eViewElementsRoot::timeHor, tkTimeDetail); + plugStruct->RegisterViewElement((int)eViews::detailView, (int)eViewElementsDetail::time, "time", tkTimeDetail); + //TabbedView + skindesignerapi::cTokenContainer *tkTab = new skindesignerapi::cTokenContainer(); + cDetailView::DefineTabTokens(tkTab); + plugStruct->RegisterViewTab((int)eViews::detailView, tkTab); + + //Search & Recording Menus + plugStruct->RegisterSubView((int)eViews::recMenu, "recmenu.xml"); + //viewelements Recording Menus + skindesignerapi::cTokenContainer *tkBackRec = new skindesignerapi::cTokenContainer(); + cRecMenu::DefineTokens(eViewElementsRecMenu::background, tkBackRec); + plugStruct->RegisterViewElement((int)eViews::recMenu, (int)eViewElementsRecMenu::background, "background", tkBackRec); + skindesignerapi::cTokenContainer *tkScrollbarRec = new skindesignerapi::cTokenContainer(); + cRecMenu::DefineTokens(eViewElementsRecMenu::scrollbar, tkScrollbarRec); + plugStruct->RegisterViewElement((int)eViews::recMenu, (int)eViewElementsRecMenu::scrollbar, "scrollbar", tkScrollbarRec); + //grids Recording Menus + skindesignerapi::cTokenContainer *tkRecMenu = new skindesignerapi::cTokenContainer(); + cRecMenu::DefineTokens(eViewGridsRecMenu::menu, tkRecMenu); + plugStruct->RegisterViewGrid((int)eViews::recMenu, (int)eViewGridsRecMenu::menu, "recmenu", tkRecMenu); + + plugStruct->RegisterSubView((int)eViews::recMenu2, "recmenu.xml"); + //viewelements Recording Menus + skindesignerapi::cTokenContainer *tkBackRec2 = new skindesignerapi::cTokenContainer(); + cRecMenu::DefineTokens(eViewElementsRecMenu::background, tkBackRec2); + plugStruct->RegisterViewElement((int)eViews::recMenu2, (int)eViewElementsRecMenu::background, "background", tkBackRec2); + skindesignerapi::cTokenContainer *tkScrollbarRec2 = new skindesignerapi::cTokenContainer(); + cRecMenu::DefineTokens(eViewElementsRecMenu::scrollbar, tkScrollbarRec2); + plugStruct->RegisterViewElement((int)eViews::recMenu2, (int)eViewElementsRecMenu::scrollbar, "scrollbar", tkScrollbarRec2); + //grids Recording Menus + skindesignerapi::cTokenContainer *tkRecMenu2 = new skindesignerapi::cTokenContainer(); + cRecMenu::DefineTokens(eViewGridsRecMenu::menu, tkRecMenu2); + plugStruct->RegisterViewGrid((int)eViews::recMenu2, (int)eViewGridsRecMenu::menu, "recmenu", tkRecMenu2); + + plugStruct->RegisterSubView((int)eViews::recMenu3, "recmenu.xml"); + //viewelements Recording Menus + skindesignerapi::cTokenContainer *tkBackRec3 = new skindesignerapi::cTokenContainer(); + cRecMenu::DefineTokens(eViewElementsRecMenu::background, tkBackRec3); + plugStruct->RegisterViewElement((int)eViews::recMenu3, (int)eViewElementsRecMenu::background, "background", tkBackRec3); + skindesignerapi::cTokenContainer *tkScrollbarRec3 = new skindesignerapi::cTokenContainer(); + cRecMenu::DefineTokens(eViewElementsRecMenu::scrollbar, tkScrollbarRec3); + plugStruct->RegisterViewElement((int)eViews::recMenu3, (int)eViewElementsRecMenu::scrollbar, "scrollbar", tkScrollbarRec3); + //grids Recording Menus + skindesignerapi::cTokenContainer *tkRecMenu3 = new skindesignerapi::cTokenContainer(); + cRecMenu::DefineTokens(eViewGridsRecMenu::menu, tkRecMenu3); + plugStruct->RegisterViewGrid((int)eViews::recMenu3, (int)eViewGridsRecMenu::menu, "recmenu", tkRecMenu3); + + if (!skindesignerapi::SkindesignerAPI::RegisterPlugin(plugStruct)) { + esyslog("tvguideng: skindesigner not available"); + } else { + dsyslog("tvguideng: successfully registered at skindesigner, id %d", plugStruct->id); + } } VDRPLUGINCREATOR(cPluginTvguideng); // Don't touch this! |