#include "osdbase.h"
#include "common.h"

// --- cPerlOsdMenu -----------------------------------------------------------

cPerlOsdMenu::cPerlOsdMenu(FILE *Pipe, const char *Title):
		cPerlOsdMenuBase<cOsdMenu>(Pipe, "OsdMenu", Title)
{
}

// --- cPerlOsdItem -----------------------------------------------------------

cPerlOsdItem::cPerlOsdItem(FILE *Pipe, const char *Text, eOSState State,
                           const char *Name):
		cOsdItem(Text, State),
		cPerlCallbackBase(Pipe, Name)
{
}

void cPerlOsdItem::Method(const char *Opts)
{
	char **params = SplitParameters(Opts, 1);

	if      (strcmp(params[0], "SetSelectable") == 0)
		SetSelectable(params[1]);
	
	FreeParameters(params, 1);
}

void cPerlOsdItem::SetSelectable(const char *Opts)
{
	char **params = SplitParameters(Opts, 1);

	cOsdItem::SetSelectable(*params[0] == '1');
	
	FreeParameters(params, 1);
}
