Cleanup.
[SDL.s60v3.git] / symbian / include / internal / epoc_sdl.h
blobfbcae192f54c25a15a7745b13ccf05566f63a8d6
1 #ifndef EPOCSDL_H
2 #define EPOCSDL_H
4 #include <e32def.h>
5 #include <e32std.h>
6 #include <gdi.h>
7 #include <w32std.h>
8 #include <aknappui.h>
9 #include "SDL_config_symbian.h"
11 #define PANIC(x) Panic(x, __LINE__)
12 #define PANIC_IF_ERROR(x) (x == KErrNone || Panic(x, __LINE__))
14 TInt Panic(TInt aErr, TInt aLine);
16 NONSHARABLE_CLASS(MEventQueue)
18 public:
19 virtual TInt Append(const TWsEvent& aEvent) = 0;
20 // virtual const TWsEvent& Top() = 0;
21 virtual TBool HasData() = 0;
22 // virtual TInt Shift() = 0;
23 virtual const TWsEvent Shift() = 0;
24 virtual void Lock() = 0;
25 virtual void Unlock() = 0;
28 typedef void (*TSdlCleanupOperation) (TAny* aThis);
30 NONSHARABLE_CLASS(TSdlCleanupItem)
32 public:
33 TSdlCleanupItem(TSdlCleanupOperation aOperation, TAny* aItem);
34 TSdlCleanupOperation iOperation;
35 TAny* iItem;
36 TThreadId iThread;
39 NONSHARABLE_CLASS(EpocSdlEnv)
41 public:
42 enum {ELastService=100};
43 static void Request(TInt aService);
44 static MEventQueue& EventQueue();
45 static TSize WindowSize(const TSize& aRequestedSize);
46 static TSize WindowSize();
47 static TDisplayMode DisplayMode();
48 static TPointerCursorMode PointerMode();
49 static TBool Flags(TInt aFlag);
50 static TInt Argc();
51 static char** Argv();
52 static TBool IsDsaAvailable();
53 static TInt AllocSurface(const TSize& aSize, TDisplayMode aMode);
54 static void UnlockHwSurface();
55 static TUint8* LockHwSurface();
56 static void UpdateSwSurface();
57 static TBool AddUpdateRect(TUint8* aAddress, const TRect& aUpdateRect, const TRect& aTargetRect);
58 static void PanicMain(TInt aErr);
59 static void PanicMain(const TDesC& aInfo, TInt aErr);
60 static void WaitDeviceChange();
61 static TInt SetPalette(TInt aFirstcolor, TInt aColorCount, TUint32* aPalette);
62 static void ObserverEvent(TInt aService, TInt aParam = 0);
63 static void WaitDsaAvailable();
64 static void LockPalette(TBool aLock);
65 static void Resume();
66 static void Suspend();
67 static TInt AppendCleanupItem(const TSdlCleanupItem& aItem);
68 static void RemoveCleanupItem(TAny* aItem);
69 static void CleanupItems();
70 static void SetWaitDsa();
71 static TPoint WindowCoordinates(const TPoint& aPoint);
72 static void FreeSurface();
73 static TInt ApplyGlesDsa();
74 static RWindow* Window();
75 static void UpdateWholeScreen(bool val);
76 static bool GetUpdateWholeScreen();
77 static void SetOrientation(CAknAppUi::TAppUiOrientation orientation, const TSize& aSize, TDisplayMode aMode);
78 };
80 #endif