source: orbit/iOS/Orbit/Orbit/CorePlotHeaders/CPTDefinitions.h @ f323fb4

Raw_EEG_Plot
Last change on this file since f323fb4 was a9059a5, checked in by Steve Castellotti <sc@…>, 9 years ago

Arduino:

  • updated to permit custom setting of Throttle, Yaw, and Pitch

Android:

  • Minor tweak to Configuration location

iOS:

  • Property mode set to 100644
File size: 5.7 KB
Line 
1#import <Foundation/Foundation.h>
2#import <QuartzCore/QuartzCore.h>
3
4#import <Availability.h>
5#import <TargetConditionals.h>
6
7/// @file
8
9/**
10 *  @def CPT_SDK_SUPPORTS_WEAK
11 *  @hideinitializer
12 *  @brief Defined as @num{1} if the compiler and active SDK support weak references, @num{0} otherwise.
13 **/
14
15/**
16 *  @def __cpt_weak
17 *  @hideinitializer
18 *  @brief A custom definition for automatic reference counting (ARC) weak references that falls back to
19 *  <code>__unsafe_unretained</code> values on older platforms.
20 **/
21
22/**
23 *  @def cpt_weak_property
24 *  @hideinitializer
25 *  @brief A custom definition for automatic reference counting (ARC) weak properties that falls back to
26 *  <code>assign</code> on older platforms.
27 **/
28
29// This is based on Ryan Petrich's ZWRCompatibility: https://github.com/rpetrich/ZWRCompatibility
30
31#if TARGET_OS_IPHONE && defined(__IPHONE_5_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_5_0) && __clang__ && (__clang_major__ >= 3)
32#define CPT_SDK_SUPPORTS_WEAK 1
33#elif TARGET_OS_MAC && defined(__MAC_10_7) && (MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_7) && __clang__ && (__clang_major__ >= 3)
34#define CPT_SDK_SUPPORTS_WEAK 1
35#else
36#define CPT_SDK_SUPPORTS_WEAK 0
37#endif
38
39#if CPT_SDK_SUPPORTS_WEAK
40#define __cpt_weak        __weak
41#define cpt_weak_property weak
42#else
43#if __clang__ && (__clang_major__ >= 3)
44#define __cpt_weak __unsafe_unretained
45#else
46#define __cpt_weak
47#endif
48#define cpt_weak_property assign
49#endif
50
51// Type safety defines
52
53/**
54 *  @def CPTFloat
55 *  @hideinitializer
56 *  @param x The number to cast.
57 *  @brief Casts a number to @ref CGFloat.
58 **/
59#define CPTFloat(x) ( (CGFloat)(x) )
60
61/**
62 *  @def CPTPointMake
63 *  @hideinitializer
64 *  @param x The x-coordinate of the point.
65 *  @param y The y-coordinate of the point.
66 *  @brief A replacement for @ref CGPointMake(), casting each parameter to @ref CGFloat.
67 **/
68#define CPTPointMake(x, y) CGPointMake( (CGFloat)(x), (CGFloat)(y) )
69
70/**
71 *  @def CPTSizeMake
72 *  @hideinitializer
73 *  @param w The width of the size.
74 *  @param h The height of the size.
75 *  @brief A replacement for @ref CGSizeMake(), casting each parameter to @ref CGFloat.
76 **/
77#define CPTSizeMake(w, h) CGSizeMake( (CGFloat)(w), (CGFloat)(h) )
78
79/**
80 *  @def CPTRectMake
81 *  @hideinitializer
82 *  @param x The x-coordinate of the rectangle.
83 *  @param y The y-coordinate of the rectangle.
84 *  @param w The width of the rectangle.
85 *  @param h The height of the rectangle.
86 *  @brief A replacement for @ref CGRectMake(), casting each parameter to @ref CGFloat.
87 **/
88#define CPTRectMake(x, y, w, h) CGRectMake( (CGFloat)(x), (CGFloat)(y), (CGFloat)(w), (CGFloat)(h) )
89
90/**
91 *  @def CPTRectInset
92 *  @hideinitializer
93 *  @param rect The rectangle to offset.
94 *  @param dx The x-offset.
95 *  @param dy The y-offset.
96 *  @brief A replacement for @ref CGRectInset(), casting each offset parameter to @ref CGFloat.
97 **/
98#define CPTRectInset(rect, dx, dy) CGRectInset( rect, (CGFloat)(dx), (CGFloat)(dy) )
99
100/**
101 *  @brief Enumeration of numeric types
102 **/
103typedef enum  _CPTNumericType {
104    CPTNumericTypeInteger, ///< Integer
105    CPTNumericTypeFloat,   ///< Float
106    CPTNumericTypeDouble   ///< Double
107}
108CPTNumericType;
109
110/**
111 *  @brief Enumeration of error bar types
112 **/
113typedef enum _CPTErrorBarType {
114    CPTErrorBarTypeCustom,        ///< Custom error bars
115    CPTErrorBarTypeConstantRatio, ///< Constant ratio error bars
116    CPTErrorBarTypeConstantValue  ///< Constant value error bars
117}
118CPTErrorBarType;
119
120/**
121 *  @brief Enumeration of axis scale types
122 **/
123typedef enum _CPTScaleType {
124    CPTScaleTypeLinear,   ///< Linear axis scale
125    CPTScaleTypeLog,      ///< Logarithmic axis scale
126    CPTScaleTypeAngular,  ///< Angular axis scale (not implemented)
127    CPTScaleTypeDateTime, ///< Date/time axis scale (not implemented)
128    CPTScaleTypeCategory  ///< Category axis scale (not implemented)
129}
130CPTScaleType;
131
132/**
133 *  @brief Enumeration of axis coordinates
134 **/
135typedef enum _CPTCoordinate {
136    CPTCoordinateX = 0, ///< X axis
137    CPTCoordinateY = 1, ///< Y axis
138    CPTCoordinateZ = 2  ///< Z axis
139}
140CPTCoordinate;
141
142/**
143 *  @brief RGBA color for gradients
144 **/
145typedef struct _CPTRGBAColor {
146    CGFloat red;   ///< The red component (0 ≀ @par{red} ≀ 1).
147    CGFloat green; ///< The green component (0 ≀ @par{green} ≀ 1).
148    CGFloat blue;  ///< The blue component (0 ≀ @par{blue} ≀ 1).
149    CGFloat alpha; ///< The alpha component (0 ≀ @par{alpha} ≀ 1).
150}
151CPTRGBAColor;
152
153/**
154 *  @brief Enumeration of label positioning offset directions
155 **/
156typedef enum _CPTSign {
157    CPTSignNone     = 0,  ///< No offset
158    CPTSignPositive = +1, ///< Positive offset
159    CPTSignNegative = -1  ///< Negative offset
160}
161CPTSign;
162
163/**
164 *  @brief Locations around the edge of a rectangle.
165 **/
166typedef enum _CPTRectAnchor {
167    CPTRectAnchorBottomLeft,  ///< The bottom left corner
168    CPTRectAnchorBottom,      ///< The bottom center
169    CPTRectAnchorBottomRight, ///< The bottom right corner
170    CPTRectAnchorLeft,        ///< The left middle
171    CPTRectAnchorRight,       ///< The right middle
172    CPTRectAnchorTopLeft,     ///< The top left corner
173    CPTRectAnchorTop,         ///< The top center
174    CPTRectAnchorTopRight,    ///< The top right
175    CPTRectAnchorCenter       ///< The center of the rect
176}
177CPTRectAnchor;
178
179/**
180 *  @brief Label and constraint alignment constants.
181 **/
182typedef enum _CPTAlignment {
183    CPTAlignmentLeft,   ///< Align horizontally to the left side.
184    CPTAlignmentCenter, ///< Align horizontally to the center.
185    CPTAlignmentRight,  ///< Align horizontally to the right side.
186    CPTAlignmentTop,    ///< Align vertically to the top.
187    CPTAlignmentMiddle, ///< Align vertically to the middle.
188    CPTAlignmentBottom  ///< Align vertically to the bottom.
189}
190CPTAlignment;
Note: See TracBrowser for help on using the repository browser.