#ifndef QGRAPHICIMAGE256_H
#define QGRAPHICIMAGE256_H

#include <QGraphicsScene>
#include <QGraphicsObject>
#include <QImage>
#include <QGraphicsSceneMouseEvent>

class RdrGraphicsScene: public QGraphicsScene
{
  Q_OBJECT
public:
  RdrGraphicsScene(int w, int h);

  void* video_memory(void) const;

  void mouseMoveEvent(QGraphicsSceneMouseEvent* evn);
  void mousePressEvent(QGraphicsSceneMouseEvent *event);

  void setBg(bool);

  void ggUpdatePalet(unsigned long* pal);
  void ggUpdatePalet(unsigned int index, unsigned long c);

  QRect dbgDeltaPos() const;

  const QImage& getImage() const;

public Q_SLOTS:
  void ggUpdateImage();

  void saveSnapshot(const QString fname);

Q_SIGNALS:
  //void sigCursorX(int x);
  //void sigCursorY(int y);
  void sigCursorXY(int x, int y, Qt::KeyboardModifiers);

  void sigLeftClick(int x, int y);

private:
  class Implementation;
  Implementation& p_;
};


#endif // QGRAPHICIMAGE256_H
