Drop yet anoter symbian crap.
[SDL.s60v3.git] / symbian / include / internal / epoc_sdl.h
blob7222f916caaae31785b05954b36eeb1ada0e84d4
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 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 class TSdlCleanupItem
32 public:
33 TSdlCleanupItem(TSdlCleanupOperation aOperation, TAny* aItem);
34 TSdlCleanupOperation iOperation;
35 TAny* iItem;
36 TThreadId iThread;
39 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 Resume();
65 static void Suspend();
66 static TInt AppendCleanupItem(const TSdlCleanupItem& aItem);
67 static void RemoveCleanupItem(TAny* aItem);
68 static void CleanupItems();
69 static void SetWaitDsa();
70 static void FreeSurface();
71 static TInt ApplyGlesDsa();
72 static RWindow* Window();
73 static void UpdateWholeScreen(bool val);
74 static bool GetUpdateWholeScreen();
75 static void SetOrientation(CAknAppUi::TAppUiOrientation orientation, const TSize& aSize, TDisplayMode aMode);
76 };
78 #endif