#import <Foundation/Foundation.h>
#import <IOMobileFramebuffer/IOMobileFramebuffer.h>
#import <IOKit/IOKitLib.h>
-#import <UIKit/UIModalView.h>
-#import <UIKit/UIModalView-Private.h>
+#import <UIKit/UIKit.h>
#import <SpringBoard/SBAlertItemsController.h>
#import <SpringBoard/SBDismissOnlyAlertItem.h>
@end
+static mach_port_t (*GSTakePurpleSystemEventPort)(void);
+static bool PurpleAllocated;
+
static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) {
x_ = x; y_ = y;
int diff = buttons_ ^ buttons;
if (port == 0) {
if (purple == 0)
- purple = GSCopyPurpleSystemEventPort();
+ purple = (*GSTakePurpleSystemEventPort)();
port = purple;
}
GSSendEvent(&event.record, port);
}
- if (purple != 0)
+ if (purple != 0 && PurpleAllocated)
mach_port_deallocate(mach_task_self(), purple);
}
if (key > 0xfff)
return;
- struct {
- struct GSEventRecord record;
- struct GSEventKeyInfo data;
- } event;
-
- memset(&event, 0, sizeof(event));
-
- event.record.type = GSEventTypeKeyDown;
- event.record.timestamp = GSCurrentEventTimestamp();
- event.record.size = sizeof(event.data);
-
- event.data.character = key;
+ GSEventRef event(_GSCreateSyntheticKeyEvent(key, YES, YES));
+ GSEventRecord *record(_GSEventGetGSEventRecord(event));
+ record->type = GSEventTypeKeyDown;
mach_port_t port(0);
port = [display clientPortAtPosition:CGPointMake(x_, y_)];
}
+ mach_port_t purple(0);
+
+ if (port == 0) {
+ if (purple == 0)
+ purple = (*GSTakePurpleSystemEventPort)();
+ port = purple;
+ }
+
if (port != 0)
- GSSendEvent(&event.record, port);
+ GSSendEvent(record, port);
+
+ if (purple != 0 && PurpleAllocated)
+ mach_port_deallocate(mach_task_self(), purple);
+
+ CFRelease(event);
}
static void VNCDisconnect(rfbClientPtr client) {
}
extern "C" void TweakInitialize() {
+ GSTakePurpleSystemEventPort = reinterpret_cast<mach_port_t (*)()>(dlsym(RTLD_DEFAULT, "GSGetPurpleSystemEventPort"));
+ if (GSTakePurpleSystemEventPort == NULL) {
+ GSTakePurpleSystemEventPort = reinterpret_cast<mach_port_t (*)()>(dlsym(RTLD_DEFAULT, "GSCopyPurpleSystemEventPort"));
+ PurpleAllocated = true;
+ }
+
MSHookFunction(&IOMobileFramebufferSwapSetLayer, &$IOMobileFramebufferSwapSetLayer, &_IOMobileFramebufferSwapSetLayer);
$SBAlertItemsController = objc_getClass("SBAlertItemsController");
Section: Networking
Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
Architecture: iphoneos-arm
-Version: 0.9.2765-1
+Version: 0.9.2970-1
Description: a VNC /server/ for the iPhone
Name: Veency
-Depends: mobilesubstrate (>= 0.9.2587-1), libvncserver
+Depends: mobilesubstrate (>= 0.9.2966-1), libvncserver
Author: Jay Freeman (saurik) <saurik@saurik.com>
Depiction: http://cydia.saurik.com/info/veency/
Tag: purpose::daemon, role::enduser