3 #ifndef __SIMPLESERVER_H
\r
4 #define __SIMPLESERVER_H
\r
13 enum TPicoGameState {
\r
21 // needed for creating server thread.
\r
22 const TUint KPicoMaxHeapSize=0x00800000;
\r
24 // reasons for server panic
\r
29 EMainSchedulerError,
\r
37 // key config entry (touchpad areas)
\r
38 struct TPicoAreaConfigEntry {
\r
40 //unsigned long actions;
\r
43 struct TPicoKeyConfigEntry
\r
45 unsigned short keyCode;
\r
46 unsigned char scanCode;
\r
47 unsigned char flags; // lsb->msb: key_down, pulse_only, ?, ?, ?, ?, not_configurable, disabled
\r
48 TInt32 handle1; // for CancelCaptureKeyUpAndDowns()
\r
49 TInt32 handle2; // for CancelCaptureKey()
\r
54 //**********************************
\r
56 //**********************************
\r
57 //The server class; an active object.
\r
58 //Contains an instance of RServer; a handle to the kernel server representation which is used
\r
59 //to receive messages.
\r
61 class CPicoServServer : public CServer
\r
64 enum {EPriority=950};
\r
67 virtual CSharableSession *NewSessionL(const TVersion &aVersion) const;
\r
68 static TInt ThreadFunction(TAny* aStarted);
\r
70 CPicoServServer(TInt aPriority);
\r
76 //**********************************
\r
78 //**********************************
\r
79 //This class represents a session in the server.
\r
80 //CSession::Client() returns the client thread.
\r
81 //Functions are provided to respond appropriately to client messages.
\r
84 class CPicoServSession : public CSession
\r
87 // construct/destruct
\r
88 CPicoServSession(RThread &aClient, CPicoServServer * aServer);
\r
89 static CPicoServSession* NewL(RThread &aClient, CPicoServServer * aServer);
\r
91 virtual void ServiceL(const RMessage &aMessage);
\r
92 void DispatchMessageL(const RMessage &aMessage);
\r
94 // services available
\r
96 void changeConfig();
\r
101 // panic the client
\r
102 void PanicClient(TInt aPanic) const;
\r
103 // safewrite between client and server
\r
104 void Write(const TAny* aPtr,const TDesC8& aDes,TInt anOffset=0);
\r
106 //CPicoServServer *iPicoSvr;
\r
108 unsigned char *rom_data;
\r
113 //**********************************
\r
115 //**********************************
\r
117 // function to panic the server
\r
118 GLREF_C void PanicServer(TPicoServPanic aPanic);
\r
119 int saveLoadGame(int load, int sram=0);
\r
121 #endif // __SIMPLESERVER_H
\r