From: Jay Freeman (saurik) Date: Sun, 28 Mar 2010 07:53:23 +0000 (+0000) Subject: iPhoneVNC was replaced by Veency, but I forgot to commit the D. X-Git-Url: https://git.saurik.com/veency.git/commitdiff_plain/7cd8320ffa529feeda8c65b987bfad63b4f71215 iPhoneVNC was replaced by Veency, but I forgot to commit the D. --- diff --git a/iphonevnc/LayerKit/LKPurpleServer.h b/iphonevnc/LayerKit/LKPurpleServer.h deleted file mode 100644 index 0a24f93..0000000 --- a/iphonevnc/LayerKit/LKPurpleServer.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef LAYERKIT_LKPURPLESERVER_H_ -#define LAYERKIT_LKPURPLESERVER_H_ - -#include -#include - -#import - -#ifdef __cplusplus -extern "C" { -#endif - -CGImageRef LKPurpleServerGetScreenImage(void *null); - -#ifdef __cplusplus -} -#endif - -#endif/*LAYERKIT_LKPURPLESERVER_H_*/ diff --git a/iphonevnc/iPhoneVNC.mm b/iphonevnc/iPhoneVNC.mm deleted file mode 100644 index aef6fc9..0000000 --- a/iphonevnc/iPhoneVNC.mm +++ /dev/null @@ -1,76 +0,0 @@ -#import -#import - -#include -#include -#include - -extern "C" CGImageRef UIGetScreenImage(); - -static const size_t Width = 320; -static const size_t Height = 480; -static const size_t BytesPerPixel = 4; -static const size_t BitsPerComponent = 8; - -static const size_t Stride = Width * BytesPerPixel; -static const size_t Size32 = Width * Height; -static const size_t Size8 = Size32 * BytesPerPixel; - -extern "C" void *NSPushAutoreleasePool(void *); -extern "C" void NSPopAutoreleasePool(void *); - -CGContextRef CreateContext() { - uint8_t *buffer = (uint8_t *) malloc(Size8); - if (buffer == NULL) - return NULL; - - CGColorSpaceRef space = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); - - CGContextRef context = CGBitmapContextCreate(buffer, Width, Height, BitsPerComponent, Stride, space, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); - if (context == NULL) - free(buffer); - - CGColorSpaceRelease(space); - return context; -} - -int main(int argc, char *argv[]) { - CGContextRef context0 = CreateContext(); - CGContextRef context1 = CreateContext(); - - CGRect rect = CGRectMake(0, 0, Width, Height); - - rfbScreenInfoPtr screen = rfbGetScreen(&argc, argv, Width, Height, BitsPerComponent, 3, BytesPerPixel); - - screen->desktopName = "iPhone"; - screen->alwaysShared = TRUE; - - rfbInitServer(screen); - - for (;;) { - CGContextRef context = context1; - context1 = context0; - context0 = context; - - uint8_t *buffer0 = (uint8_t *) CGBitmapContextGetData(context0); - uint8_t *buffer1 = (uint8_t *) CGBitmapContextGetData(context1); - screen->frameBuffer = (char *) buffer0; - - void *pool = NSPushAutoreleasePool(0); - - CGImageRef image = UIGetScreenImage(); - CGContextDrawImage(context0, rect, image); - CFRelease(image); - - NSPopAutoreleasePool(pool); - - if (memcmp(buffer0, buffer1, Size8) != 0) - rfbMarkRectAsModified(screen, 0, 0, Width, Height); - rfbProcessEvents(screen, 100000); - } - - - rfbScreenCleanup(screen); - - return 0; -} diff --git a/iphonevnc/makefile b/iphonevnc/makefile deleted file mode 100644 index 77aa29e..0000000 --- a/iphonevnc/makefile +++ /dev/null @@ -1,19 +0,0 @@ -all: iPhoneVNC - -clean: - rm -f iPhoneVNC - -test: all - ./iPhoneVNC - -iPhoneVNC: iPhoneVNC.mm makefile - g++ -g0 -O3 -o $@ $< -I. \ - -lvncserver -lz \ - -framework CoreFoundation \ - -framework CoreGraphics \ - -framework UIKit \ - -lobjc \ - -framework Foundation - ldid -S iPhoneVNC - -.PHONY: all clean test