Remove mouse pointer related event handling.
[SDL.s60v3.git] / symbian / include / internal / dsa.h
blobcebebaffdf9b8e480f9fc8fc1c05316dbba26782
1 #ifndef __DSA_H__
2 #define __DSA_H__
4 #include <e32base.h>
5 #include <w32std.h>
6 #include "epoc_sdl.h"
7 #include "sdlepocapi.h"
9 class CDsa;
11 typedef void (*TCopyFunction)(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen);
13 NONSHARABLE_CLASS(CDsa) : public CBase
15 public:
16 enum
18 ELastDsaRequest = EpocSdlEnv::ELastService,
21 inline TBool IsDsaAvailable() const;
23 static CDsa* CreateL(RWsSession& aSession);
25 ~CDsa();
27 TUint8* LockHwSurface();
28 TInt AllocSurface(const TSize& aSize, TDisplayMode aMode);
29 inline TDisplayMode DisplayMode() const;
31 TInt SetPalette(TInt aFirst, TInt aCount, TUint32* aPalette);
32 void LockPalette(TBool aLock);
33 TBool AddUpdateRect(const TUint8* aBits, const TRect& aUpdateRect, const TRect& aRect);
34 void UpdateSwSurface();
35 TSize WindowSize() const;
36 void SetSuspend();
39 TBool Stopped() const;
40 RWsSession& Session();
41 RWindow* Window();
42 CDsa* CreateGlesDsaL();
44 void DoStop();
46 virtual void Free();
48 virtual void ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice);
49 virtual void SetUpdating(TBool aUpdate);
51 virtual TUint8* LockSurface() = 0;
52 virtual void UnlockHwSurface() = 0;
53 virtual void Resume() = 0;
54 virtual void Stop();
55 virtual void DoBlt(CFbsBitmap& aBmp);
57 bool m_updateWholeScreen;
59 protected:
61 inline const TSize& SwSize() const;
62 inline const TRect& HwRect() const;
64 inline const TRect& ScreenRect() const;
66 CDsa(RWsSession& aSession);
67 void SetTargetRect();
68 void Start();
70 enum
72 ERunning = 0x1,
73 EUpdating = 0x2,
74 EPaletteLocked = 0x4,
75 EUsePalette = 0x8,
76 ESdlThreadSuspend = 0x100,
77 ESdlThreadExplicitStop = 0x200
80 private:
81 virtual void CreateSurfaceL() = 0;
83 void ClipCopy(TUint8* aTarget, const TUint8* aSource, const TRect& aUpdateRect, const TRect& aSourceRect) const;
84 static void Copy256(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt);
85 static void CopySlow(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt);
86 static void CopyMem(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt);
88 void SetCopyFunction();
90 TInt iStateFlags;
91 RWsSession& iSession;
92 TRect iScreenRect;
94 TInt iTargetBpp;
95 TInt iSourceBpp;
96 TDisplayMode iSourceMode;
97 TDisplayMode iTargetMode;
98 TUint32* iLut256;
99 TCopyFunction iCopyFunction;
100 TUint8* iTargetAddr;
101 TCopyFunction iCFTable[3];
102 TInt iNewFlags;
103 TSize iSwSize;
104 TRect iTargetRect;
105 RWindow* iWindow;
106 friend class TDsa;
109 inline TDisplayMode CDsa::DisplayMode() const
111 return iTargetMode;
114 inline const TRect& CDsa::HwRect() const
116 return iTargetRect;
119 inline const TSize& CDsa::SwSize() const
121 return iSwSize;
124 inline TBool CDsa::IsDsaAvailable() const
126 return iStateFlags & ERunning;
129 inline const TRect& CDsa::ScreenRect() const
131 return iScreenRect;
134 #endif