github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/mobile/bind/testdata/issue10788.objc.m.golden (about) 1 // Objective-C API for talking to issue10788 Go package. 2 // gobind -lang=objc issue10788 3 // 4 // File is generated by gobind. Do not edit. 5 6 #include "GoIssue10788.h" 7 #include <Foundation/Foundation.h> 8 #include "seq.h" 9 10 static NSString* errDomain = @"go.issue10788"; 11 12 @protocol goSeqRefInterface 13 -(GoSeqRef*) _ref; 14 @end 15 16 #define _DESCRIPTOR_ "issue10788" 17 18 @class GoIssue10788TestInterface; 19 20 @interface GoIssue10788TestInterface : NSObject <GoIssue10788TestInterface> { 21 } 22 @property(strong, readonly) id _ref; 23 24 - (id)initWithRef:(id)ref; 25 - (void)doSomeWork:(GoIssue10788TestStruct*)s; 26 - (void)multipleUnnamedParams:(int)p0 p1:(NSString*)p1 p2:(int64_t)p2; 27 @end 28 29 #define _GO_issue10788_TestStruct_DESCRIPTOR_ "go.issue10788.TestStruct" 30 #define _GO_issue10788_TestStruct_FIELD_Value_GET_ (0x00f) 31 #define _GO_issue10788_TestStruct_FIELD_Value_SET_ (0x01f) 32 33 @implementation GoIssue10788TestStruct { 34 } 35 36 - (id)initWithRef:(id)ref { 37 self = [super init]; 38 if (self) { __ref = ref; } 39 return self; 40 } 41 42 - (NSString*)value { 43 GoSeq in_ = {}; 44 GoSeq out_ = {}; 45 go_seq_writeRef(&in_, self._ref); 46 go_seq_send(_GO_issue10788_TestStruct_DESCRIPTOR_, _GO_issue10788_TestStruct_FIELD_Value_GET_, &in_, &out_); 47 NSString* ret_ = go_seq_readUTF8(&out_); 48 go_seq_free(&in_); 49 go_seq_free(&out_); 50 return ret_; 51 } 52 53 - (void)setValue:(NSString*)v { 54 GoSeq in_ = {}; 55 GoSeq out_ = {}; 56 go_seq_writeRef(&in_, self._ref); 57 go_seq_writeUTF8(&in_, v); 58 go_seq_send(_GO_issue10788_TestStruct_DESCRIPTOR_, _GO_issue10788_TestStruct_FIELD_Value_SET_, &in_, &out_); 59 go_seq_free(&in_); 60 go_seq_free(&out_); 61 } 62 63 @end 64 65 #define _GO_issue10788_TestInterface_DESCRIPTOR_ "go.issue10788.TestInterface" 66 #define _GO_issue10788_TestInterface_DoSomeWork_ (0x10a) 67 #define _GO_issue10788_TestInterface_MultipleUnnamedParams_ (0x20a) 68 69 @implementation GoIssue10788TestInterface { 70 } 71 72 - (id)initWithRef:(id)ref { 73 self = [super init]; 74 if (self) { __ref = ref; } 75 return self; 76 } 77 78 - (void)doSomeWork:(GoIssue10788TestStruct*)s { 79 GoSeq in_ = {}; 80 GoSeq out_ = {}; 81 go_seq_writeRef(&in_, self._ref); 82 if ([(id<NSObject>)(s) isKindOfClass:[GoIssue10788TestStruct class]]) { 83 id<goSeqRefInterface> s_proxy = (id<goSeqRefInterface>)(s); 84 go_seq_writeRef(&in_, s_proxy._ref); 85 } else { 86 go_seq_writeObjcRef(&in_, s); 87 } 88 go_seq_send(_GO_issue10788_TestInterface_DESCRIPTOR_, _GO_issue10788_TestInterface_DoSomeWork_, &in_, &out_); 89 go_seq_free(&in_); 90 go_seq_free(&out_); 91 } 92 93 - (void)multipleUnnamedParams:(int)p0 p1:(NSString*)p1 p2:(int64_t)p2 { 94 GoSeq in_ = {}; 95 GoSeq out_ = {}; 96 go_seq_writeRef(&in_, self._ref); 97 go_seq_writeInt(&in_, p0); 98 go_seq_writeUTF8(&in_, p1); 99 go_seq_writeInt64(&in_, p2); 100 go_seq_send(_GO_issue10788_TestInterface_DESCRIPTOR_, _GO_issue10788_TestInterface_MultipleUnnamedParams_, &in_, &out_); 101 go_seq_free(&in_); 102 go_seq_free(&out_); 103 } 104 105 @end 106 107 static void proxyGoIssue10788TestInterface(id obj, int code, GoSeq* in, GoSeq* out) { 108 switch (code) { 109 case _GO_issue10788_TestInterface_DoSomeWork_: { 110 id<GoIssue10788TestInterface> o = (id<GoIssue10788TestInterface>)(obj); 111 GoSeqRef* s_ref = go_seq_readRef(in); 112 GoIssue10788TestStruct* s = s_ref.obj; 113 if (s == NULL) { 114 s = [[GoIssue10788TestStruct alloc] initWithRef:s_ref]; 115 } 116 [o doSomeWork:s]; 117 } break; 118 case _GO_issue10788_TestInterface_MultipleUnnamedParams_: { 119 id<GoIssue10788TestInterface> o = (id<GoIssue10788TestInterface>)(obj); 120 int p0 = go_seq_readInt(in); 121 NSString* p1 = go_seq_readUTF8(in); 122 int64_t p2 = go_seq_readInt64(in); 123 [o multipleUnnamedParams:p0 p1:p1 p2:p2]; 124 } break; 125 default: 126 NSLog(@"unknown code %x for _GO_issue10788_TestInterface_DESCRIPTOR_", code); 127 } 128 } 129 130 131 __attribute__((constructor)) static void init() { 132 go_seq_register_proxy("go.issue10788.TestInterface", proxyGoIssue10788TestInterface); 133 }