/*$cb
 *    This file is a part of OpenMHP VDR plugin.
 *
 *    Copyright (C) 2005 Mikko Novaro <miknov@gmail.com>
 *
 *    See README file for licensing and contact information.
 $ce*/

#ifndef _OSD_H_
#define _OSD_H_

#include <vdr/plugin.h>
#include "libopenmhp/openmhp.h"
#include "semaphore.h"
#include <sys/types.h>
#include <sys/sem.h>
#include <sys/ipc.h>
#include "xletthread.h"
// #include "openmhp.h"

class cPluginOpenmhp;

class cOpenmhpOsd : public cOsdObject, public cXletEventObserver {
 private:
  cOsd *osd;
  cXlet *xlet;
  cXletThread *xletthread;
  cPluginOpenmhp *openmhp;
  cBitmap *imgbuff;
  cSemaphore *sem;
  // cMutex *mutex;
  int bitdepth;
  // Number of possible values for each of the four color components (ARGB):
  int valuesPerColorComp;
  double scale;
  int scaledHeight;
  int scaledWidth;
  int xOffset;
  int yOffset;
  int vidWinX1, vidWinY1, vidWinX2, vidWinY2;

 public:
  cOpenmhpOsd(cPluginOpenmhp *OPENMHP, cXlet *xlt);
  ~cOpenmhpOsd(void);
  virtual void Show(void);
  virtual eOSState ProcessKey(eKeys Key);

  // cXletEventObserver function
  virtual void EventReceived(eEventType type, const cXletEvent *event);
};

#endif
