summary refs log tree commit diff stats
path: root/libs/cocos2d/Platforms/CCNS.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/cocos2d/Platforms/CCNS.h')
-rwxr-xr-xlibs/cocos2d/Platforms/CCNS.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/libs/cocos2d/Platforms/CCNS.h b/libs/cocos2d/Platforms/CCNS.h new file mode 100755 index 0000000..c595a18 --- /dev/null +++ b/libs/cocos2d/Platforms/CCNS.h
@@ -0,0 +1,78 @@
1/*
2 * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 *
4 * Copyright (c) 2010 Ricardo Quesada
5 * Copyright (c) 2011 Zynga Inc.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE.
24 */
25
26//
27// Common layer for NS (Next-Step) stuff
28//
29
30#import <Availability.h>
31
32#import <Foundation/Foundation.h> // for NSObject
33
34#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
35
36#define CCRectFromString(__r__) CGRectFromString(__r__)
37#define CCPointFromString(__p__) CGPointFromString(__p__)
38#define CCSizeFromString(__s__) CGSizeFromString(__s__)
39#define CCNSSizeToCGSize
40#define CCNSRectToCGRect
41#define CCNSPointToCGPoint
42#define CCTextAlignment UITextAlignment
43#define CCTextAlignmentCenter UITextAlignmentCenter
44#define CCTextAlignmentLeft UITextAlignmentLeft
45#define CCTextAlignmentRight UITextAlignmentRight
46#define CCLineBreakMode UILineBreakMode
47#define CCLineBreakModeWordWrap UILineBreakModeWordWrap
48#define CCLineBreakModeCharacterWrap UILineBreakModeCharacterWrap
49#define CCLineBreakModeClip UILineBreakModeClip
50#define CCLineBreakModeHeadTruncation UILineBreakModeHeadTruncation
51#define CCLineBreakModeTailTruncation UILineBreakModeTailTruncation
52#define CCLineBreakModeMiddleTruncation UILineBreakModeMiddleTruncation
53
54
55
56#elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
57
58#define CCRectFromString(__r__) NSRectToCGRect( NSRectFromString(__r__) )
59#define CCPointFromString(__p__) NSPointToCGPoint( NSPointFromString(__p__) )
60#define CCSizeFromString(__s__) NSSizeToCGSize( NSSizeFromString(__s__) )
61#define CCNSSizeToCGSize NSSizeToCGSize
62#define CCNSRectToCGRect NSRectToCGRect
63#define CCNSPointToCGPoint NSPointToCGPoint
64#define CCTextAlignment NSTextAlignment
65#define CCTextAlignmentCenter NSCenterTextAlignment
66#define CCTextAlignmentLeft NSLeftTextAlignment
67#define CCTextAlignmentRight NSRightTextAlignment
68#define CCLineBreakMode NSLineBreakMode
69#define CCLineBreakModeWordWrap NSLineBreakByWordWrapping
70#define CCLineBreakModeClip -1
71#define CCLineBreakModeHeadTruncation -1
72#define CCLineBreakModeTailTruncation -1
73#define CCLineBreakModeMiddleTruncation -1
74
75
76#endif
77
78