From 2299c1e099d7a5190f9bfdc8b76315bbc86bd179 Mon Sep 17 00:00:00 2001 From: svntobi Date: Sat, 11 Aug 2007 19:02:56 +0000 Subject: some renamings git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/submenu/trunk@5681 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f --- vdr-patch/menuorg-0.1.diff | 162 ++++++++++++++++++++++++++++++++++++++ vdr-patch/opt-37_submenu.dpatch | 167 ---------------------------------------- 2 files changed, 162 insertions(+), 167 deletions(-) create mode 100755 vdr-patch/menuorg-0.1.diff delete mode 100755 vdr-patch/opt-37_submenu.dpatch (limited to 'vdr-patch') diff --git a/vdr-patch/menuorg-0.1.diff b/vdr-patch/menuorg-0.1.diff new file mode 100755 index 0000000..3c1fcb1 --- /dev/null +++ b/vdr-patch/menuorg-0.1.diff @@ -0,0 +1,162 @@ +diff -urNad vdr-1.4.7~/menu.c vdr-1.4.7/menu.c +--- vdr-1.4.7~/menu.c 2007-08-11 20:48:29.000000000 +0200 ++++ vdr-1.4.7/menu.c 2007-08-11 20:48:29.000000000 +0200 +@@ -31,6 +31,7 @@ + #include "vdrttxtsubshooks.h" + #include "dvbsub.h" + #include "videodir.h" ++#include "menuorgpatch.h" + + #define MAXWAIT4EPGINFO 3 // seconds + #define MODETIMEOUT 3 // seconds +@@ -3057,6 +3058,13 @@ + cancelEditingItem = NULL; + stopRecordingItem = NULL; + recordControlsState = 0; ++ ++ MenuOrgPatch::IMainMenuItemsProvider* mainMenuItemsProvider; ++ ++ if (cPluginManager::CallFirstService("MenuOrgPatch-v0.1::MainMenuitemsProvider", &mainMenuItemsProvider)) { ++ mainMenuItemsProvider->EnterRootMenu(); ++ } ++ + Set(); + + // Initial submenus: +@@ -3084,6 +3092,29 @@ + Clear(); + SetTitle("VDR"); + SetHasHotkeys(); ++ ++ MenuOrgPatch::IMainMenuItemsProvider* mainMenuItemsProvider; ++ ++ if (cPluginManager::CallFirstService("MenuOrgPatch-v0.1::MainMenuItemsProvider", &mainMenuItemsProvider)) { ++ MenuOrgPatch::MainMenuItemsList* menuItems = mainMenuItemsProvider->MainMenuItems(); ++ MenuOrgPatch::MainMenuItemsList::iterator i; ++ ++ for (i = menuItems->begin(); i != menuItems->end(); i++) { ++ if ((*i)->IsCustomMenuItem()) { ++ cOsdItem* osdItem = (*i)->CustomMenuItem(); ++ if (osdItem) { ++ osdItem->SetText(hk(osdItem->Text())); ++ Add(osdItem); ++ } ++ } ++ else if ((*i)->IsPluginMenuItem()) { ++ const char *item = (*i)->PluginMenuEntry(); ++ if (item) ++ Add(new cMenuPluginItem(hk(item), (*i)->PluginIndex())); ++ } ++ } ++ } ++ else { + + // Basic menu items: + +@@ -3111,6 +3142,8 @@ + if (Commands.Count()) + Add(new cOsdItem(hk(tr("Commands")), osCommands)); + ++ } ++ + Update(true); + + Display(); +@@ -3238,6 +3271,35 @@ + state = osEnd; + } + break; ++ case osBack: { ++ MenuOrgPatch::IMainMenuItemsProvider* mainMenuItemsProvider; ++ ++ if (cPluginManager::CallFirstService("MenuOrgPatch-v0.1::MainMenuItemsProvider", &mainMenuItemsProvider)) { ++ bool leavingMenuSucceeded = mainMenuItemsProvider->LeaveSubMenu(); ++ Set(); ++ stopReplayItem = NULL; ++ cancelEditingItem = NULL; ++ stopRecordingItem = NULL; ++ recordControlsState = 0; ++ Update(true); ++ Display(); ++ if (leavingMenuSucceeded) ++ return osContinue; ++ else ++ return osEnd; ++ } ++ } ++ break; ++ case osUser1: { ++ MenuOrgPatch::IMainMenuItemsProvider* mainMenuItemsProvider; ++ ++ if (cPluginManager::CallFirstService("MenuOrgPatch-v0.1::MainMenuItemsProvider", &mainMenuItemsProvider)) { ++ mainMenuItemsProvider->EnterSubMenu(Get(Current())); ++ Set(); ++ return osContinue; ++ } ++ } ++ break; + default: switch (Key) { + case kRecord: + case kRed: if (!HadSubMenu) +diff -urNad vdr-1.4.7~/menuorgpatch.h vdr-1.4.7/menuorgpatch.h +--- vdr-1.4.7~/menuorgpatch.h 1970-01-01 01:00:00.000000000 +0100 ++++ vdr-1.4.7/menuorgpatch.h 2007-08-11 20:48:58.000000000 +0200 +@@ -0,0 +1,58 @@ ++/* ++ * vdr-menuorg - A plugin for the Linux Video Disk Recorder ++ * Copyright (C) 2007 Thomas Creutz, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * $Id:$ ++ * ++ */ ++ ++#ifndef __MENUORGPATCH_H ++#define __MENUORGPATCH_H ++ ++#include ++ ++class cOsdItem; ++ ++namespace MenuOrgPatch ++{ ++ ++class IMainMenuItem ++{ ++ public: ++ virtual ~IMainMenuItem() {}; ++ virtual bool IsCustomMenuItem() = 0; ++ virtual bool IsPluginMenuItem() = 0; ++ virtual cOsdItem* CustomMenuItem() = 0; ++ virtual const char* PluginMenuEntry() = 0; ++ virtual int PluginIndex() = 0; ++}; ++ ++typedef std::vector MainMenuItemsList; ++ ++class IMainMenuItemsProvider ++{ ++ public: ++ virtual ~IMainMenuItemsProvider() {}; ++ virtual MainMenuItemsList* MainMenuItems() = 0; ++ virtual void EnterRootMenu() = 0; ++ virtual void EnterSubMenu(cOsdItem* item) = 0; ++ virtual bool LeaveSubMenu() = 0; ++}; ++ ++}; ++ ++#endif //__MENUORGPATCH_H diff --git a/vdr-patch/opt-37_submenu.dpatch b/vdr-patch/opt-37_submenu.dpatch deleted file mode 100755 index 826dc8b..0000000 --- a/vdr-patch/opt-37_submenu.dpatch +++ /dev/null @@ -1,167 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## opt-37_submenu.dpatch by Tobias Grimm -## DP: This patch is needed for the submenu plugin. - -@DPATCH@ -diff -urNad vdr-1.4.7~/menu.c vdr-1.4.7/menu.c ---- vdr-1.4.7~/menu.c 2007-07-28 15:20:41.000000000 +0200 -+++ vdr-1.4.7/menu.c 2007-07-28 15:20:41.000000000 +0200 -@@ -31,6 +31,7 @@ - #include "vdrttxtsubshooks.h" - #include "dvbsub.h" - #include "videodir.h" -+#include "submenupatch.h" - - #define MAXWAIT4EPGINFO 3 // seconds - #define MODETIMEOUT 3 // seconds -@@ -3057,6 +3058,13 @@ - cancelEditingItem = NULL; - stopRecordingItem = NULL; - recordControlsState = 0; -+ -+ SubMenuPatch::ISubMenuProvider* subMenuProvider; -+ -+ if (cPluginManager::CallFirstService("SubMenuPatch-v0.1::SubMenuProvider", &subMenuProvider)) { -+ subMenuProvider->EnterRootMenu(); -+ } -+ - Set(); - - // Initial submenus: -@@ -3084,6 +3092,29 @@ - Clear(); - SetTitle("VDR"); - SetHasHotkeys(); -+ -+ SubMenuPatch::ISubMenuProvider* subMenuProvider; -+ -+ if (cPluginManager::CallFirstService("SubMenuPatch-v0.1::SubMenuProvider", &subMenuProvider)) { -+ SubMenuPatch::MainMenuItemsList* menuItems = subMenuProvider->MainMenuItems(); -+ SubMenuPatch::MainMenuItemsList::iterator i; -+ -+ for (i = menuItems->begin(); i != menuItems->end(); i++) { -+ if ((*i)->IsCustomMenuItem()) { -+ cOsdItem* osdItem = (*i)->CustomMenuItem(); -+ if (osdItem) { -+ osdItem->SetText(hk(osdItem->Text())); -+ Add(osdItem); -+ } -+ } -+ else if ((*i)->IsPluginMenuItem()) { -+ const char *item = (*i)->PluginMenuEntry(); -+ if (item) -+ Add(new cMenuPluginItem(hk(item), (*i)->PluginIndex())); -+ } -+ } -+ } -+ else { - - // Basic menu items: - -@@ -3111,6 +3142,8 @@ - if (Commands.Count()) - Add(new cOsdItem(hk(tr("Commands")), osCommands)); - -+ } -+ - Update(true); - - Display(); -@@ -3238,6 +3271,35 @@ - state = osEnd; - } - break; -+ case osBack: { -+ SubMenuPatch::ISubMenuProvider* subMenuProvider; -+ -+ if (cPluginManager::CallFirstService("SubMenuPatch-v0.1::SubMenuProvider", &subMenuProvider)) { -+ bool leavingMenuSucceeded = subMenuProvider->LeaveSubMenu(); -+ Set(); -+ stopReplayItem = NULL; -+ cancelEditingItem = NULL; -+ stopRecordingItem = NULL; -+ recordControlsState = 0; -+ Update(true); -+ Display(); -+ if (leavingMenuSucceeded) -+ return osContinue; -+ else -+ return osEnd; -+ } -+ } -+ break; -+ case osUser1: { -+ SubMenuPatch::ISubMenuProvider* subMenuProvider; -+ -+ if (cPluginManager::CallFirstService("SubMenuPatch-v0.1::SubMenuProvider", &subMenuProvider)) { -+ subMenuProvider->EnterSubMenu(Get(Current())); -+ Set(); -+ return osContinue; -+ } -+ } -+ break; - default: switch (Key) { - case kRecord: - case kRed: if (!HadSubMenu) -diff -urNad vdr-1.4.7~/submenupatch.h vdr-1.4.7/submenupatch.h ---- vdr-1.4.7~/submenupatch.h 1970-01-01 01:00:00.000000000 +0100 -+++ vdr-1.4.7/submenupatch.h 2007-07-28 15:23:23.000000000 +0200 -@@ -0,0 +1,58 @@ -+/* -+ * vdr-submenu - A plugin for the Linux Video Disk Recorder -+ * Copyright (c) 2007 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ * -+ * $Id$ -+ * -+ */ -+ -+#ifndef __SUBMENUPATCH_H -+#define __SUBMENUPATCH_H -+ -+#include -+ -+class cOsdItem; -+ -+namespace SubMenuPatch -+{ -+ -+class IMainMenuItem -+{ -+ public: -+ virtual ~IMainMenuItem() {}; -+ virtual bool IsCustomMenuItem() = 0; -+ virtual bool IsPluginMenuItem() = 0; -+ virtual cOsdItem* CustomMenuItem() = 0; -+ virtual const char* PluginMenuEntry() = 0; -+ virtual int PluginIndex() = 0; -+}; -+ -+typedef std::vector MainMenuItemsList; -+ -+class ISubMenuProvider -+{ -+ public: -+ virtual ~ISubMenuProvider() {}; -+ virtual MainMenuItemsList* MainMenuItems() = 0; -+ virtual void EnterRootMenu() = 0; -+ virtual void EnterSubMenu(cOsdItem* item) = 0; -+ virtual bool LeaveSubMenu() = 0; -+}; -+ -+}; -+ -+#endif //__SUBMENUPATCH_H -- cgit v1.2.3