Replace vectorbuffer with std::queue.
[SDL.s60v3.git] / symbian / include / internal / epoc_sdl.h
blobe01aeee20fbac0d6c6daa9f92e77422e241d4cf0
1 #ifndef EPOCSDL_H
2 #define EPOCSDL_H
5 #include<e32def.h>
7 #include<e32std.h>
8 #include<gdi.h>
9 #include<w32std.h>
10 #include"SDL_config_symbian.h"
14 //#undef DEBUG_TRACE_ENABLED
15 #define TRACE_TO_FILE
16 #ifdef DEBUG_TRACE_ENABLED
17 #define SDL_TRACE(error_str) RDebug_Print(error_str, (void*) NULL)
18 #define SDL_TRACE1(error_str, param) RDebug_Print(error_str, (void*) (param))
19 #define SDL_MEM() SDL_TRACE1("Free memory=%d", Debug_AvailMem())
20 extern "C"
22 void RDebug_Print(char* error_str, void* param);
23 void RDebug_Print_b(char* error_str, void* param);
24 int Debug_AvailMem();
26 #else
27 #define SDL_TRACE(error_str)
28 #define SDL_TRACE1(error_str, param)
29 #define SDL_MEM()
30 #endif
32 #define PANIC(x) Panic(x, __LINE__)
33 #define PANIC_IF_ERROR(x) (x == KErrNone || Panic(x, __LINE__))
35 TInt Panic(TInt aErr, TInt aLine);
38 NONSHARABLE_CLASS(MEventQueue)
40 public:
41 virtual TInt Append(const TWsEvent& aEvent) = 0;
42 // virtual const TWsEvent& Top() = 0;
43 virtual TBool HasData() = 0;
44 // virtual TInt Shift() = 0;
45 virtual const TWsEvent Shift() = 0;
46 virtual void Lock() = 0;
47 virtual void Unlock() = 0;
51 //class CEikonEnv;
53 typedef void (*TSdlCleanupOperation) (TAny* aThis);
55 NONSHARABLE_CLASS(TSdlCleanupItem)
57 public:
58 TSdlCleanupItem(TSdlCleanupOperation aOperation, TAny* aItem);
59 public:
60 TSdlCleanupOperation iOperation;
61 TAny* iItem;
62 TThreadId iThread;
66 NONSHARABLE_CLASS(EpocSdlEnv)
68 public:
69 enum {EDisableKeyBlocking = 100, ELastService};
70 static void Request(TInt aService);
71 static MEventQueue& EventQueue();
72 static TSize WindowSize(const TSize& aRequestedSize);
73 static TSize WindowSize();
74 static TDisplayMode DisplayMode();
75 static TPointerCursorMode PointerMode();
76 static TBool Flags(TInt aFlag);
77 static TInt Argc();
78 static char** Argv();
79 static TBool IsDsaAvailable();
80 // static void Dsa(const TPoint& aPoint, const CFbsBitmap& aBmp);
81 static TInt AllocSwSurface(const TSize& aSize, TDisplayMode aMode);
82 static TInt AllocHwSurface(const TSize& aSize, TDisplayMode aMode);
83 static void UnlockHwSurface();
84 static TUint8* LockHwSurface();
85 static void UpdateSwSurface();
86 static TBool AddUpdateRect(TUint8* aAddress, const TRect& aUpdateRect, const TRect& aTargetRect);
87 static void PanicMain(TInt aErr);
88 static void PanicMain(const TDesC& aInfo, TInt aErr);
89 static void WaitDeviceChange();
90 static TInt SetPalette(TInt aFirstcolor, TInt aColorCount, TUint32* aPalette);
91 static void ObserverEvent(TInt aService, TInt aParam = 0);
92 static void WaitDsaAvailable();
93 static void LockPalette(TBool aLock);
94 static void Resume();
95 static void Suspend();
96 static TInt AppendCleanupItem(const TSdlCleanupItem& aItem);
97 static void RemoveCleanupItem(TAny* aItem);
98 static void CleanupItems();
99 static void SetWaitDsa();
100 static TPoint WindowCoordinates(const TPoint& aPoint);
101 static void FreeSurface();
102 static TInt ApplyGlesDsa();
103 static RWindow* Window();
104 // static TInt SetVolume(TInt aVolume);
105 // static TInt Volume();
106 // static TInt MaxVolume();
109 #endif