]>
Commit | Line | Data |
---|---|---|
f8d8a1a9 | 1 | /* iPhone Open SDK - Free Open Source Anti-Apple SDK |
b7c67494 | 2 | * Copyright (C) 2008-2009 Jay Freeman (saurik) |
f8d8a1a9 JF |
3 | */ |
4 | ||
5 | /* | |
6 | * Redistribution and use in source and binary | |
7 | * forms, with or without modification, are permitted | |
8 | * provided that the following conditions are met: | |
9 | * | |
10 | * 1. Redistributions of source code must retain the | |
11 | * above copyright notice, this list of conditions | |
12 | * and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the | |
14 | * above copyright notice, this list of conditions | |
15 | * and the following disclaimer in the documentation | |
16 | * and/or other materials provided with the | |
17 | * distribution. | |
18 | * 3. The name of the author may not be used to endorse | |
19 | * or promote products derived from this software | |
20 | * without specific prior written permission. | |
21 | * | |
22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' | |
23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | |
24 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
25 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE | |
27 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
28 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
29 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |
32 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | |
33 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | |
34 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
35 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
36 | */ | |
37 | ||
0ec5695f JF |
38 | #ifndef GRAPHICSSERVICES_GSEVENT_H_ |
39 | #define GRAPHICSSERVICES_GSEVENT_H_ | |
f8d8a1a9 | 40 | |
16edd6ae | 41 | #include <objc/objc.h> |
f8d8a1a9 JF |
42 | #include <mach/port.h> |
43 | #include <CoreGraphics/CGGeometry.h> | |
44 | ||
45 | #ifdef __cplusplus | |
46 | extern "C" { | |
47 | #endif | |
48 | ||
49 | struct GSPathInfo { | |
a5486f1d JF |
50 | /*0x00:13c*/ uint8_t x00; // key |
51 | /*0x01:13d*/ uint8_t x01; | |
52 | /*0x02:13e*/ uint8_t x02; // 2=no | |
53 | /*0x03:13f*/ uint8_t x03; | |
54 | /*0x04:140*/ uint32_t x04; | |
55 | /*0x08:144*/ uint32_t x08; | |
56 | /*0x0c:148*/ CGPoint position; | |
57 | /*0x14:14c*/ uint32_t x14; | |
f8d8a1a9 JF |
58 | }; |
59 | ||
ed2bc294 JF |
60 | /* |
61 | Oct 4 11:19:07 iPod-touch MobileNotes[457]: [data] 0x020: 00 00 01 00 04 02 01 00 00 00 00 00 e0 28 ec 40 .............(.@ | |
62 | Oct 4 11:19:07 iPod-touch MobileNotes[457]: [data] 0x030: 00 80 05 43 00 80 98 43 70 4f 1b 00 ...C...CpO.. | |
63 | */ | |
64 | ||
f8d8a1a9 JF |
65 | struct GSEventRecord { |
66 | /*0x00:08*/ uint32_t type; | |
67 | /*0x04:0c*/ uint32_t subType; | |
68 | /*0x08:10*/ CGPoint locationOnScreen; | |
69 | /*0x10:18*/ CGPoint locationInWindow; | |
b7c67494 JF |
70 | #if 1 |
71 | /*0x18:20*/ uint32_t windowContextId; /*3*/ | |
72 | #endif | |
73 | /*0x1c:24*/ uint64_t timestamp; //(GSCurrentEventTimestamp) | |
ed2bc294 JF |
74 | |
75 | /*0x24:2c*/ uint32_t zero; //0x1b4f70 | |
76 | /*0x28:30*/ uint32_t modifierFlags; //0x0 | |
77 | ||
78 | /*0x2c:34*/ uint16_t eventNumber; //0x1bb | |
79 | /*0x2e:36*/ uint16_t x2a; //0x0 | |
80 | ||
b7c67494 | 81 | /*0x30:38*/ uint32_t size; |
f8d8a1a9 JF |
82 | }; |
83 | ||
ed2bc294 JF |
84 | /* |
85 | Oct 4 11:19:07 iPod-touch MobileNotes[457]: [rcrd] 0x000: b9 0b 00 00 00 00 00 00 00 80 05 43 00 80 98 43 ...........C...C | |
86 | Oct 4 11:19:07 iPod-touch MobileNotes[457]: [rcrd] 0x010: 00 80 05 43 00 80 98 43 00 00 00 00 c9 c4 24 48 ...C...C......$H | |
87 | Oct 4 11:19:07 iPod-touch MobileNotes[457]: [rcrd] 0x020: 90 01 00 00 <> 70 4f 1b 00 00 00 00 00 bb 01 00 00 ....pO.......... | |
88 | Oct 4 11:19:07 iPod-touch MobileNotes[457]: [rcrd] 0x030: 3c 00 00 00 <... | |
89 | */ | |
90 | ||
b7c67494 | 91 | struct __attribute__((__packed__)) GSEventKeyInfo { |
a5486f1d JF |
92 | /*0x30:38*/ uint32_t type; |
93 | /*0x34:3c*/ uint16_t character; | |
94 | /*0x38:3e*/ uint16_t characterSet; | |
95 | /*0x3a:40*/ uint8_t keyRepeating; | |
b7c67494 | 96 | /*0x3b:41*/ uint8_t unknown; |
a5486f1d JF |
97 | }; |
98 | ||
f8d8a1a9 JF |
99 | struct GSEventHandInfo { |
100 | /*0x30:38:00:5c*/ uint32_t type; | |
101 | /*0x34:3c:04:60*/ uint16_t x34; | |
102 | /*0x38:3e:06:64*/ uint16_t x38; | |
103 | /*0x3a:40:08:68*/ CGPoint x3a; | |
104 | /*0x40:48:10:70*/ uint32_t x40; //handInfoScale scales | |
105 | }; | |
106 | ||
13db960d JF |
107 | struct GSEventApplicationInfo { |
108 | /*0x30:00*/ uint32_t pid; | |
109 | /*0x34:04*/ uint32_t x34; | |
110 | /*0x38:08*/ char name[]; | |
111 | }; | |
112 | ||
f8d8a1a9 JF |
113 | struct GSEventRecordInfo { |
114 | /*0x30:38:00:5c*/ struct GSEventHandInfo handInfo; | |
115 | /*0x44:4c:14:74*/ uint32_t x44; | |
116 | /*0x48:50:18:78*/ uint32_t x48; //handInfoScale scales | |
117 | /*0x4c:54:1c:7c*/ uint32_t x4c; | |
118 | /*0x50:58:20*/ uint8_t x50; | |
119 | /*0x51:59:21*/ uint8_t pathPositions; | |
120 | /*0x52:5a:22*/ uint16_t x52; | |
121 | /*0x54:5c:24*/ struct GSPathInfo pathInfo[]; | |
122 | }; | |
123 | ||
ed2bc294 JF |
124 | /* |
125 | Oct 4 11:19:07 iPod-touch MobileNotes[457]: [data] 0x000: 06 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................ | |
126 | Oct 4 11:19:07 iPod-touch MobileNotes[457]: [data] 0x010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | |
127 | Oct 4 11:19:07 iPod-touch MobileNotes[457]: [data] 0x020: 00 00 01 00 04 02 01 00 00 00 00 00 e0 28 ec 40 .............(.@ | |
128 | Oct 4 11:19:07 iPod-touch MobileNotes[457]: [data] 0x030: 00 80 05 43 00 80 98 43 70 4f 1b 00 ...C...CpO.. | |
129 | */ | |
130 | ||
f8d8a1a9 JF |
131 | /*struct __GSEvent { |
132 | struct CFRuntimeBase base_; | |
133 | struct GSEventRecord record_; | |
134 | };*/ | |
135 | ||
136 | typedef struct __GSEvent *GSEventRef; | |
137 | ||
138 | #define GSEventTypeKeyDown 0x000d | |
139 | ||
140 | #define GSEventTypeAccelerometer 0x0017 | |
141 | #define GSEventTypeProximityStateChanged 0x0018 | |
142 | #define GSEventTypeDeviceOrientationChanged 0x0032 | |
143 | // 0x03c:loc_0018ac preferences | |
144 | ||
145 | #define GSEventTypeMenuButtonDown 0x03e8 | |
146 | #define GSEventTypeMenuButtonUp 0x03e9 | |
b7c67494 JF |
147 | #define GSEventTypeVolumeUpButtonDown 0x03ee /*3*/ |
148 | #define GSEventTypeVolumeUpButtonUp 0x03ef /*3*/ | |
149 | #define GSEventTypeVolumeDownButtonDown 0x03f0 /*3*/ | |
150 | #define GSEventTypeVolumeDownButtonUp 0x03f1 /*3*/ | |
151 | #define GSEventTypeLockButtonDown 0x03f2 | |
152 | #define GSEventTypeLockButtonUp 0x03f3 | |
f8d8a1a9 JF |
153 | #define GSEventTypeRingerChanged0 0x03f4 |
154 | #define GSEventTypeRingerChanged1 0x03f5 | |
155 | #define GSEventTypeLockDevice 0x03f6 | |
156 | #define GSEventTypeStatusBarMouseDown 0x03f7 | |
157 | #define GSEventTypeStatusBarMouseDragged 0x03f8 | |
158 | #define GSEventTypeStatusBarMouseUp 0x03f9 | |
f8d8a1a9 JF |
159 | #define GSEventTypeHeadsetButtonDown 0x03fa |
160 | #define GSEventTypeHeadsetButtonUp 0x03fb | |
161 | ||
162 | #define GSEventTypeVibrateForDuration 0x044c | |
163 | #define GSEventTypeSetBacklightFactor 0x044e | |
164 | #define GSEventTypeSetBacklightLevel 0x044f | |
165 | ||
166 | #define GSEventTypeApplicationStarted 0x07d0 | |
b7c67494 | 167 | // 0x07d1 <- while SpringBoard is starting |
f8d8a1a9 JF |
168 | #define GSEventTypeAnotherApplicationFinishedLauncing 0x07d2 |
169 | #define GSEventTypeApplicationTerminateWithStatus 0x07d3 | |
170 | #define GSEventTypeApplicationSuspended 0x07d4 | |
171 | // 0x07d5:loc_000550 internal url | |
172 | // 0x07d6:loc_000a20 external url | |
173 | #define GSEventTypeApplicationExited 0x07d7 | |
174 | #define GSEventTypeApplicationShowHideSettings 0x07d8 | |
175 | #define GSEventTypeQuitTopApplication 0x07d9 | |
176 | #define GSEventTypeOtherApplicationWillSuspend 0x07da | |
177 | #define GSEventTypeApplicationSuspendedSettingsUpdated 0x07db | |
178 | ||
179 | #define GSEventTypeResetIdleTimer 0x0898 | |
180 | #define GSEventTypeResetIdleDuration 0x0899 | |
181 | #define GSEventTypeDumpUIHierarchy 0x09c4 | |
182 | #define GSEventTypeDumpScreenContents 0x09c5 | |
183 | #define GSEventTypeProcessScriptEvent 0x0a8c | |
184 | ||
185 | #define GSEventTypeMouse 0x0bb9 | |
186 | ||
187 | #define GSEventTypeAccessoryAvailabilityChanged 0x0fa0 | |
188 | #define GSEventTypeAccessoryKeyStateChanged 0x0fa1 | |
189 | #define GSEventTypeAccessory 0x0fa2 | |
190 | ||
191 | #define GSEventTypeOutOfLineDataRequest 0x1388 | |
192 | #define GSEventTypeUrgentMemoryWarning 0x1770 | |
193 | #define GSEventTypeOutOfLineDataResponse 0x10001 | |
194 | ||
195 | #define GSMouseEventTypeDown 0x1 | |
196 | #define GSMouseEventTypeDragged 0x2 | |
197 | #define GSMouseEventTypeUp 0x6 | |
198 | #define GSMouseEventTypeCancel 0x8 | |
199 | ||
f8d8a1a9 | 200 | uint64_t GSCurrentEventTimestamp(void); |
2cccff25 | 201 | struct GSEventHandInfo GSEventGetHandInfo(GSEventRef event); |
13db960d | 202 | struct CGRect GSEventGetLocationInWindow(GSEventRef event); |
dfbdd7ed | 203 | struct GSPathInfo GSEventGetPathInfoAtIndex(GSEventRef event, unsigned index); |
2cccff25 JF |
204 | void GSSendEvent(struct GSEventRecord *record, mach_port_name_t port); |
205 | void GSSendSystemEvent(struct GSEventRecord *record); | |
13db960d | 206 | struct GSEventRecord *_GSEventGetGSEventRecord(GSEventRef event); |
b7c67494 JF |
207 | //GSEventCreateWithTypeAndLocation(); /*3*/ |
208 | GSEventRef GSEventCreateWithEventRecord(struct GSEventRecord *record); /*3*/ | |
209 | CFTypeID GSEventGetTypeID(void); | |
210 | CFPropertyListRef GSEventCreatePlistRepresentation(GSEventRef event); | |
211 | GSEventRef _GSCreateSyntheticKeyEvent(UniChar key, BOOL up, BOOL repeating); | |
16edd6ae | 212 | GSEventRef GSCreateKeyEvent(UniChar key, BOOL up, BOOL repeating); |
b7c67494 | 213 | void _GSPostSyntheticKeyEvent(CFStringRef keys, BOOL up, BOOL repeating); |
0c18d7b2 | 214 | |
f8d8a1a9 JF |
215 | #ifdef __cplusplus |
216 | } | |
217 | #endif | |
218 | ||
0ec5695f | 219 | #endif//GRAPHICSSERVICES_GSEVENT_H_ |