From f22678fa39008974fda058dfd6b3242daa6a971e Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 26 Jan 2014 19:00:00 -0800 Subject: [PATCH] Carve out a new function for the IOHID input code. --- Tweak.mm | 13 +++++++++++++ .../CoreFoundation}/CFUserNotification.h | 0 2 files changed, 13 insertions(+) rename {CoreFoundation => include/CoreFoundation}/CFUserNotification.h (100%) diff --git a/Tweak.mm b/Tweak.mm index 0d49df7..807022f 100644 --- a/Tweak.mm +++ b/Tweak.mm @@ -428,6 +428,9 @@ struct VeencyEvent { } data; }; +static void VNCPointerOld(int buttons, int x, int y, CGPoint location, int diff, bool twas, bool tis); +static void VNCPointerNew(int buttons, int x, int y, CGPoint location, int diff, bool twas, bool tis); + static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) { if (ratio_ == 0) return; @@ -461,6 +464,13 @@ static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) { return; } + if (kCFCoreFoundationVersionNumber >= 800) + return VNCPointerNew(buttons, x, y, location, diff, twas, tis); + else + return VNCPointerOld(buttons, x, y, location, diff, twas, tis); +} + +static void VNCPointerOld(int buttons, int x, int y, CGPoint location, int diff, bool twas, bool tis) { mach_port_t purple(0); if ((diff & 0x10) != 0) { @@ -561,6 +571,9 @@ static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) { mach_port_deallocate(mach_task_self(), purple); } +static void VNCPointerNew(int buttons, int x, int y, CGPoint location, int diff, bool twas, bool tis) { +} + GSEventRef (*$GSEventCreateKeyEvent)(int, CGPoint, CFStringRef, CFStringRef, id, UniChar, short, short); GSEventRef (*$GSCreateSyntheticKeyEvent)(UniChar, BOOL, BOOL); diff --git a/CoreFoundation/CFUserNotification.h b/include/CoreFoundation/CFUserNotification.h similarity index 100% rename from CoreFoundation/CFUserNotification.h rename to include/CoreFoundation/CFUserNotification.h -- 2.47.2