1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
|
@import ObjectiveC;
@import Foundation;
#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
#define NS_CONSUMES_SELF __attribute__((ns_consumes_self))
#define NS_CONSUMED __attribute__((ns_consumed))
struct Rect {
float x;
float y;
float width;
float height;
};
struct NSRect {
struct NSPoint {
double x;
double y;
} origin;
struct NSSize {
double width;
double height;
} size;
};
struct Fob {
unsigned long a;
unsigned b;
unsigned c;
unsigned long d;
} Fob;
typedef long NSInteger;
@interface Gizmo : NSObject
- (Gizmo*) clone NS_RETURNS_RETAINED;
- (Gizmo*) duplicate;
- (Gizmo*) initWithBellsOn:(NSInteger)x;
- (void) fork NS_CONSUMES_SELF;
- (void) enumerateSubGizmos: (void (^)(Gizmo*))f;
+ (void) consume: (NS_CONSUMED Gizmo*) gizmo;
+ (void) inspect: (Gizmo*) gizmo;
+ (void) runWithRect: (struct Rect) rect andGizmo: (Gizmo*) gizmo;
- (struct NSRect) frame;
- (void) setFrame: (struct NSRect) rect;
- (void) frob;
- (void) test: (struct Fob) fob;
- (void) perform: (void (^)(NS_CONSUMED Gizmo*)) block;
+ (void) runce;
@end
@interface BaseClassForMethodFamilies : NSObject
- (BaseClassForMethodFamilies *)fakeInitFamily __attribute__((objc_method_family(init)));
@end
static inline int innerZero(void) { return 0; }
static inline int zero(void) { return innerZero(); }
static inline int wrappedZero(void) { return zero(); }
static inline int alwaysInlineNumber(void) __attribute__((always_inline)) {
return 17;
}
extern int getInt(void);
static inline int wrappedGetInt(void) { return getInt(); }
static inline int zeroRedeclared(void);
static inline int wrappedZeroRedeclared(void) { return zeroRedeclared(); }
static inline int zeroRedeclared(void) { return innerZero(); }
static int staticButNotInline(void) { return innerZero(); }
static inline void ackbar(void) { __builtin_trap(); }
@interface NSView : NSObject
- (struct NSRect) convertRectFromBase: (struct NSRect) r;
@end
struct NSRect NSMakeRect(double, double, double, double);
struct NSRect NSInsetRect(struct NSRect, double, double);
NSString *NSStringFromRect(struct NSRect r);
@protocol NSRuncing
- (void)runce;
- (void)foo;
@end
@protocol NSFunging
- (void)funge;
- (void)foo;
@end
@interface NSSpoon <NSRuncing, NSFunging>
- (void)runce;
- (void)funge;
- (void)foo;
@end
@protocol NSFungingAndRuncing <NSRuncing, NSFunging>
@end
@protocol NSDoubleInheritedFunging <NSFungingAndRuncing, NSFunging>
@end
typedef NS_ENUM(unsigned short, NSRuncingOptions) {
NSRuncingMince = 123,
NSRuncingQuinceSliced = 4567,
NSRuncingQuinceJulienned = 5678,
NSRuncingQuinceDiced = 6789,
};
typedef NS_ENUM(int, NSRadixedOptions) {
NSRadixedOctal = 0755,
NSRadixedHex = 0xFFFF,
};
typedef NS_ENUM(int, NSNegativeOptions) {
NSNegativeFoo = -1,
NSNegativeBar = -0x7FFFFFFF - 1,
};
typedef NS_ENUM(unsigned, NSNegativeUnsignedOptions) {
NSNegativeUnsignedFoo = -1,
NSNegativeUnsignedBar = -0x7FFFFFFF - 1,
};
typedef NS_ENUM(unsigned, NeverActuallyMentionedByName) {
ValueOfThatEnumType = 5
};
@interface TestThatEnumType
- (instancetype)init;
- (NeverActuallyMentionedByName)getValue;
@end
#if defined(_WIN32)
enum RawEnumInGizmo : unsigned {
InGizmoOne=0x7FFFFFFF,
InGizmoTwo,
InGizmoThree
};
#else
enum RawEnumInGizmo {
InGizmoOne=0x7FFFFFFF,
InGizmoTwo,
InGizmoThree
};
#endif
struct StructOfNSStrings {
__unsafe_unretained NSString *a;
__unsafe_unretained NSString *b;
__unsafe_unretained NSString *c;
__unsafe_unretained NSString *d;
};
struct StructOfNSStrings useStructOfNSStringsInObjC(struct StructOfNSStrings);
@interface OuterType : NSObject
@end
__attribute__((swift_name("OuterType.InnerType")))
@interface OuterTypeInnerType : NSObject<NSRuncing>
@end
@protocol P
- (oneway void)stuff;
@end
@interface ObjcGenericClass<__covariant SectionType>
@end
@interface FungingArray <Element: id<NSFunging>> : NSObject
@end
__attribute__((objc_non_runtime_protocol))
@protocol NonRuntimeP
@end
@protocol RuntimeP<NonRuntimeP>
@end
@protocol P1
@end
@protocol P2
@end
@protocol P3
@end
__attribute__((objc_non_runtime_protocol))
@protocol AnotherNonRuntimeP<P1, P2, P3>
@end
__attribute__((objc_non_runtime_protocol))
@protocol AnotherNonRuntime2P<P1, P2>
@end
__attribute__((objc_non_runtime_protocol))
@protocol OtherNonRuntimeP <AnotherNonRuntimeP, AnotherNonRuntime2P>
@end
@protocol Runtime2P<NonRuntimeP, OtherNonRuntimeP, P3>
@end
@protocol DeclarationOnly;
@protocol DeclarationOnlyUser<DeclarationOnly>
- (void) printIt;
@end
|