Remove IMPORT_C / EXPORT_C.
[SDL.s60v3.git] / symbian / include / internal / sdls60api.h
blob65416b4e4056747e8b3858785559d8f90108098a
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];
49 class SDLObserver
51 public:
52 enum //these events indicates the state changes in SDL
54 EEventWindowReserved, //window is created, nothing else should use the window
55 EEventWindowNotAvailable, //window not available, can be ignored
56 EEventKeyMapInit, //Keymap is inited and can now be rewritten
58 virtual TInt SdlEvent(TInt aEvent, TInt aParam) = 0; //event is called in application thread
62 class SDL
64 public:
65 enum TFlags //these flags set SDL modes
67 ENoFlags = 0x0,
68 EEnableFocusStop = 0x1, //let SDL thread to be stopped if not on top
71 static TInt Init(TInt aFlags = SDL::ENoFlags);
72 static TInt UnInit();
73 static MSDLObserver* Observer(); //get current observer
74 static void SetObserver(MSDLObserver* aObserver); //set observer to receive events, if NULL then observer is removed
75 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
76 static TInt AppendWsEvent(const TWsEvent& aEvent); //give event to SDL, return error code if event buffer is full (insert in application HandleWsEvent)
77 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
78 static TInt SetSDLCode(TInt aScanCode, TInt aSDLCode); //set internal SDL code with given key code, return replaced code
79 static TInt SDLCodesCount(); //return count of scancodes
80 static void ResetSDLCodes(); //rest all code replacement to their initial values
81 static void Suspend();
82 static void Resume();
83 inline static void CallMainL(); //call SDL main() function
84 inline static void CallMainL(const CDesC8Array& iArg); //call SDL main(int argc, char* argv[]) function with given parameters
85 void static CallMainL(const TMainFunc& aFunc, const CDesC8Array* const iArg); //internal
87 protected:
88 SDL();
92 inline void SDL::CallMainL()
94 CallMainL(TMainFunc(SDL_main), NULL);
97 inline void SDL::CallMainL(const CDesC8Array& iArg)
99 CallMainL(TMainFunc(SDL_main), &iArg);
102 #endif