From 33fb8ec53ae594f9d0a42ca39dbec3955781b1ab Mon Sep 17 00:00:00 2001 From: KennyTM~ Date: Mon, 7 Jun 2010 02:39:26 +0800 Subject: [PATCH] Fixes to allow all headers to be compilable, except those requiring MusicLibrary and MediaPlayer frameworks. --- AccountSettings/AccountCreationProtocol.h | 6 +- ActorKit/AKDispatchQueue.h | 2 +- AppSupport/CPExclusiveLock.h | 1 + AppSupport/CPRegularExpression.h | 1 + DataAccess/DataAccess-Structs.h | 17 +-- IOKit/IOKit.h | 1 + Message/DAMailboxStreamingContentConsumer.h | 8 +- Message/Message-Structs.h | 8 +- PhotoLibrary/NSObject.h | 26 +--- PhotoLibrary/PLImageTile.h | 5 + PhotoLibrary/PLImageTileView.h | 6 + PhotoLibrary/PLTVOutImageTile.h | 5 + PhotoLibrary/PhotoLibrary-Structs.h | 122 +----------------- PhotoLibrary/UIActionSheetDelegate.h | 14 +- PhotoLibrary/UIModalViewDelegate.h | 14 +- PhotoLibrary/UINavigationControllerDelegate.h | 10 +- PhotoLibrary/UIScrollViewDelegate.h | 18 +-- PhotoLibrary/UITableViewDataSource.h | 19 +-- PhotoLibrary/UITableViewDelegate.h | 28 +--- PhotoLibrary/UITextFieldDelegate.h | 16 +-- PhotoLibrary/UITextViewDelegate.h | 16 +-- test-compiler.py | 1 + 22 files changed, 42 insertions(+), 302 deletions(-) create mode 120000 IOKit/IOKit.h diff --git a/AccountSettings/AccountCreationProtocol.h b/AccountSettings/AccountCreationProtocol.h index e841860..483913f 100644 --- a/AccountSettings/AccountCreationProtocol.h +++ b/AccountSettings/AccountCreationProtocol.h @@ -6,8 +6,4 @@ */ - -@protocol AccountCreationProtocol --(id)initWithBasicAccount:(id)basicAccount; -@end - +#import diff --git a/ActorKit/AKDispatchQueue.h b/ActorKit/AKDispatchQueue.h index 4152072..a84da61 100644 --- a/ActorKit/AKDispatchQueue.h +++ b/ActorKit/AKDispatchQueue.h @@ -6,7 +6,7 @@ #import "ActorKit-Structs.h" #import -@class NSThread, NSConditionLock; +@class NSThread, NSConditionLock, NSNumber, NSRunLoop; enum AKDispatchQueueState { AKDispatchQueueState_Initialized = 0, diff --git a/AppSupport/CPExclusiveLock.h b/AppSupport/CPExclusiveLock.h index 7bf9e0d..3e4ca3f 100644 --- a/AppSupport/CPExclusiveLock.h +++ b/AppSupport/CPExclusiveLock.h @@ -23,6 +23,7 @@ #import "NSLocking.h" #import +#import @class NSString; diff --git a/AppSupport/CPRegularExpression.h b/AppSupport/CPRegularExpression.h index 750dfea..ef81bd3 100644 --- a/AppSupport/CPRegularExpression.h +++ b/AppSupport/CPRegularExpression.h @@ -9,6 +9,7 @@ #import "NSCoding.h" #import "NSCopying.h" #import +#import @class NSString; diff --git a/DataAccess/DataAccess-Structs.h b/DataAccess/DataAccess-Structs.h index 820cb02..582d8d2 100644 --- a/DataAccess/DataAccess-Structs.h +++ b/DataAccess/DataAccess-Structs.h @@ -5,6 +5,9 @@ * Source: /System/Library/PrivateFrameworks/DataAccess.framework/DataAccess */ +#import +#import + typedef struct __SecTrust SecTrust; typedef struct _xmlNs xmlNs; @@ -62,8 +65,6 @@ typedef struct ldap ldap; typedef struct ldapmsg ldapmsg; -typedef struct __SCDynamicStore* SCDynamicStoreRef; - typedef struct CalDatabase CalDatabase; typedef struct _xmlSAXHandler { @@ -400,16 +401,4 @@ typedef struct { int _field1; } XXStruct_YWGUWB; -typedef struct { - unsigned long _field1; - id* _field2; - unsigned long* _field3; - unsigned long _field4[5]; -} XXStruct_kFm5bA; - -typedef struct { - int _field1; - int _field2; -} XXStruct_K5nmsA; - diff --git a/IOKit/IOKit.h b/IOKit/IOKit.h new file mode 120000 index 0000000..4d9c38e --- /dev/null +++ b/IOKit/IOKit.h @@ -0,0 +1 @@ +IOKitLib.h \ No newline at end of file diff --git a/Message/DAMailboxStreamingContentConsumer.h b/Message/DAMailboxStreamingContentConsumer.h index 85613ae..40526db 100644 --- a/Message/DAMailboxStreamingContentConsumer.h +++ b/Message/DAMailboxStreamingContentConsumer.h @@ -6,10 +6,4 @@ */ - -@protocol DAMailboxStreamingContentConsumer --(BOOL)shouldBeginStreamingForMailMessage:(id)mailMessage format:(int)format; --(void)consumeData:(char*)data length:(int)length format:(int)format mailMessage:(id)message; --(void)didEndStreamingForMailMessage:(id)mailMessage; -@end - +#import diff --git a/Message/Message-Structs.h b/Message/Message-Structs.h index 3686b29..0e1d36f 100644 --- a/Message/Message-Structs.h +++ b/Message/Message-Structs.h @@ -8,6 +8,8 @@ #include #include #import +#import +#import typedef struct { int _field1; @@ -115,16 +117,10 @@ typedef struct { unsigned _field12; } XXStruct_sY4QuD; -typedef struct sqlite3 sqlite3; - typedef struct NtlmGenerator NtlmGenerator; typedef struct _lockdown_connection lockdown_connection; -typedef struct sqlite3_stmt sqlite3_stmt; - -typedef struct __SCDynamicStore* SCDynamicStoreRef; - typedef struct { unsigned colorHasBeenEvaluated : 1; unsigned colorWasSetManually : 1; diff --git a/PhotoLibrary/NSObject.h b/PhotoLibrary/NSObject.h index 042c013..8b25c09 100644 --- a/PhotoLibrary/NSObject.h +++ b/PhotoLibrary/NSObject.h @@ -5,28 +5,4 @@ * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ -#import "PhotoLibrary-Structs.h" - - -@protocol NSObject --(BOOL)isEqual:(id)equal; --(unsigned)hash; --(Class)superclass; --(Class)class; --(id)self; --(NSZone*)zone; --(id)performSelector:(SEL)selector; --(id)performSelector:(SEL)selector withObject:(id)object; --(id)performSelector:(SEL)selector withObject:(id)object withObject:(id)object3; --(BOOL)isProxy; --(BOOL)isKindOfClass:(Class)aClass; --(BOOL)isMemberOfClass:(Class)aClass; --(BOOL)conformsToProtocol:(id)protocol; --(BOOL)respondsToSelector:(SEL)selector; --(id)retain; --(oneway void)release; --(id)autorelease; --(unsigned)retainCount; --(id)description; -@end - +#import diff --git a/PhotoLibrary/PLImageTile.h b/PhotoLibrary/PLImageTile.h index c86d689..55f1086 100644 --- a/PhotoLibrary/PLImageTile.h +++ b/PhotoLibrary/PLImageTile.h @@ -5,6 +5,10 @@ * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ +#import + +#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_3_2 + #import "PLImageTile.h" #import "PhotoLibrary-Structs.h" #import @@ -54,3 +58,4 @@ -(int)_imageOrientation; @end +#endif diff --git a/PhotoLibrary/PLImageTileView.h b/PhotoLibrary/PLImageTileView.h index 4781ac1..7d15cf7 100644 --- a/PhotoLibrary/PLImageTileView.h +++ b/PhotoLibrary/PLImageTileView.h @@ -5,6 +5,11 @@ * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ +#import + +#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_3_2 + + #import "PhotoLibrary-Structs.h" #import @@ -31,3 +36,4 @@ // inherited: -(void)mouseDragged:(GSEventRef)dragged; @end +#endif diff --git a/PhotoLibrary/PLTVOutImageTile.h b/PhotoLibrary/PLTVOutImageTile.h index 41c0e69..461a3e7 100644 --- a/PhotoLibrary/PLTVOutImageTile.h +++ b/PhotoLibrary/PLTVOutImageTile.h @@ -5,6 +5,10 @@ * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ +#import + +#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_3_2 + #import "PhotoLibrary-Structs.h" #import "PLImageTile.h" @@ -15,3 +19,4 @@ // inherited: -(CGRect)imageRect; @end +#endif diff --git a/PhotoLibrary/PhotoLibrary-Structs.h b/PhotoLibrary/PhotoLibrary-Structs.h index 1e65799..a892c29 100644 --- a/PhotoLibrary/PhotoLibrary-Structs.h +++ b/PhotoLibrary/PhotoLibrary-Structs.h @@ -5,61 +5,11 @@ * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ -typedef struct _NSZone NSZone; - -typedef struct __CFData* CFDataRef; - -typedef struct CGContext* CGContextRef; - -typedef struct CGAffineTransform { - float a; - float b; - float c; - float d; - float tx; - float ty; -} CGAffineTransform; - -typedef struct _NSRange { - unsigned location; - unsigned length; -} NSRange; - -typedef struct __GSEvent* GSEventRef; - -typedef struct CGImage* CGImageRef; - -typedef struct CGPoint { - float x; - float y; -} CGPoint; - -typedef struct CGSize { - float width; - float height; -} CGSize; - -typedef struct CGRect { - CGPoint origin; - CGSize size; -} CGRect; - -typedef struct { - int _field1; - int _field2; - id _field3; - id _field4; - float _field5; - int _field6; - SEL _field7; - id _field8; -} XXStruct_b4LybD; - -typedef struct __CFMessagePort* CFMessagePortRef; - -typedef struct __CFDictionary* CFDictionaryRef; - -typedef struct __CFArray* CFArrayRef; +#import +#import +#import +#import +#import typedef struct { id _field1; @@ -68,71 +18,9 @@ typedef struct { float _field4; } XXStruct_z8YKPA; -typedef struct __CFString* CFStringRef; - -typedef struct UIEdgeInsets { - float top; - float left; - float bottom; - float right; -} UIEdgeInsets; - -typedef struct CGImageSource* CGImageSourceRef; - -typedef struct __CFRunLoopSource* CFRunLoopSourceRef; - -typedef struct { - int version; - void* info; - /*function-pointer*/ void* retain; - /*function-pointer*/ void* release; - /*function-pointer*/ void* copyDescription; -} XXStruct_4pnlqD; - -typedef struct __CFRunLoop* CFRunLoopRef; - -typedef struct CGPath* CGPathRef; - -typedef struct CGColor* CGColorRef; - typedef struct { CGRect _field1; CGRect _field2; CGRect _field3; } XXStruct_SIyEID; -typedef struct { - BOOL _field1; - BOOL _field2; - BOOL _field3; - float _field4; - float _field5; - int _field6; - CGRect _field7; - CGRect _field8; -} XXStruct_TF$i3B; - -typedef struct { - BOOL _field1; - union { - struct { - id _field1; - id _field2; - } _field1; - GSEventRef _field2; - } _field2; -} XXStruct_CKAdxD; - -typedef struct { - int _field1; - int _field2; -} XXStruct_K5nmsA; - -typedef struct { - unsigned long _field1; - id* _field2; - unsigned long* _field3; - unsigned long _field4[5]; -} XXStruct_kFm5bA; - - diff --git a/PhotoLibrary/UIActionSheetDelegate.h b/PhotoLibrary/UIActionSheetDelegate.h index 3deb8c1..8696927 100644 --- a/PhotoLibrary/UIActionSheetDelegate.h +++ b/PhotoLibrary/UIActionSheetDelegate.h @@ -5,16 +5,4 @@ * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ -#import "NSObject.h" - - -@protocol UIActionSheetDelegate -@optional --(void)actionSheet:(id)sheet clickedButtonAtIndex:(int)index; --(void)actionSheetCancel:(id)cancel; --(void)willPresentActionSheet:(id)sheet; --(void)didPresentActionSheet:(id)sheet; --(void)actionSheet:(id)sheet willDismissWithButtonIndex:(int)buttonIndex; --(void)actionSheet:(id)sheet didDismissWithButtonIndex:(int)buttonIndex; -@end - +#import diff --git a/PhotoLibrary/UIModalViewDelegate.h b/PhotoLibrary/UIModalViewDelegate.h index b5fcffd..4ec97c2 100644 --- a/PhotoLibrary/UIModalViewDelegate.h +++ b/PhotoLibrary/UIModalViewDelegate.h @@ -5,16 +5,4 @@ * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ -#import "NSObject.h" - - -@protocol UIModalViewDelegate -@optional --(void)modalView:(id)view clickedButtonAtIndex:(int)index; --(void)modalViewCancel:(id)cancel; --(void)willPresentModalView:(id)view; --(void)didPresentModalView:(id)view; --(void)modalView:(id)view willDismissWithButtonIndex:(int)buttonIndex; --(void)modalView:(id)view didDismissWithButtonIndex:(int)buttonIndex; -@end - +#import diff --git a/PhotoLibrary/UINavigationControllerDelegate.h b/PhotoLibrary/UINavigationControllerDelegate.h index ecee4ee..e4dde42 100644 --- a/PhotoLibrary/UINavigationControllerDelegate.h +++ b/PhotoLibrary/UINavigationControllerDelegate.h @@ -5,12 +5,4 @@ * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ -#import "NSObject.h" - - -@protocol UINavigationControllerDelegate -@optional --(void)navigationController:(id)controller willShowViewController:(id)controller2 animated:(BOOL)animated; --(void)navigationController:(id)controller didShowViewController:(id)controller2 animated:(BOOL)animated; -@end - +#import \ No newline at end of file diff --git a/PhotoLibrary/UIScrollViewDelegate.h b/PhotoLibrary/UIScrollViewDelegate.h index ea595de..e69105b 100644 --- a/PhotoLibrary/UIScrollViewDelegate.h +++ b/PhotoLibrary/UIScrollViewDelegate.h @@ -5,20 +5,4 @@ * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ -#import "NSObject.h" - - -@protocol UIScrollViewDelegate -@optional --(void)scrollViewDidScroll:(id)scrollView; --(void)scrollViewWillBeginDragging:(id)scrollView; --(void)scrollViewDidEndDragging:(id)scrollView willDecelerate:(BOOL)decelerate; --(void)scrollViewWillBeginDecelerating:(id)scrollView; --(void)scrollViewDidEndDecelerating:(id)scrollView; --(void)scrollViewDidEndScrollingAnimation:(id)scrollView; --(id)viewForZoomingInScrollView:(id)scrollView; --(void)scrollViewDidEndZooming:(id)scrollView withView:(id)view atScale:(float)scale; --(BOOL)scrollViewShouldScrollToTop:(id)scrollView; --(void)scrollViewDidScrollToTop:(id)scrollView; -@end - +#import diff --git a/PhotoLibrary/UITableViewDataSource.h b/PhotoLibrary/UITableViewDataSource.h index 90bdc48..861d337 100644 --- a/PhotoLibrary/UITableViewDataSource.h +++ b/PhotoLibrary/UITableViewDataSource.h @@ -5,21 +5,4 @@ * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ -#import "NSObject.h" - - -@protocol UITableViewDataSource --(int)tableView:(id)view numberOfRowsInSection:(int)section; --(id)tableView:(id)view cellForRowAtIndexPath:(id)indexPath; -@optional --(int)numberOfSectionsInTableView:(id)tableView; --(id)tableView:(id)view titleForHeaderInSection:(int)section; --(id)tableView:(id)view titleForFooterInSection:(int)section; --(BOOL)tableView:(id)view canEditRowAtIndexPath:(id)indexPath; --(BOOL)tableView:(id)view canMoveRowAtIndexPath:(id)indexPath; --(id)sectionIndexTitlesForTableView:(id)tableView; --(int)tableView:(id)view sectionForSectionIndexTitle:(id)sectionIndexTitle atIndex:(int)index; --(void)tableView:(id)view commitEditingStyle:(int)style forRowAtIndexPath:(id)indexPath; --(void)tableView:(id)view moveRowAtIndexPath:(id)indexPath toIndexPath:(id)indexPath3; -@end - +#import \ No newline at end of file diff --git a/PhotoLibrary/UITableViewDelegate.h b/PhotoLibrary/UITableViewDelegate.h index cbd1157..06c01ea 100644 --- a/PhotoLibrary/UITableViewDelegate.h +++ b/PhotoLibrary/UITableViewDelegate.h @@ -5,30 +5,4 @@ * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ -#import "UIScrollViewDelegate.h" -#import "NSObject.h" - - -@protocol UITableViewDelegate -@optional --(void)tableView:(id)view willDisplayCell:(id)cell forRowAtIndexPath:(id)indexPath; --(float)tableView:(id)view heightForRowAtIndexPath:(id)indexPath; --(float)tableView:(id)view heightForHeaderInSection:(int)section; --(float)tableView:(id)view heightForFooterInSection:(int)section; --(id)tableView:(id)view viewForHeaderInSection:(int)section; --(id)tableView:(id)view viewForFooterInSection:(int)section; --(int)tableView:(id)view accessoryTypeForRowWithIndexPath:(id)indexPath; --(void)tableView:(id)view accessoryButtonTappedForRowWithIndexPath:(id)indexPath; --(id)tableView:(id)view willSelectRowAtIndexPath:(id)indexPath; --(id)tableView:(id)view willDeselectRowAtIndexPath:(id)indexPath; --(void)tableView:(id)view didSelectRowAtIndexPath:(id)indexPath; --(void)tableView:(id)view didDeselectRowAtIndexPath:(id)indexPath; --(int)tableView:(id)view editingStyleForRowAtIndexPath:(id)indexPath; --(id)tableView:(id)view titleForDeleteConfirmationButtonForRowAtIndexPath:(id)indexPath; --(BOOL)tableView:(id)view shouldIndentWhileEditingRowAtIndexPath:(id)indexPath; --(void)tableView:(id)view willBeginEditingRowAtIndexPath:(id)indexPath; --(void)tableView:(id)view didEndEditingRowAtIndexPath:(id)indexPath; --(id)tableView:(id)view targetIndexPathForMoveFromRowAtIndexPath:(id)indexPath toProposedIndexPath:(id)proposedIndexPath; --(int)tableView:(id)view indentationLevelForRowAtIndexPath:(id)indexPath; -@end - +#import diff --git a/PhotoLibrary/UITextFieldDelegate.h b/PhotoLibrary/UITextFieldDelegate.h index 969a305..2a0c0ff 100644 --- a/PhotoLibrary/UITextFieldDelegate.h +++ b/PhotoLibrary/UITextFieldDelegate.h @@ -5,18 +5,4 @@ * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ -#import "PhotoLibrary-Structs.h" -#import "NSObject.h" - - -@protocol UITextFieldDelegate -@optional --(BOOL)textFieldShouldBeginEditing:(id)textField; --(void)textFieldDidBeginEditing:(id)textField; --(BOOL)textFieldShouldEndEditing:(id)textField; --(void)textFieldDidEndEditing:(id)textField; --(BOOL)textField:(id)field shouldChangeCharactersInRange:(NSRange)range replacementString:(id)string; --(BOOL)textFieldShouldClear:(id)textField; --(BOOL)textFieldShouldReturn:(id)textField; -@end - +#import diff --git a/PhotoLibrary/UITextViewDelegate.h b/PhotoLibrary/UITextViewDelegate.h index 908ebb0..3ed11cb 100644 --- a/PhotoLibrary/UITextViewDelegate.h +++ b/PhotoLibrary/UITextViewDelegate.h @@ -5,18 +5,4 @@ * Source: /System/Library/PrivateFrameworks/PhotoLibrary.framework/PhotoLibrary */ -#import "PhotoLibrary-Structs.h" -#import "NSObject.h" - - -@protocol UITextViewDelegate -@optional --(BOOL)textViewShouldBeginEditing:(id)textView; --(BOOL)textViewShouldEndEditing:(id)textView; --(void)textViewDidBeginEditing:(id)textView; --(void)textViewDidEndEditing:(id)textView; --(BOOL)textView:(id)view shouldChangeTextInRange:(NSRange)range replacementText:(id)text; --(void)textViewDidChange:(id)textView; --(void)textViewDidChangeSelection:(id)textView; -@end - +#import diff --git a/test-compiler.py b/test-compiler.py index fd78b8a..9bb93e0 100755 --- a/test-compiler.py +++ b/test-compiler.py @@ -47,6 +47,7 @@ '-I{0}/usr/lib/gcc/arm-apple-darwin9/4.2.1/include'.format(sdk), '-F{0}/System/Library/PrivateFrameworks/'.format(sdk), '-I.', + '-I_fallback', '-Wall', '-Wextra', '-o',