00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #if !defined(__WSPRITE2_H__)
00019 #define __WSPRITE2_H__
00020
00021
00022
00023 class CWsRedrawer;
00024 class CWindow;
00025
00026
00028
00030
00031 class CWsClient : public CActive
00032 {
00033 public:
00034 void ConstructL();
00035
00036 ~CWsClient();
00037
00038 virtual void ConstructMainWindowL();
00039
00040 void Exit();
00041
00042 void IssueRequest();
00043 void DoCancel();
00044 virtual void RunL() = 0;
00045 virtual void HandleKeyEventL (TKeyEvent& aKeyEvent) = 0;
00046 protected:
00047
00048 CWsClient();
00049 CWsScreenDevice* iScreen;
00050 CWsRedrawer* iRedrawer;
00051 RWsSession iWs;
00052 TWsEvent iWsEvent;
00053 private:
00054 RWindowGroup iGroup;
00055 CWindowGc* iGc;
00056 friend class CWsRedrawer;
00057 friend class CWindow;
00058 friend class CSprite;
00059 friend class CPointerCursor;
00060 };
00061
00062
00063
00065
00067
00068 class CWsRedrawer : public CActive
00069 {
00070 public:
00071
00072 CWsRedrawer();
00073 void ConstructL(CWsClient* aClient);
00074 ~CWsRedrawer();
00075
00076 void IssueRequest();
00077 void DoCancel();
00078 void RunL();
00079 protected:
00080 CWsClient* iClient;
00081 };
00082
00083
00085
00087
00088 class CWindow : public CBase
00089 {
00090 protected:
00091 RWindow iWindow;
00092 TRect iRect;
00093 public:
00094 enum {KPointerMoveBufferSize=32};
00095 CWindow(CWsClient* aClient);
00096 void ConstructL (const TRect& aRect, const TRgb& aColor, CWindow* aParent=0);
00097 ~CWindow();
00098
00099 RWindow& Window();
00100 CWindowGc* SystemGc();
00101 CWsScreenDevice* Screen();
00102 CFont* Font();
00103
00104 virtual void Draw(const TRect& aRect) = 0;
00105 virtual void HandlePointerEvent (TPointerEvent& aPointerEvent) = 0;
00106 private:
00107 CWsClient* iClient;
00108 CFont* iFont;
00109 };
00110
00111 #endif