sl@8: // sl@8: // sl@8: // sl@8: sl@8: #ifndef DISPLAY_H sl@8: #define DISPLAY_H sl@8: sl@17: sl@15: #include "HidDevice.h" sl@12: const int KMaxDisplayStringLength = 256; sl@12: sl@8: /** sl@8: Define an interface to some basic display functionality sl@8: */ sl@15: class DisplayBase: public HidDevice sl@8: { sl@8: public: sl@13: DisplayBase():iRequest(EMiniDisplayRequestNone),iPowerOn(false) sl@13: { sl@13: iDeviceId[0]=0; sl@13: iFirmwareRevision[0]=0; sl@13: } sl@13: sl@10: virtual ~DisplayBase(){}; sl@10: // sl@9: virtual int Open()=0; sl@9: virtual void Close()=0; sl@9: // sl@8: virtual int MinBrightness() const=0; sl@8: virtual int MaxBrightness() const=0; sl@8: virtual void SetBrightness(int aBrightness)=0; sl@8: virtual void Clear()=0; sl@10: virtual void Fill()=0; sl@10: // sl@10: virtual void SwapBuffers()=0; sl@11: sl@11: //Request management sl@11: virtual void Request(TMiniDisplayRequest /*aRequest*/){ /*No request supported by default*/ }; sl@11: virtual TMiniDisplayRequest AttemptRequestCompletion()=0; sl@11: sl@11: virtual TMiniDisplayRequest CurrentRequest(){return iRequest;} sl@11: virtual void CancelRequest(){iRequest=EMiniDisplayRequestNone;} sl@11: virtual bool RequestPending(){return iRequest!=EMiniDisplayRequestNone;} sl@11: sl@16: virtual bool IsPowerOn() {return iPowerOn;} sl@12: virtual char* DeviceId() {return iDeviceId;} sl@12: virtual char* FirmwareRevision() {return iFirmwareRevision;} sl@12: sl@16: virtual void TurnPowerOn(){} sl@16: virtual void TurnPowerOff(){} sl@17: virtual bool SupportPowerOnOff(){return false;} sl@17: sl@17: virtual void ShowClock(){} sl@17: virtual void HideClock(){} sl@17: virtual bool SupportClock(){return false;} sl@16: sl@11: protected: sl@11: void SetRequest(TMiniDisplayRequest aRequest) { iRequest=aRequest; } sl@11: sl@12: protected: sl@12: char iDeviceId[KMaxDisplayStringLength]; sl@12: char iFirmwareRevision[KMaxDisplayStringLength]; sl@12: bool iPowerOn; sl@12: sl@12: sl@11: private: sl@11: TMiniDisplayRequest iRequest; sl@8: }; sl@8: sl@8: sl@8: /** sl@8: */ sl@8: class GraphicDisplay : public DisplayBase sl@8: { sl@8: public: sl@8: virtual int WidthInPixels() const=0; sl@8: virtual int HeightInPixels() const=0; sl@22: virtual void SetPixel(unsigned char aX, unsigned char aY, unsigned int aPixel)=0; sl@8: virtual void SetAllPixels(unsigned char aOn)=0; sl@8: virtual int FrameBufferSizeInBytes() const=0; sl@8: //virtual int BitBlit(unsigned char* aSrc, unsigned char aSrcWidth, unsigned char aSrcHeight, unsigned char aTargetX, unsigned char aTargetY) const=0; sl@8: sl@8: }; sl@8: sl@8: sl@8: sl@8: #endif