Permalink
Browse files

new target ZangetsuTouch for iOS

Lots of work right now
- works with a minimal amount of code right now
- going to go to through all classes & include every class that will
work with iOS class by class
  • Loading branch information...
1 parent f2dbdf2 commit 58562d19d4e751e5823970e8b85948f28786a29f @Machx committed Jan 16, 2012
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Foundation/Foundation.h>
+#if TARGET_OS_MAC
static const NSInteger kPidNotFound = -1;
@@ -37,7 +37,7 @@ static const NSInteger kPidNotFound = -1;
+(NSInteger)pidForApplication:(NSString *)appName;
+(NSString *)bundleIdentifierForApplication:(NSString *)appName;
+(NSInteger)executableArchitectureForApplication:(NSString *)appName;
-+(NSRunningApplication *)runningAppInstanceForApp:(NSString *)appName;
-+(NSImage *)iconForApplication:(NSString *)appName;
-
+//+(NSRunningApplication *)runningAppInstanceForApp:(NSString *)appName;
+//+(NSImage *)iconForApplication:(NSString *)appName;
@end
+#endif
@@ -33,7 +33,7 @@
(2) a easy way to ensure that objects of the correct type are toll free bridged
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
/* NSString & CFStringRef */
@@ -26,7 +26,6 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
#import <CoreData/CoreData.h>
#define CWCDManagedObjectContext() [[CWCoreDataCenter defaultCenter] managedObjectContext]
View
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
static NSString * const kCWISO8601TimeFormat = @"yyyy/MM/dd HH:mm:ss ZZZ";
static NSString * const kCWISO8601TimeFormat2 = @"yyyy-MM-dd'T'HH:mm:ss'Z'";;
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
BOOL CWIsDebugInProgress(void);
void CWCrash(void);
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
#define CWLogError(_error_) NSLog(@"%@",[_error_ description])
@@ -27,9 +27,16 @@
THE SOFTWARE.
*/
+
+#if TARGET_OS_IPHONE
+#import <Foundation/Foundation.h>
+#elif TARGET_OS_MAC
#import <Cocoa/Cocoa.h>
+#endif
+#if TARGET_OS_MAC
void CWShowExceptionAsAlertPanel(NSException *exception);
+#endif
@interface NSException (CWNSExceptionAdditions)
View
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
BOOL CWClassExists(NSString * class);
@@ -27,9 +27,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
+
+#if TARGET_OS_IPHONE
+#import <UIKit/UIKit.h>
+#elif TARGET_OS_MAC
#import <Cocoa/Cocoa.h>
+#endif
-NSRect CWCenteredRect(NSRect smallRect, NSRect largeRect);
+CGRect CWCenteredRect(CGRect smallRect, CGRect largeRect);
extern CGContextRef CWCurrentCGContext();
@@ -29,9 +29,9 @@ of this software and associated documentation files (the "Software"), to deal
#import "CWGraphicsFoundation.h"
-NSRect CWCenteredRect(NSRect smallRect, NSRect largeRect) {
+CGRect CWCenteredRect(CGRect smallRect, CGRect largeRect) {
- NSRect centeredRect;
+ CGRect centeredRect;
centeredRect.size = smallRect.size;
centeredRect.origin.x = (largeRect.size.width - smallRect.size.width) / 2.0;
View
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
@interface NSString (CWMD5Utilities)
View
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
NSString *CWFullPathFromTildeString(NSString *tildePath);
View
@@ -20,7 +20,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
@interface NSString (CWSHA1Utilities)
View
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
static NSString * const kCWSystemMajorVersion = @"majorVersion";
static NSString * const kCWSystemMinorVersion = @"minorVersion";
View
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
typedef void (^TaskCompletionBlock)(void);
View
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
NSURL *CWURL(NSString * urlFormat,...);
@@ -25,7 +25,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
@interface NSArray (CWNSArrayAdditions)
@@ -42,7 +42,9 @@
-(NSArray *)cw_findAllWithBlock:(BOOL (^)(id obj))block;
+#if !TARGET_OS_IPHONE
-(NSHashTable *)cw_findAllIntoWeakRefsWithBlock:(BOOL (^)(id))block;
+#endif
-(NSArray *)cw_mapArray:(id (^)(id obj))block;
@@ -148,6 +148,7 @@ - (NSArray *) cw_findAllWithBlock:(BOOL (^)(id obj))block {
return results;
}
+#if !TARGET_OS_IPHONE
/**
* experimental method
* like cw_find but instead uses NSHashTable to store weak pointers to
@@ -169,6 +170,7 @@ - (NSHashTable *) cw_findAllIntoWeakRefsWithBlock:(BOOL (^)(id))block {
return results;
}
+#endif
/**
* cw_mapArray basically maps an array by enumerating
View
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
@interface NSData (CWNSDataAdditions)
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
@interface NSDictionary (CWNSDictionaryAdditions)
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
@interface NSObject (CWNSObjectAdditions)
View
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
@interface NSSet (CWNSSetAdditions)
@@ -42,7 +42,9 @@
-(NSSet *)cw_findAllWithBlock:(BOOL (^)(id obj))block;
+#if !TARGET_OS_IPHONE
-(NSHashTable *)cw_findAllIntoWeakRefsWithBlock:(BOOL (^)(id))block;
+#endif
-(NSSet *)cw_mapSet:(id (^)(id obj))block;
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
@interface NSString (CWNSStringAdditions)
+ (NSString *)cw_uuidString;
@@ -27,7 +27,7 @@
THE SOFTWARE.
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
@interface NSURLConnection (CWNSURLConnectionAdditions)
View
@@ -0,0 +1,67 @@
+/*
+// ZangetsuTouch.h
+// Zangetsu
+//
+// Created by Colin Wheeler on 1/15/12.
+// Copyright (c) 2012. All rights reserved.
+//
+
+ Copyright (c) 2011 Colin Wheeler
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+
+#import "CWMacros.h"
+//#import "CWSHA1Utilities.h"
+//#import "CWTask.h"
+//#import "CWDateUtilities.h"
+//#import "NSStringAdditions.h"
+//#import "NSArrayAdditions.h"
+//#import "NSDictionaryAdditions.h"
+//#import "CWSystemInfo.h"
+//#import "NSSetAdditions.h"
+//#import "NSURLConnectionAdditions.h"
+//#import "CWDebugUtilities.h"
+//#import "NSObjectAdditions.h"
+//#import "CWFoundation.h"
+//#import "CWPathUtilities.h"
+//#import "CWErrorUtilities.h"
+//#import "CWGraphicsFoundation.h"
+//#import "CWMD5Utilities.h"
+//#import "NSDataAdditions.h"
+//#import "CWCoreDataCenter.h"
+//#import "NSManagedObjectAdditions.h"
+//#import "CWExceptionUtilities.h"
+//#import "CWURLUtilities.h"
+//#import "CWRuntimeUtilities.h"
+//#import "CWReachability.h"
+//#import "NSDateAddtions.h"
+#import "CWCFConversionMacros.h"
+//#import "CWStack.h"
+//#import "CWTree.h"
+//#import "CWBTree.h"
+//#import "NSMutableArrayAdditions.h"
+//#import "CWBase64.h"
+//#import "CWZLib.h"
+//#import "NSOperationQueueAdditions.h"
+//#import "CWQueue.h"
+//#import "CWURLRequest.h"
+//#import "NSMutableURLRequestAdditions.h"
+//#import "NSRecursiveLockAdditions.h"
+//#import "NSManagedObjectContextAdditions.h"
Oops, something went wrong.

0 comments on commit 58562d1

Please sign in to comment.