Multiple packages are already supported, but only as if each packages were bound in isolation. This CL lets a bound package refer to other bound packages in its exported functions, types and fields. In Java, the JNI class jclass and constructor jmethodID are exported so other packages can construct proxies of other packages' interfaces. In ObjC, the class @interface declarations are moved from the package .m file to its .h file to allow other packages to constructs its interface proxies. Add a supporting test package, secondpkg, and add Java and ObjC tests for the new cross package functionality. Also add simplepkg for testing corner cases where the generated Go file must not include its bound package. While we're here, stop generating Go proxy types for struct types; only Go interfaces can be implemented in the foreign language. Change-Id: Icbfa739c893703867d38a9100ed0928fbd7a660d Reviewed-on: https://go-review.googlesource.com/20575 Reviewed-by: David Crawshaw <crawshaw@golang.org>
101 lines
1.9 KiB
Plaintext
101 lines
1.9 KiB
Plaintext
// Objective-C API for talking to interfaces Go package.
|
|
// gobind -lang=objc interfaces
|
|
//
|
|
// File is generated by gobind. Do not edit.
|
|
|
|
#ifndef __GoInterfaces_H__
|
|
#define __GoInterfaces_H__
|
|
|
|
#include <Foundation/Foundation.h>
|
|
|
|
@protocol GoInterfacesError;
|
|
@class GoInterfacesError;
|
|
@protocol GoInterfacesI;
|
|
@class GoInterfacesI;
|
|
@protocol GoInterfacesI1;
|
|
@protocol GoInterfacesI2;
|
|
@protocol GoInterfacesI3;
|
|
@class GoInterfacesI3;
|
|
@protocol GoInterfacesWithParam;
|
|
@class GoInterfacesWithParam;
|
|
|
|
@protocol GoInterfacesError
|
|
- (BOOL)err:(NSError**)error;
|
|
@end
|
|
|
|
@protocol GoInterfacesI
|
|
- (int32_t)rand;
|
|
@end
|
|
|
|
@interface GoInterfacesI1 : NSObject {
|
|
}
|
|
@property(strong, readonly) id _ref;
|
|
|
|
- (id)initWithRef:(id)ref;
|
|
- (void)j;
|
|
@end
|
|
|
|
@interface GoInterfacesI2 : NSObject {
|
|
}
|
|
@property(strong, readonly) id _ref;
|
|
|
|
- (id)initWithRef:(id)ref;
|
|
- (void)g;
|
|
@end
|
|
|
|
@protocol GoInterfacesI3
|
|
- (GoInterfacesI1*)f;
|
|
@end
|
|
|
|
@protocol GoInterfacesWithParam
|
|
- (void)hasParam:(BOOL)p0;
|
|
@end
|
|
|
|
FOUNDATION_EXPORT int32_t GoInterfacesAdd3(id<GoInterfacesI> r);
|
|
|
|
FOUNDATION_EXPORT BOOL GoInterfacesCallErr(id<GoInterfacesError> e, NSError** error);
|
|
|
|
FOUNDATION_EXPORT id<GoInterfacesI> GoInterfacesSeven();
|
|
|
|
@class GoInterfacesError;
|
|
|
|
@class GoInterfacesI;
|
|
|
|
@class GoInterfacesI3;
|
|
|
|
@class GoInterfacesWithParam;
|
|
|
|
@interface GoInterfacesError : NSObject <GoInterfacesError> {
|
|
}
|
|
@property(strong, readonly) id _ref;
|
|
|
|
- (id)initWithRef:(id)ref;
|
|
- (BOOL)err:(NSError**)error;
|
|
@end
|
|
|
|
@interface GoInterfacesI : NSObject <GoInterfacesI> {
|
|
}
|
|
@property(strong, readonly) id _ref;
|
|
|
|
- (id)initWithRef:(id)ref;
|
|
- (int32_t)rand;
|
|
@end
|
|
|
|
@interface GoInterfacesI3 : NSObject <GoInterfacesI3> {
|
|
}
|
|
@property(strong, readonly) id _ref;
|
|
|
|
- (id)initWithRef:(id)ref;
|
|
- (GoInterfacesI1*)f;
|
|
@end
|
|
|
|
@interface GoInterfacesWithParam : NSObject <GoInterfacesWithParam> {
|
|
}
|
|
@property(strong, readonly) id _ref;
|
|
|
|
- (id)initWithRef:(id)ref;
|
|
- (void)hasParam:(BOOL)p0;
|
|
@end
|
|
|
|
#endif
|