1 | /* |
---|
2 | * AITigerCompatibility.h |
---|
3 | * AIUtilities.framework |
---|
4 | * |
---|
5 | * Created by David Smith on 10/28/07. |
---|
6 | * Copyright 2007 The Adium Team. All rights reserved. |
---|
7 | * |
---|
8 | */ |
---|
9 | #ifndef AITigerCompatibility |
---|
10 | |
---|
11 | #define AITigerCompatibility |
---|
12 | |
---|
13 | #import <AvailabilityMacros.h> |
---|
14 | |
---|
15 | #ifndef MAC_OS_X_VERSION_10_5 |
---|
16 | #define MAC_OS_X_VERSION_10_5 1050 |
---|
17 | #endif //ndef MAC_OS_X_VERSION_10_5 |
---|
18 | |
---|
19 | #if MAC_OS_X_VERSION_10_5 > MAC_OS_X_VERSION_MAX_ALLOWED |
---|
20 | #define NS_REQUIRES_NIL_TERMINATION |
---|
21 | |
---|
22 | #if __LP64__ || NS_BUILD_32_LIKE_64 |
---|
23 | typedef long NSInteger; |
---|
24 | typedef unsigned long NSUInteger; |
---|
25 | typedef double CGFloat; |
---|
26 | #else |
---|
27 | typedef int NSInteger; |
---|
28 | typedef unsigned int NSUInteger; |
---|
29 | typedef float CGFloat; |
---|
30 | #endif |
---|
31 | |
---|
32 | #define NSIntegerMax LONG_MAX |
---|
33 | #define NSIntegerMin LONG_MIN |
---|
34 | #define NSUIntegerMax ULONG_MAX |
---|
35 | |
---|
36 | #define NSINTEGER_DEFINED 1 |
---|
37 | |
---|
38 | #define NSDownloadsDirectory 15 |
---|
39 | |
---|
40 | typedef NSUInteger NSWindowCollectionBehavior; |
---|
41 | #define NSWindowCollectionBehaviorDefault 0 |
---|
42 | #define NSWindowCollectionBehaviorCanJoinAllSpaces 1 << 0 |
---|
43 | |
---|
44 | #define NSCellHitContentArea 1 << 0 |
---|
45 | |
---|
46 | #ifdef __OBJC__ |
---|
47 | @interface NSWindow (NSWindowTigerMethods) |
---|
48 | - (void)setCollectionBehavior:(NSWindowCollectionBehavior)behavior; |
---|
49 | @end |
---|
50 | |
---|
51 | @interface NSTextView (NSTextViewTigerMethods) |
---|
52 | - (void)setGrammarCheckingEnabled:(BOOL)flag; |
---|
53 | - (BOOL)isGrammarCheckingEnabled; |
---|
54 | - (void)toggleGrammarChecking:(id)sender; |
---|
55 | @end |
---|
56 | |
---|
57 | @interface NSSplitView (NSScrollViewTigerMethods) |
---|
58 | - (void)setPosition:(float)position ofDividerAtIndex:(NSInteger)dividerIndex; |
---|
59 | @end |
---|
60 | |
---|
61 | @interface NSNumber (NSNumber64BitCompat) |
---|
62 | - (NSInteger)integerValue; |
---|
63 | - (NSUInteger)unsignedIntegerValue; |
---|
64 | + (NSNumber *)numberWithInteger:(NSInteger)value; |
---|
65 | + (NSNumber *)numberWithUnsignedInteger:(NSUInteger)value; |
---|
66 | @end |
---|
67 | |
---|
68 | @interface NSControl (NSControl64BitCompat) |
---|
69 | - (NSInteger)integerValue; |
---|
70 | - (void)setIntegerValue:(NSInteger)anInteger; |
---|
71 | - (void)takeIntegerValueFrom:(id)sender; |
---|
72 | @end |
---|
73 | |
---|
74 | @interface NSString (NSString64BitCompat) |
---|
75 | - (NSInteger)integerValue; |
---|
76 | @end; |
---|
77 | |
---|
78 | #endif |
---|
79 | |
---|
80 | #else //Not compiling for 10.5 |
---|
81 | |
---|
82 | #if !defined(NS_REQUIRES_NIL_TERMINATION) |
---|
83 | #define NS_REQUIRES_NIL_TERMINATION __attribute__((sentinel)) |
---|
84 | #endif |
---|
85 | |
---|
86 | #endif //MAC_OS_X_VERSION_10_5 |
---|
87 | |
---|
88 | #endif //AITigerCompatibility |
---|