|
| 1 | +#define __CF_OPTIONS_ATTRIBUTES __attribute__((flag_enum,enum_extensibility(open))) |
| 2 | +#if (__cplusplus) |
| 3 | +#define CF_OPTIONS(_type, _name) __attribute__((availability(swift,unavailable))) _type _name; enum __CF_OPTIONS_ATTRIBUTES : _name |
| 4 | +#else |
| 5 | +#define CF_OPTIONS(_type, _name) enum __CF_OPTIONS_ATTRIBUTES _name : _type _name; enum _name : _type |
| 6 | +#endif |
| 7 | + |
| 8 | + |
| 9 | +#define NS_OPTIONS(_type, _name) CF_OPTIONS(_type, _name) |
| 10 | +typedef unsigned long NSUInteger; |
| 11 | +typedef NS_OPTIONS(NSUInteger, UIControlState) { |
| 12 | + UIControlStateNormal = 0, |
| 13 | + UIControlStateHighlighted = 1 << 0, // used when UIControl isHighlighted is set |
| 14 | +}; |
| 15 | + |
| 16 | +#define NS_SWIFT_UI_ACTOR __attribute__((swift_attr("@UIActor"))) |
| 17 | +#define __API_AVAILABLE_PLATFORM_macos(x) macos,introduced=x |
| 18 | +#define __API_AVAILABLE_PLATFORM_macosx(x) macosx,introduced=x |
| 19 | +#define __API_AVAILABLE_PLATFORM_ios(x) ios,introduced=x |
| 20 | +#define __API_AVAILABLE_PLATFORM_watchos(x) watchos,introduced=x |
| 21 | +#define __API_AVAILABLE_PLATFORM_tvos(x) tvos,introduced=x |
| 22 | +#define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x |
| 23 | +#define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x |
| 24 | +#define __API_AVAILABLE_PLATFORM_uikitformac(x) uikitformac,introduced=x |
| 25 | +#define __API_AVAILABLE_PLATFORM_driverkit(x) driverkit,introduced=x |
| 26 | +#define __API_A(x) __attribute__((availability(__API_AVAILABLE_PLATFORM_##x))) |
| 27 | +#define __API_AVAILABLE1(x) __API_A(x) |
| 28 | +#define __API_AVAILABLE2(x,y) __API_A(x) __API_A(y) |
| 29 | +#define __API_AVAILABLE3(x,y,z) __API_A(x) __API_A(y) __API_A(z) |
| 30 | +#define __API_AVAILABLE4(x,y,z,t) __API_A(x) __API_A(y) __API_A(z) __API_A(t) |
| 31 | +#define __API_AVAILABLE5(x,y,z,t,b) __API_A(x) __API_A(y) __API_A(z) __API_A(t) __API_A(b) |
| 32 | +#define __API_AVAILABLE6(x,y,z,t,b,m) __API_A(x) __API_A(y) __API_A(z) __API_A(t) __API_A(b) __API_A(m) |
| 33 | +#define __API_AVAILABLE7(x,y,z,t,b,m,d) __API_A(x) __API_A(y) __API_A(z) __API_A(t) __API_A(b) __API_A(m) __API_A(d) |
| 34 | +#define __API_AVAILABLE8(x,y,z,t,b,m,d,l) __API_A(x) __API_A(y) __API_A(z) __API_A(t) __API_A(b) __API_A(m) __API_A(d) __API_A(l) |
| 35 | +#define __API_AVAILABLE_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME |
| 36 | +#define API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE8, __API_AVAILABLE7, __API_AVAILABLE6, __API_AVAILABLE5, __API_AVAILABLE4, __API_AVAILABLE3, __API_AVAILABLE2, __API_AVAILABLE1, 0)(__VA_ARGS__) |
| 37 | + |
| 38 | +#ifdef __cplusplus |
| 39 | +#define UIKIT_EXTERN extern "C" __attribute__((visibility ("default"))) |
| 40 | +#else |
| 41 | +#define UIKIT_EXTERN extern __attribute__((visibility ("default"))) |
| 42 | +#endif |
| 43 | + |
| 44 | +@interface UIView |
| 45 | +@end |
| 46 | + |
| 47 | +UIKIT_EXTERN API_AVAILABLE(ios(2.0)) NS_SWIFT_UI_ACTOR |
| 48 | +@interface UIControl : UIView |
| 49 | +@end |
| 50 | + |
0 commit comments