• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2007 The Android Open Source Project
3  *
4  * Simulator interactions.
5  */
6 #ifndef _WRAPSIM_SIMULATOR_H
7 #define _WRAPSIM_SIMULATOR_H
8 
9 /*
10  * Commands exchanged between simulator and runtime.
11  *
12  * NOTE: this is cloned from SimRuntime.h -- fix this.
13  */
14 typedef enum SimCommand {
15     kCommandUnknown = 0,
16 
17     /* sent from sim to runtime */
18     kCommandGoAway,             // sim says: go away, I'm busy
19     kCommandConfigDone,         // sim says: done sending config
20     kCommandQuit,               // quit nicely
21     kCommandNewPGroup,          // process group management
22     kCommandKeyDown,            // key has been pressed
23     kCommandKeyUp,              // key has been released
24     kCommandTouch,              // finger touched/lifted/dragged
25 
26     /* sent from runtime to sim */
27     kCommandNewPGroupCreated,   // send process group as argument
28     kCommandRuntimeReady,       // we're initialized and about to start
29     kCommandUpdateDisplay,      // display has been updated
30     kCommandVibrate,            // vibrate on or off
31 } SimCommand;
32 
33 /*
34  * Touch screen action; also clined from SimRuntime.h.
35  */
36 typedef enum TouchMode {
37     kTouchDown = 0,
38     kTouchUp = 1,
39     kTouchDrag = 2
40 } TouchMode;
41 
42 
43 /*
44  * Some parameters for config exchange.
45  */
46 enum {
47     kDisplayConfigMagic = 0x44495350,
48     kValuesPerDisplay = 5,
49 };
50 
51 /*
52  * UNIX domain socket name.
53  */
54 #define kAndroidPipeName        "runtime"
55 
56 int wsSimConnect(void);
57 
58 /*
59  * Display management.
60  */
61 void wsLockDisplay(int displayIdx);
62 void wsUnlockDisplay(int displayIdx);
63 void wsPostDisplayUpdate(int displayIdx);
64 
65 /*
66  * Send a log message.
67  */
68 void wsPostLogMessage(int logPrio, const char* tag, const char* msg);
69 
70 /*
71  * Change the state of the vibration device.
72  */
73 void wsEnableVibration(int vibrateOn);
74 
75 #endif /*_WRAPSIM_SIMULATOR_H*/
76