1 /* iPhone Open SDK - Free Open Source Anti-Apple SDK
2 * Copyright (C) 2008 Jay Freeman (saurik)
6 * Redistribution and use in source and binary
7 * forms, with or without modification, are permitted
8 * provided that the following conditions are met:
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
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.
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.
38 #ifndef GRAPHICSSERVICES_GRAPHICSSERVICS_H_
39 #define GRAPHICSSERVICES_GRAPHICSSERVICS_H_
41 #include <mach/port.h>
42 #import <CoreFoundation/CoreFoundation.h>
43 #include <CoreGraphics/CGGeometry.h>
44 #include <GraphicsServices/GSWindow.h>
51 /*0x00:13c*/ uint8_t x00
; // key
52 /*0x01:13d*/ uint8_t x01
;
53 /*0x02:13e*/ uint8_t x02
; // 2=no
54 /*0x03:13f*/ uint8_t x03
;
55 /*0x04:140*/ uint32_t x04
;
56 /*0x08:144*/ uint32_t x08
;
57 /*0x0c:148*/ CGPoint position
;
58 /*0x14:14c*/ uint32_t x14
;
61 struct GSEventRecord
{
62 /*0x00:08*/ uint32_t type
;
63 /*0x04:0c*/ uint32_t subType
;
64 /*0x08:10*/ CGPoint locationOnScreen
;
65 /*0x10:18*/ CGPoint locationInWindow
;
66 /*0x18:20*/ uint64_t timestamp
; //(GSCurrentEventTimestamp)
67 /*0x20:28*/ uint32_t zero
;
68 /*0x24:2c*/ uint32_t modifierFlags
;
69 /*0x28:30*/ uint16_t eventNumber
;
70 /*0x2a:32*/ uint16_t x2a
;
71 /*0x2c:34*/ uint32_t size
;
74 struct GSEventKeyInfo
{
75 /*0x30:38*/ uint32_t type
;
76 /*0x34:3c*/ uint16_t character
;
77 /*0x38:3e*/ uint16_t characterSet
;
78 /*0x3a:40*/ uint8_t keyRepeating
;
81 struct GSEventHandInfo
{
82 /*0x30:38:00:5c*/ uint32_t type
;
83 /*0x34:3c:04:60*/ uint16_t x34
;
84 /*0x38:3e:06:64*/ uint16_t x38
;
85 /*0x3a:40:08:68*/ CGPoint x3a
;
86 /*0x40:48:10:70*/ uint32_t x40
; //handInfoScale scales
89 struct GSEventRecordInfo
{
90 /*0x30:38:00:5c*/ struct GSEventHandInfo handInfo
;
91 /*0x44:4c:14:74*/ uint32_t x44
;
92 /*0x48:50:18:78*/ uint32_t x48
; //handInfoScale scales
93 /*0x4c:54:1c:7c*/ uint32_t x4c
;
94 /*0x50:58:20*/ uint8_t x50
;
95 /*0x51:59:21*/ uint8_t pathPositions
;
96 /*0x52:5a:22*/ uint16_t x52
;
97 /*0x54:5c:24*/ struct GSPathInfo pathInfo
[];
101 struct CFRuntimeBase base_;
102 struct GSEventRecord record_;
105 typedef struct __GSEvent
*GSEventRef
;
107 #define GSEventTypeKeyDown 0x000d
109 #define GSEventTypeAccelerometer 0x0017
110 #define GSEventTypeProximityStateChanged 0x0018
111 #define GSEventTypeDeviceOrientationChanged 0x0032
112 // 0x03c:loc_0018ac preferences
114 #define GSEventTypeMenuButtonDown 0x03e8
115 #define GSEventTypeMenuButtonUp 0x03e9
116 #define GSEventTypeRingerChanged0 0x03f4
117 #define GSEventTypeRingerChanged1 0x03f5
118 #define GSEventTypeLockDevice 0x03f6
119 #define GSEventTypeStatusBarMouseDown 0x03f7
120 #define GSEventTypeStatusBarMouseDragged 0x03f8
121 #define GSEventTypeStatusBarMouseUp 0x03f9
122 #define GSEventTypeLockButtonDown 0x03f2
123 #define GSEventTypeLockButtonUp 0x03f3
124 #define GSEventTypeHeadsetButtonDown 0x03fa
125 #define GSEventTypeHeadsetButtonUp 0x03fb
127 #define GSEventTypeVibrateForDuration 0x044c
128 #define GSEventTypeSetBacklightFactor 0x044e
129 #define GSEventTypeSetBacklightLevel 0x044f
131 #define GSEventTypeApplicationStarted 0x07d0
132 #define GSEventTypeAnotherApplicationFinishedLauncing 0x07d2
133 #define GSEventTypeApplicationTerminateWithStatus 0x07d3
134 #define GSEventTypeApplicationSuspended 0x07d4
135 // 0x07d5:loc_000550 internal url
136 // 0x07d6:loc_000a20 external url
137 #define GSEventTypeApplicationExited 0x07d7
138 #define GSEventTypeApplicationShowHideSettings 0x07d8
139 #define GSEventTypeQuitTopApplication 0x07d9
140 #define GSEventTypeOtherApplicationWillSuspend 0x07da
141 #define GSEventTypeApplicationSuspendedSettingsUpdated 0x07db
143 #define GSEventTypeResetIdleTimer 0x0898
144 #define GSEventTypeResetIdleDuration 0x0899
145 #define GSEventTypeDumpUIHierarchy 0x09c4
146 #define GSEventTypeDumpScreenContents 0x09c5
147 #define GSEventTypeProcessScriptEvent 0x0a8c
149 #define GSEventTypeMouse 0x0bb9
151 #define GSEventTypeAccessoryAvailabilityChanged 0x0fa0
152 #define GSEventTypeAccessoryKeyStateChanged 0x0fa1
153 #define GSEventTypeAccessory 0x0fa2
155 #define GSEventTypeOutOfLineDataRequest 0x1388
156 #define GSEventTypeUrgentMemoryWarning 0x1770
157 #define GSEventTypeOutOfLineDataResponse 0x10001
159 #define GSMouseEventTypeDown 0x1
160 #define GSMouseEventTypeDragged 0x2
161 #define GSMouseEventTypeUp 0x6
162 #define GSMouseEventTypeCancel 0x8
164 #define _PurpleSystemEventPortName "PurpleSystemEventPort"
166 struct GSEventHandInfo
GSEventGetHandInfo(GSEventRef event
);
167 mach_port_name_t
GSCopyPurpleSystemEventPort(void);
168 mach_port_name_t
GSGetPurpleNamedPort(CFStringRef name
);
169 uint64_t GSCurrentEventTimestamp(void);
170 void GSSendSystemEvent(struct GSEventRecord
*record
);
171 void GSSendEvent(struct GSEventRecord
*record
, mach_port_name_t port
);
172 struct GSPathInfo
GSEventGetPathInfoAtIndex(GSEventRef event
, unsigned index
);
174 CFArrayRef
GSSystemGetCapability(CFStringRef type
);
175 extern CFStringRef
const kGSDisplayIdentifiersCapability
;
181 #endif//GRAPHICSSERVICES_GRAPHICSSERVICS_H_