Remove observer support.
[SDL.s60v3.git] / symbian / include / internal / sdls60api.h
blob15af11746691366745187e3abc9283d765d90fa1
1 #ifndef EPOC_SDL_H
2 #define EPOC_SDL_H
4 #include<e32std.h>
6 class CDesC8Array;
7 class TWsEvent;
8 class RWindow;
9 class CAknAppUi;
10 class RWsSession;
11 class CWsScreenDevice;
12 class CBitmapContext;
13 class CFbsBitmap;
15 //internal stuff
16 extern "C"
18 typedef int (*mainfunc1) ();
19 typedef int (*mainfunc2) (int argc, char* argv[]);
20 typedef int (*mainfunc3) (int argc, char* argv[], char* env[]);
21 typedef void (*mainfunc4) ();
22 typedef void (*mainfunc5) (int argc, char* argv[]);
23 typedef void (*mainfunc6) (int argc, char* argv[], char* env[]);
26 //internal stuff
27 extern "C"
29 int SDL_main (int argc, char* argv[]);
32 //internal stuff
33 class TMainFunc
35 public:
36 TMainFunc();
37 TMainFunc(mainfunc1);
38 TMainFunc(mainfunc2);
39 TMainFunc(mainfunc3);
40 TMainFunc(mainfunc4);
41 TMainFunc(mainfunc5);
42 TMainFunc(mainfunc6);
43 const void* operator[](TInt aIndex) const;
45 private:
46 void* iMainFunc[6];
50 class SDL
52 public:
53 enum TFlags //these flags set SDL modes
55 ENoFlags = 0x0,
56 EEnableFocusStop = 0x1, //let SDL thread to be stopped if not on top
59 static TInt Init(TInt aFlags = SDL::ENoFlags);
60 static TInt UnInit();
61 static MSDLObserver* Observer(); //get current observer
62 static void SetObserver(MSDLObserver* aObserver); //set observer to receive events, if NULL then observer is removed
63 static void SetContainerWindowL(RWindow& aWindow, RWsSession& aSession, CWsScreenDevice& aDevice); //the window where drawn happens, should be recalled (propably in application HandleResourceChange) if screen device changes
64 static TInt AppendWsEvent(const TWsEvent& aEvent); //give event to SDL, return error code if event buffer is full (insert in application HandleWsEvent)
65 static TInt GetSDLCode(TInt aScanCode); //get SDL internal key code bind to given scancode, return -1 if scancode is not found, aScancode must be postive number
66 static TInt SetSDLCode(TInt aScanCode, TInt aSDLCode); //set internal SDL code with given key code, return replaced code
67 static TInt SDLCodesCount(); //return count of scancodes
68 static void ResetSDLCodes(); //rest all code replacement to their initial values
69 static void Suspend();
70 static void Resume();
71 inline static void CallMainL(); //call SDL main() function
72 inline static void CallMainL(const CDesC8Array& iArg); //call SDL main(int argc, char* argv[]) function with given parameters
73 void static CallMainL(const TMainFunc& aFunc, const CDesC8Array* const iArg); //internal
75 protected:
76 SDL();
80 inline void SDL::CallMainL()
82 CallMainL(TMainFunc(SDL_main), NULL);
85 inline void SDL::CallMainL(const CDesC8Array& iArg)
87 CallMainL(TMainFunc(SDL_main), &iArg);
90 #endif