This is a "patch" for the Video Disk Recorder (VDR).

* Authors:
Tobias Grimm  <vdr at e-tobi dot net>
Martin Prochnow  <nordlicht at martins-kabuff dot de>
Frank Schmirler  <vdrdev at schmirler dot de>
Christian Wieninger  <cwieninger at gmx dot de>

* Description:
This patch allows plugins to replace the VDR mainmenus "Schedule",
"Channels", "Timers" and "Recordings" by a different implementation.

The patch is based on a suggestion of Christian Wieninger back in 2006
(http://www.linuxtv.org/pipermail/vdr/2006-March/008234.html). It is
meant to be an interim solution for VDR 1.4 until (maybe) VDR 1.5
introduces an official API for this purpose.

* Installation
Change into the VDR source directory, then issue
  patch -p1 < path/to/MainMenuHooks-v1_0.patch
and recompile.

* Notes for plugin authors
The following code sample shows the required plugin code for replacing
the original Schedule menu:

bool cMyPlugin::Service(const char *Id, void *Data)
{
  cOsdMenu **menu = (cOsdMenu**) Data;
  if (MySetup.replaceSchedule &&
            strcmp(Id, "MainMenuHooksPatch-v1.0::osSchedule") == 0) {
    if (menu)
      *menu = (cOsdMenu*) MainMenuAction();
    return true;
  }
  return false;
}

A plugin can replace more than one menu at a time. Simply replace the
call to MainMenuAction() in the sample above by appropriate code.

Note that a plugin *should* offer a setup option which allows the user
to enable or disable the replacement. "Disabled" would be a reasonable
default setting. By testing for define MAINMENUHOOKSVERSNUM, a plugin
can leave the setup option out at compiletime.

In case there is an internal problem when trying to open the replacement
menu, it is safe to return true even though Data is NULL. However an
OSD message should indicate the problem to the user.

Feel free to ship this patch along with your plugin. However if you
think you need to modify the patch, we'd encourage you to contact the
authors first or at least use a service id which differs in more than
just the version number.

