v1.1.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
abi/events.h
1 /* -*- mode: C; c-basic-offset: 4; intent-tabs-mode: nil -*-
2  *
3  * Sifteo SDK
4  *
5  * Copyright <c> 2012 Sifteo, Inc.
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23  * THE SOFTWARE.
24  */
25 
26 #ifndef _SIFTEO_ABI_EVENTS_H
27 #define _SIFTEO_ABI_EVENTS_H
28 
29 #include <sifteo/abi/types.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 
36 /*
37  * Event vectors. These can be changed at runtime in order to handle
38  * events within the game binary, via _SYS_setVector / _SYS_getVector.
39  */
40 
41 typedef void (*_SYSCubeEvent)(void *context, _SYSCubeID cid);
42 typedef void (*_SYSNeighborEvent)(void *context,
43  _SYSCubeID c0, _SYSSideID s0, _SYSCubeID c1, _SYSSideID s1);
44 
45 typedef enum {
46  _SYS_NEIGHBOR_ADD = 0,
47  _SYS_NEIGHBOR_REMOVE,
48  _SYS_CUBE_CONNECT,
49  _SYS_CUBE_DISCONNECT,
50  _SYS_CUBE_ASSETDONE,
51  _SYS_CUBE_TOUCH,
52  _SYS_BASE_BT_CONNECT,
53  _SYS_BASE_BT_DISCONNECT,
54  _SYS_CUBE_ACCELCHANGE,
55  _SYS_BASE_TRACKER,
56  _SYS_CUBE_BATTERY,
57  _SYS_CUBE_REFRESH,
58  _SYS_BASE_GAME_MENU,
59  _SYS_BASE_VOLUME_DELETE,
60  _SYS_BASE_VOLUME_COMMIT,
61  _SYS_BASE_BT_READ_AVAILABLE,
62  _SYS_BASE_BT_WRITE_AVAILABLE,
63  _SYS_BASE_USB_CONNECT,
64  _SYS_BASE_USB_DISCONNECT,
65  _SYS_BASE_USB_READ_AVAILABLE,
66  _SYS_BASE_USB_WRITE_AVAILABLE,
67 
68  _SYS_NUM_VECTORS, // Must be last
69 } _SYSVectorID;
70 
71 
72 #ifdef __cplusplus
73 } // extern "C"
74 #endif
75 
76 #endif