From 6a41eac668d05af1d64dddf0fa8fc749f0e5877a Mon Sep 17 00:00:00 2001 From: svntobi Date: Tue, 25 Mar 2008 20:20:37 +0000 Subject: Separator items now don't have a hotkey (number) in the OSD menu anymore (requires the patch to be updated once more) git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/menuorg/trunk@7088 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f --- HISTORY | 5 + po/menuorg.pot | 2 +- sources.mk | 1 + src/MenuItemDefinition.cpp | 5 + src/MenuItemDefinition.h | 1 + src/MenuItemDefinitionFactory.cpp | 3 +- src/SeparatorItemDefinition.cpp | 34 +++++ src/SeparatorItemDefinition.h | 36 +++++ src/Version.h | 2 +- vdr-patch/vdr-menuorg-0.4.2.diff | 270 ++++++++++++++++++++++++++++++++++++++ vdr-patch/vdr-menuorg-0.4.diff | 269 ------------------------------------- 11 files changed, 356 insertions(+), 272 deletions(-) create mode 100644 src/SeparatorItemDefinition.cpp create mode 100644 src/SeparatorItemDefinition.h create mode 100644 vdr-patch/vdr-menuorg-0.4.2.diff delete mode 100644 vdr-patch/vdr-menuorg-0.4.diff diff --git a/HISTORY b/HISTORY index b5fad02..89c9392 100644 --- a/HISTORY +++ b/HISTORY @@ -41,3 +41,8 @@ VDR Plugin 'menuorg' Revision History 2008-03-24: Version 0.4.1 - Fixed small bug caused by hidden menu entries + +2008-03-25: Version 0.4.2 + +- Separator items now don't have a hotkey (number) in the OSD menu anymore + (requires the patch to be updated once more) diff --git a/po/menuorg.pot b/po/menuorg.pot index 1818593..ae12cf2 100644 --- a/po/menuorg.pot +++ b/po/menuorg.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-03-24 23:33+0100\n" +"POT-Creation-Date: 2008-03-25 19:30+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/sources.mk b/sources.mk index 675ed8b..655b798 100644 --- a/sources.mk +++ b/sources.mk @@ -12,6 +12,7 @@ SRCS = \ src/PluginItemDefinition.cpp \ src/PluginMenuNode.cpp \ src/PluginSetup.cpp \ + src/SeparatorItemDefinition.cpp \ src/SubMenuNode.cpp \ src/SystemMenuNode.cpp \ src/OsdLineItem.cpp \ diff --git a/src/MenuItemDefinition.cpp b/src/MenuItemDefinition.cpp index 7e6c527..0f14071 100644 --- a/src/MenuItemDefinition.cpp +++ b/src/MenuItemDefinition.cpp @@ -33,3 +33,8 @@ MenuNode* MenuItemDefinition::AssignedMenuNode() { return _menuNode; } + +bool MenuItemDefinition::IsSeparatorItem() +{ + return false; +} diff --git a/src/MenuItemDefinition.h b/src/MenuItemDefinition.h index 5c19f08..5fc0c12 100644 --- a/src/MenuItemDefinition.h +++ b/src/MenuItemDefinition.h @@ -37,6 +37,7 @@ class MenuItemDefinition: public IMenuItemDefinition public: MenuItemDefinition(MenuNode* menuNode); MenuNode* AssignedMenuNode(); + virtual bool IsSeparatorItem(); }; diff --git a/src/MenuItemDefinitionFactory.cpp b/src/MenuItemDefinitionFactory.cpp index 85a61bf..e2819de 100644 --- a/src/MenuItemDefinitionFactory.cpp +++ b/src/MenuItemDefinitionFactory.cpp @@ -29,6 +29,7 @@ #include "SeparatorMenuNode.h" #include "OsdItemDefinition.h" #include "PluginItemDefinition.h" +#include "SeparatorItemDefinition.h" #include "OsdLineItem.h" #include @@ -68,5 +69,5 @@ void MenuItemDefinitionFactory::ProcessCommandMenuNode(CommandMenuNode* node) void MenuItemDefinitionFactory::ProcessSeparatorMenuNode(SeparatorMenuNode* node) { - _createdMenuItemDefinition = new OsdItemDefinition(node, new cOsdSeparatorItem(node->DisplayText().c_str()), false); + _createdMenuItemDefinition = new SeparatorItemDefinition(node, new cOsdSeparatorItem(node->DisplayText().c_str())); } diff --git a/src/SeparatorItemDefinition.cpp b/src/SeparatorItemDefinition.cpp new file mode 100644 index 0000000..bdc1de2 --- /dev/null +++ b/src/SeparatorItemDefinition.cpp @@ -0,0 +1,34 @@ +/* + * vdr-menuorg - A plugin for the Linux Video Disk Recorder + * Copyright (c) 2007 - 2008 Tobias Grimm + * Copyright (c) 2007 Thomas Creutz + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * $Id: OsdItemDefinition.cpp 7083 2008-03-24 22:32:17Z svntobi $ + * + */ + +#include "SeparatorItemDefinition.h" + +SeparatorItemDefinition::SeparatorItemDefinition(MenuNode* menuNode, cOsdItem* osdItem) + :OsdItemDefinition(menuNode, osdItem, false) +{ +} + +bool SeparatorItemDefinition::IsSeparatorItem() +{ + return true; +} diff --git a/src/SeparatorItemDefinition.h b/src/SeparatorItemDefinition.h new file mode 100644 index 0000000..e93c27d --- /dev/null +++ b/src/SeparatorItemDefinition.h @@ -0,0 +1,36 @@ +/* + * vdr-menuorg - A plugin for the Linux Video Disk Recorder + * Copyright (c) 2007 - 2008 Tobias Grimm + * Copyright (c) 2007 Thomas Creutz + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * $Id$ + * + */ + +#ifndef ___SEPARATORITEMDEFINITION_H +#define ___SEPARATORITEMDEFINITION_H + +#include "OsdItemDefinition.h" + +class SeparatorItemDefinition: public OsdItemDefinition +{ + public: + SeparatorItemDefinition(MenuNode* menuNode, cOsdItem* osdItem); + virtual bool IsSeparatorItem(); +}; + +#endif diff --git a/src/Version.h b/src/Version.h index bc93cf6..3aa543d 100644 --- a/src/Version.h +++ b/src/Version.h @@ -24,6 +24,6 @@ #ifndef ___VERSION_H #define ___VERSION_H -static const char VERSION[] = "0.4.1"; +static const char VERSION[] = "0.4.2"; #endif diff --git a/vdr-patch/vdr-menuorg-0.4.2.diff b/vdr-patch/vdr-menuorg-0.4.2.diff new file mode 100644 index 0000000..f4e32c6 --- /dev/null +++ b/vdr-patch/vdr-menuorg-0.4.2.diff @@ -0,0 +1,270 @@ +diff -Nur vdr-1.5.18.orig/mainmenuitemsprovider.h vdr-1.5.18/mainmenuitemsprovider.h +--- vdr-1.5.18.orig/mainmenuitemsprovider.h 1970-01-01 01:00:00.000000000 +0100 ++++ vdr-1.5.18/mainmenuitemsprovider.h 2008-03-25 21:17:28.000000000 +0100 +@@ -0,0 +1,60 @@ ++/* ++ * vdr-menuorg - A plugin for the Linux Video Disk Recorder ++ * Copyright (c) 2007 - 2008 Tobias Grimm ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License as published by the ++ * Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ++ * details. ++ * ++ * You should have received a copy of the GNU General Public License along with ++ * this program; if not, write to the Free Software Foundation, Inc., ++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ * $Id$ ++ * ++ */ ++ ++#ifndef __MAINMENUITEMSPROVIDER_H ++#define __MAINMENUITEMSPROVIDER_H ++ ++#include ++ ++class cOsdItem; ++class cOsdMenu; ++ ++class IMenuItemDefinition ++{ ++ public: ++ virtual ~IMenuItemDefinition() {}; ++ virtual bool IsCustomOsdItem() = 0; ++ virtual bool IsPluginItem() = 0; ++ virtual bool IsSeparatorItem() = 0; ++ virtual cOsdItem* CustomOsdItem() = 0; ++ virtual const char* PluginMenuEntry() = 0; ++ virtual bool IsSelected() = 0; ++ virtual int PluginIndex() = 0; ++}; ++ ++typedef std::vector MenuItemDefinitions; ++ ++#define MENU_ITEMS_PROVIDER_SERVICE_ID "MenuOrgPatch-v0.4::MainMenuItemsProvider" ++ ++class IMainMenuItemsProvider ++{ ++ public: ++ virtual ~IMainMenuItemsProvider() {}; ++ virtual bool IsCustomMenuAvailable() = 0; ++ virtual MenuItemDefinitions* MainMenuItems() = 0; ++ virtual void EnterRootMenu() = 0; ++ virtual void EnterSubMenu(cOsdItem* item) = 0; ++ virtual bool LeaveSubMenu() = 0; ++ virtual cOsdMenu* Execute(cOsdItem* item) = 0; ++}; ++ ++#endif //__MAINMENUITEMSPROVIDER_H +diff -Nur vdr-1.5.18.orig/menu.c vdr-1.5.18/menu.c +--- vdr-1.5.18.orig/menu.c 2008-03-16 12:15:28.000000000 +0100 ++++ vdr-1.5.18/menu.c 2008-03-25 21:17:28.000000000 +0100 +@@ -29,6 +29,7 @@ + #include "timers.h" + #include "transfer.h" + #include "videodir.h" ++#include "menuorgpatch.h" + + #define MAXWAIT4EPGINFO 3 // seconds + #define MODETIMEOUT 3 // seconds +@@ -2969,6 +2970,9 @@ + cancelEditingItem = NULL; + stopRecordingItem = NULL; + recordControlsState = 0; ++ ++ MenuOrgPatch::EnterRootMenu(); ++ + Set(); + + // Initial submenus: +@@ -2997,6 +3001,29 @@ + SetTitle("VDR"); + SetHasHotkeys(); + ++ if (MenuOrgPatch::IsCustomMenuAvailable()) { ++ MenuItemDefinitions* menuItems = MenuOrgPatch::MainMenuItems(); ++ for (MenuItemDefinitions::iterator i = menuItems->begin(); i != menuItems->end(); i++) { ++ cOsdItem* osdItem = NULL; ++ if ((*i)->IsCustomOsdItem()) { ++ osdItem = (*i)->CustomOsdItem(); ++ if (osdItem && !(*i)->IsSeparatorItem()) ++ osdItem->SetText(hk(osdItem->Text())); ++ } ++ else if ((*i)->IsPluginItem()) { ++ const char *item = (*i)->PluginMenuEntry(); ++ if (item) ++ osdItem = new cMenuPluginItem(hk(item), (*i)->PluginIndex()); ++ } ++ if (osdItem) { ++ Add(osdItem); ++ if ((*i)->IsSelected()) ++ SetCurrent(osdItem); ++ } ++ } ++ } ++ else { ++ + // Basic menu items: + + Add(new cOsdItem(hk(tr("Schedule")), osSchedule)); +@@ -3023,6 +3050,8 @@ + if (Commands.Count()) + Add(new cOsdItem(hk(tr("Commands")), osCommands)); + ++ } ++ + Update(true); + + Display(); +@@ -3135,6 +3164,41 @@ + state = osEnd; + } + break; ++ case osBack: { ++ if (MenuOrgPatch::IsCustomMenuAvailable()) ++ { ++ bool leavingMenuSucceeded = MenuOrgPatch::LeaveSubMenu(); ++ Set(); ++ stopReplayItem = NULL; ++ cancelEditingItem = NULL; ++ stopRecordingItem = NULL; ++ recordControlsState = 0; ++ Update(true); ++ Display(); ++ if (leavingMenuSucceeded) ++ return osContinue; ++ else ++ return osEnd; ++ } ++ } ++ break; ++ case osUser1: { ++ if (MenuOrgPatch::IsCustomMenuAvailable()) { ++ MenuOrgPatch::EnterSubMenu(Get(Current())); ++ Set(); ++ return osContinue; ++ } ++ } ++ break; ++ case osUser2: { ++ if (MenuOrgPatch::IsCustomMenuAvailable()) { ++ cOsdMenu* osdMenu = MenuOrgPatch::Execute(Get(Current())); ++ if (osdMenu) ++ return AddSubMenu(osdMenu); ++ return osEnd; ++ } ++ } ++ break; + default: switch (Key) { + case kRecord: + case kRed: if (!HadSubMenu) +diff -Nur vdr-1.5.18.orig/menuorgpatch.h vdr-1.5.18/menuorgpatch.h +--- vdr-1.5.18.orig/menuorgpatch.h 1970-01-01 01:00:00.000000000 +0100 ++++ vdr-1.5.18/menuorgpatch.h 2008-03-25 21:17:28.000000000 +0100 +@@ -0,0 +1,100 @@ ++/* ++ * vdr-menuorg - A plugin for the Linux Video Disk Recorder ++ * Copyright (c) 2007 - 2008 Tobias Grimm ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License as published by the ++ * Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ++ * details. ++ * ++ * You should have received a copy of the GNU General Public License along with ++ * this program; if not, write to the Free Software Foundation, Inc., ++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ * $Id$ ++ * ++ */ ++ ++#ifndef __MENUORGPATCH_H ++#define __MENUORGPATCH_H ++ ++#include "mainmenuitemsprovider.h" ++ ++class MenuOrgPatch ++{ ++ private: ++ static IMainMenuItemsProvider* _mainMenuItemsProvider; ++ ++ private: ++ static IMainMenuItemsProvider* MainMenuItemsProvider() ++ { ++ if (!_mainMenuItemsProvider) ++ { ++ IMainMenuItemsProvider* mainMenuItemsProvider; ++ ++ if (cPluginManager::CallFirstService(MENU_ITEMS_PROVIDER_SERVICE_ID, &mainMenuItemsProvider)) ++ { ++ _mainMenuItemsProvider = mainMenuItemsProvider; ++ } ++ } ++ return _mainMenuItemsProvider; ++ } ++ ++ public: ++ static bool IsCustomMenuAvailable() ++ { ++ return (MainMenuItemsProvider() != NULL) && (MainMenuItemsProvider()->IsCustomMenuAvailable()); ++ } ++ ++ static void EnterRootMenu() ++ { ++ if (MainMenuItemsProvider()) ++ { ++ MainMenuItemsProvider()->EnterRootMenu(); ++ } ++ } ++ ++ static bool LeaveSubMenu() ++ { ++ if (MainMenuItemsProvider()) ++ { ++ return MainMenuItemsProvider()->LeaveSubMenu(); ++ } ++ return false; ++ } ++ ++ static void EnterSubMenu(cOsdItem* item) ++ { ++ if (MainMenuItemsProvider()) ++ { ++ MainMenuItemsProvider()->EnterSubMenu(item); ++ } ++ } ++ ++ static MenuItemDefinitions* MainMenuItems() ++ { ++ if (MainMenuItemsProvider()) ++ { ++ return MainMenuItemsProvider()->MainMenuItems(); ++ } ++ return NULL; ++ } ++ ++ static cOsdMenu* Execute(cOsdItem* item) ++ { ++ if (MainMenuItemsProvider()) ++ { ++ return MainMenuItemsProvider()->Execute(item); ++ } ++ return NULL; ++ } ++}; ++ ++IMainMenuItemsProvider* MenuOrgPatch::_mainMenuItemsProvider = NULL; ++ ++#endif //__MENUORGPATCH_H diff --git a/vdr-patch/vdr-menuorg-0.4.diff b/vdr-patch/vdr-menuorg-0.4.diff deleted file mode 100644 index 26862fa..0000000 --- a/vdr-patch/vdr-menuorg-0.4.diff +++ /dev/null @@ -1,269 +0,0 @@ -diff -Nur vdr-1.5.18.orig/mainmenuitemsprovider.h vdr-1.5.18/mainmenuitemsprovider.h ---- vdr-1.5.18.orig/mainmenuitemsprovider.h 1970-01-01 01:00:00.000000000 +0100 -+++ vdr-1.5.18/mainmenuitemsprovider.h 2008-03-23 01:54:07.000000000 +0100 -@@ -0,0 +1,59 @@ -+/* -+ * vdr-menuorg - A plugin for the Linux Video Disk Recorder -+ * Copyright (c) 2007 - 2008 Tobias Grimm -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License as published by the -+ * Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -+ * details. -+ * -+ * You should have received a copy of the GNU General Public License along with -+ * this program; if not, write to the Free Software Foundation, Inc., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ * $Id$ -+ * -+ */ -+ -+#ifndef __MAINMENUITEMSPROVIDER_H -+#define __MAINMENUITEMSPROVIDER_H -+ -+#include -+ -+class cOsdItem; -+class cOsdMenu; -+ -+class IMenuItemDefinition -+{ -+ public: -+ virtual ~IMenuItemDefinition() {}; -+ virtual bool IsCustomOsdItem() = 0; -+ virtual bool IsPluginItem() = 0; -+ virtual cOsdItem* CustomOsdItem() = 0; -+ virtual const char* PluginMenuEntry() = 0; -+ virtual bool IsSelected() = 0; -+ virtual int PluginIndex() = 0; -+}; -+ -+typedef std::vector MenuItemDefinitions; -+ -+#define MENU_ITEMS_PROVIDER_SERVICE_ID "MenuOrgPatch-v0.4::MainMenuItemsProvider" -+ -+class IMainMenuItemsProvider -+{ -+ public: -+ virtual ~IMainMenuItemsProvider() {}; -+ virtual bool IsCustomMenuAvailable() = 0; -+ virtual MenuItemDefinitions* MainMenuItems() = 0; -+ virtual void EnterRootMenu() = 0; -+ virtual void EnterSubMenu(cOsdItem* item) = 0; -+ virtual bool LeaveSubMenu() = 0; -+ virtual cOsdMenu* Execute(cOsdItem* item) = 0; -+}; -+ -+#endif //__MAINMENUITEMSPROVIDER_H -diff -Nur vdr-1.5.18.orig/menu.c vdr-1.5.18/menu.c ---- vdr-1.5.18.orig/menu.c 2008-03-16 12:15:28.000000000 +0100 -+++ vdr-1.5.18/menu.c 2008-03-23 02:00:16.000000000 +0100 -@@ -29,6 +29,7 @@ - #include "timers.h" - #include "transfer.h" - #include "videodir.h" -+#include "menuorgpatch.h" - - #define MAXWAIT4EPGINFO 3 // seconds - #define MODETIMEOUT 3 // seconds -@@ -2969,6 +2970,9 @@ - cancelEditingItem = NULL; - stopRecordingItem = NULL; - recordControlsState = 0; -+ -+ MenuOrgPatch::EnterRootMenu(); -+ - Set(); - - // Initial submenus: -@@ -2997,6 +3001,29 @@ - SetTitle("VDR"); - SetHasHotkeys(); - -+ if (MenuOrgPatch::IsCustomMenuAvailable()) { -+ MenuItemDefinitions* menuItems = MenuOrgPatch::MainMenuItems(); -+ for (MenuItemDefinitions::iterator i = menuItems->begin(); i != menuItems->end(); i++) { -+ cOsdItem* osdItem = NULL; -+ if ((*i)->IsCustomOsdItem()) { -+ osdItem = (*i)->CustomOsdItem(); -+ if (osdItem) -+ osdItem->SetText(hk(osdItem->Text())); -+ } -+ else if ((*i)->IsPluginItem()) { -+ const char *item = (*i)->PluginMenuEntry(); -+ if (item) -+ osdItem = new cMenuPluginItem(hk(item), (*i)->PluginIndex()); -+ } -+ if (osdItem) { -+ Add(osdItem); -+ if ((*i)->IsSelected()) -+ SetCurrent(osdItem); -+ } -+ } -+ } -+ else { -+ - // Basic menu items: - - Add(new cOsdItem(hk(tr("Schedule")), osSchedule)); -@@ -3023,6 +3050,8 @@ - if (Commands.Count()) - Add(new cOsdItem(hk(tr("Commands")), osCommands)); - -+ } -+ - Update(true); - - Display(); -@@ -3135,6 +3164,41 @@ - state = osEnd; - } - break; -+ case osBack: { -+ if (MenuOrgPatch::IsCustomMenuAvailable()) -+ { -+ bool leavingMenuSucceeded = MenuOrgPatch::LeaveSubMenu(); -+ Set(); -+ stopReplayItem = NULL; -+ cancelEditingItem = NULL; -+ stopRecordingItem = NULL; -+ recordControlsState = 0; -+ Update(true); -+ Display(); -+ if (leavingMenuSucceeded) -+ return osContinue; -+ else -+ return osEnd; -+ } -+ } -+ break; -+ case osUser1: { -+ if (MenuOrgPatch::IsCustomMenuAvailable()) { -+ MenuOrgPatch::EnterSubMenu(Get(Current())); -+ Set(); -+ return osContinue; -+ } -+ } -+ break; -+ case osUser2: { -+ if (MenuOrgPatch::IsCustomMenuAvailable()) { -+ cOsdMenu* osdMenu = MenuOrgPatch::Execute(Get(Current())); -+ if (osdMenu) -+ return AddSubMenu(osdMenu); -+ return osEnd; -+ } -+ } -+ break; - default: switch (Key) { - case kRecord: - case kRed: if (!HadSubMenu) -diff -Nur vdr-1.5.18.orig/menuorgpatch.h vdr-1.5.18/menuorgpatch.h ---- vdr-1.5.18.orig/menuorgpatch.h 1970-01-01 01:00:00.000000000 +0100 -+++ vdr-1.5.18/menuorgpatch.h 2008-03-23 01:53:29.000000000 +0100 -@@ -0,0 +1,100 @@ -+/* -+ * vdr-menuorg - A plugin for the Linux Video Disk Recorder -+ * Copyright (c) 2007 - 2008 Tobias Grimm -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License as published by the -+ * Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -+ * details. -+ * -+ * You should have received a copy of the GNU General Public License along with -+ * this program; if not, write to the Free Software Foundation, Inc., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ * -+ * $Id$ -+ * -+ */ -+ -+#ifndef __MENUORGPATCH_H -+#define __MENUORGPATCH_H -+ -+#include "mainmenuitemsprovider.h" -+ -+class MenuOrgPatch -+{ -+ private: -+ static IMainMenuItemsProvider* _mainMenuItemsProvider; -+ -+ private: -+ static IMainMenuItemsProvider* MainMenuItemsProvider() -+ { -+ if (!_mainMenuItemsProvider) -+ { -+ IMainMenuItemsProvider* mainMenuItemsProvider; -+ -+ if (cPluginManager::CallFirstService(MENU_ITEMS_PROVIDER_SERVICE_ID, &mainMenuItemsProvider)) -+ { -+ _mainMenuItemsProvider = mainMenuItemsProvider; -+ } -+ } -+ return _mainMenuItemsProvider; -+ } -+ -+ public: -+ static bool IsCustomMenuAvailable() -+ { -+ return (MainMenuItemsProvider() != NULL) && (MainMenuItemsProvider()->IsCustomMenuAvailable()); -+ } -+ -+ static void EnterRootMenu() -+ { -+ if (MainMenuItemsProvider()) -+ { -+ MainMenuItemsProvider()->EnterRootMenu(); -+ } -+ } -+ -+ static bool LeaveSubMenu() -+ { -+ if (MainMenuItemsProvider()) -+ { -+ return MainMenuItemsProvider()->LeaveSubMenu(); -+ } -+ return false; -+ } -+ -+ static void EnterSubMenu(cOsdItem* item) -+ { -+ if (MainMenuItemsProvider()) -+ { -+ MainMenuItemsProvider()->EnterSubMenu(item); -+ } -+ } -+ -+ static MenuItemDefinitions* MainMenuItems() -+ { -+ if (MainMenuItemsProvider()) -+ { -+ return MainMenuItemsProvider()->MainMenuItems(); -+ } -+ return NULL; -+ } -+ -+ static cOsdMenu* Execute(cOsdItem* item) -+ { -+ if (MainMenuItemsProvider()) -+ { -+ return MainMenuItemsProvider()->Execute(item); -+ } -+ return NULL; -+ } -+}; -+ -+IMainMenuItemsProvider* MenuOrgPatch::_mainMenuItemsProvider = NULL; -+ -+#endif //__MENUORGPATCH_H -- cgit v1.2.3