From b7c67494d3ab5a12a58094f70f6bda10925d870f Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 12 Jul 2009 22:02:59 +0000 Subject: [PATCH] Updated GraphicsServices. --- GraphicsServices/GSEvent.h | 48 ++++++++++---------- GraphicsServices/GraphicsServices.h | 70 +++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 23 deletions(-) create mode 100644 GraphicsServices/GraphicsServices.h diff --git a/GraphicsServices/GSEvent.h b/GraphicsServices/GSEvent.h index 19ac32a..e3fa54e 100644 --- a/GraphicsServices/GSEvent.h +++ b/GraphicsServices/GSEvent.h @@ -1,5 +1,5 @@ /* iPhone Open SDK - Free Open Source Anti-Apple SDK - * Copyright (C) 2008 Jay Freeman (saurik) + * Copyright (C) 2008-2009 Jay Freeman (saurik) */ /* @@ -39,12 +39,8 @@ #define GRAPHICSSERVICES_GSEVENT_H_ #include -#import #include -#include -#include - #ifdef __cplusplus extern "C" { #endif @@ -65,19 +61,23 @@ struct GSEventRecord { /*0x04:0c*/ uint32_t subType; /*0x08:10*/ CGPoint locationOnScreen; /*0x10:18*/ CGPoint locationInWindow; - /*0x18:20*/ uint64_t timestamp; //(GSCurrentEventTimestamp) - /*0x20:28*/ uint32_t zero; - /*0x24:2c*/ uint32_t modifierFlags; - /*0x28:30*/ uint16_t eventNumber; - /*0x2a:32*/ uint16_t x2a; - /*0x2c:34*/ uint32_t size; +#if 1 + /*0x18:20*/ uint32_t windowContextId; /*3*/ +#endif + /*0x1c:24*/ uint64_t timestamp; //(GSCurrentEventTimestamp) + /*0x24:2c*/ uint32_t zero; + /*0x28:30*/ uint32_t modifierFlags; + /*0x2c:34*/ uint16_t eventNumber; + /*0x2e:36*/ uint16_t x2a; + /*0x30:38*/ uint32_t size; }; -struct GSEventKeyInfo { +struct __attribute__((__packed__)) GSEventKeyInfo { /*0x30:38*/ uint32_t type; /*0x34:3c*/ uint16_t character; /*0x38:3e*/ uint16_t characterSet; /*0x3a:40*/ uint8_t keyRepeating; + /*0x3b:41*/ uint8_t unknown; }; struct GSEventHandInfo { @@ -121,14 +121,18 @@ typedef struct __GSEvent *GSEventRef; #define GSEventTypeMenuButtonDown 0x03e8 #define GSEventTypeMenuButtonUp 0x03e9 +#define GSEventTypeVolumeUpButtonDown 0x03ee /*3*/ +#define GSEventTypeVolumeUpButtonUp 0x03ef /*3*/ +#define GSEventTypeVolumeDownButtonDown 0x03f0 /*3*/ +#define GSEventTypeVolumeDownButtonUp 0x03f1 /*3*/ +#define GSEventTypeLockButtonDown 0x03f2 +#define GSEventTypeLockButtonUp 0x03f3 #define GSEventTypeRingerChanged0 0x03f4 #define GSEventTypeRingerChanged1 0x03f5 #define GSEventTypeLockDevice 0x03f6 #define GSEventTypeStatusBarMouseDown 0x03f7 #define GSEventTypeStatusBarMouseDragged 0x03f8 #define GSEventTypeStatusBarMouseUp 0x03f9 -#define GSEventTypeLockButtonDown 0x03f2 -#define GSEventTypeLockButtonUp 0x03f3 #define GSEventTypeHeadsetButtonDown 0x03fa #define GSEventTypeHeadsetButtonUp 0x03fb @@ -137,6 +141,7 @@ typedef struct __GSEvent *GSEventRef; #define GSEventTypeSetBacklightLevel 0x044f #define GSEventTypeApplicationStarted 0x07d0 +// 0x07d1 <- while SpringBoard is starting #define GSEventTypeAnotherApplicationFinishedLauncing 0x07d2 #define GSEventTypeApplicationTerminateWithStatus 0x07d3 #define GSEventTypeApplicationSuspended 0x07d4 @@ -169,22 +174,19 @@ typedef struct __GSEvent *GSEventRef; #define GSMouseEventTypeUp 0x6 #define GSMouseEventTypeCancel 0x8 -#define _PurpleSystemEventPortName "PurpleSystemEventPort" - -float GSDefaultStatusBarHeight(void); -//GSColorRef GSColorForSystemColor(unsigned color); -mach_port_name_t GSCopyPurpleSystemEventPort(void); uint64_t GSCurrentEventTimestamp(void); struct GSEventHandInfo GSEventGetHandInfo(GSEventRef event); struct CGRect GSEventGetLocationInWindow(GSEventRef event); struct GSPathInfo GSEventGetPathInfoAtIndex(GSEventRef event, unsigned index); -mach_port_name_t GSGetPurpleNamedPort(CFStringRef name); void GSSendEvent(struct GSEventRecord *record, mach_port_name_t port); void GSSendSystemEvent(struct GSEventRecord *record); struct GSEventRecord *_GSEventGetGSEventRecord(GSEventRef event); - -CFArrayRef GSSystemGetCapability(CFStringRef type); -extern CFStringRef const kGSDisplayIdentifiersCapability; +//GSEventCreateWithTypeAndLocation(); /*3*/ +GSEventRef GSEventCreateWithEventRecord(struct GSEventRecord *record); /*3*/ +CFTypeID GSEventGetTypeID(void); +CFPropertyListRef GSEventCreatePlistRepresentation(GSEventRef event); +GSEventRef _GSCreateSyntheticKeyEvent(UniChar key, BOOL up, BOOL repeating); +void _GSPostSyntheticKeyEvent(CFStringRef keys, BOOL up, BOOL repeating); #ifdef __cplusplus } diff --git a/GraphicsServices/GraphicsServices.h b/GraphicsServices/GraphicsServices.h new file mode 100644 index 0000000..4123f24 --- /dev/null +++ b/GraphicsServices/GraphicsServices.h @@ -0,0 +1,70 @@ +/* iPhone Open SDK - Free Open Source Anti-Apple SDK + * Copyright (C) 2008-2009 Jay Freeman (saurik) +*/ + +/* + * Redistribution and use in source and binary + * forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the + * above copyright notice, this list of conditions + * and the following disclaimer. + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions + * and the following disclaimer in the documentation + * and/or other materials provided with the + * distribution. + * 3. The name of the author may not be used to endorse + * or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef GRAPHICSSERVICES_GRAPHICSSERVICS_H_ +#define GRAPHICSSERVICES_GRAPHICSSERVICS_H_ + +#include +#import + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define _PurpleSystemEventPortName "PurpleSystemEventPort" + +float GSDefaultStatusBarHeight(void); +//GSColorRef GSColorForSystemColor(unsigned color); +#if 1 +mach_port_name_t GSGetPurpleSystemEventPort(void); +#else +mach_port_name_t GSCopyPurpleSystemEventPort(void); +#endif +mach_port_name_t GSGetPurpleNamedPort(CFStringRef name); + +CFArrayRef GSSystemGetCapability(CFStringRef type); +extern CFStringRef const kGSDisplayIdentifiersCapability; + +#ifdef __cplusplus +} +#endif + +#endif//GRAPHICSSERVICES_GRAPHICSSERVICS_H_ -- 2.45.2