#ifndef __PILOTSHELL_H__
#define __PILOTSHELL_H__

#include <qlabel.h>
#include "main.h"
#include "shared.h"

class PilotShell : public QLabel
{
    Q_OBJECT

public:
    PilotShell( shared_img *s, Pilot *p,
	    QWidget *parent=0, const char *name=0);

protected:
    void focusInEvent( QFocusEvent * );
    void focusOutEvent( QFocusEvent * );
    void mousePressEvent( QMouseEvent * );
    void mouseMoveEvent( QMouseEvent * );
    void mouseReleaseEvent( QMouseEvent * );
    void keyPressEvent( QKeyEvent * );

private slots:
    void tickLCD();

private:
    void penEvent(int down, const QPoint &);
    void clearLCD();
    void updateLCD(unsigned char *);
    void ringBell(int, int, int);

    shared_img *shptr;
    Pilot *pilot;
    QColor greys[14];
    QRect lcd, digitizer;
    int lcdcleared;
    QRegion key[7];
    int curkeydown;
    QTimer *lcdtimer;
    int running;
};

#endif
