github.com/F4RD1N/gomobile@v1.0.1/bind/testdata/doc.objc.m.golden (about)

     1  // Objective-C API for talking to doc Go package.
     2  //   gobind -lang=objc doc
     3  //
     4  // File is generated by gobind. Do not edit.
     5  
     6  #include <Foundation/Foundation.h>
     7  #include "seq.h"
     8  #include "_cgo_export.h"
     9  #include "Doc.objc.h"
    10  
    11  
    12  @implementation DocNoDoc {
    13  }
    14  
    15  - (nonnull instancetype)initWithRef:(_Nonnull id)ref {
    16  	self = [super init];
    17  	if (self) { __ref = ref; }
    18  	return self;
    19  }
    20  
    21  - (nonnull instancetype)init {
    22  	self = [super init];
    23  	if (self) {
    24  		__ref = go_seq_from_refnum(new_doc_NoDoc());
    25  	}
    26  	return self;
    27  }
    28  
    29  @end
    30  
    31  
    32  
    33  @implementation DocS {
    34  }
    35  
    36  - (nonnull instancetype)initWithRef:(_Nonnull id)ref {
    37  	self = [super init];
    38  	if (self) { __ref = ref; }
    39  	return self;
    40  }
    41  
    42  - (instancetype)init {
    43  	self = [super init];
    44  	if (!self) return nil;
    45  	int32_t refnum = proxydoc__NewS();
    46  	__ref = go_seq_from_refnum(refnum);
    47  	return self;
    48  }
    49  
    50  - (NSString* _Nonnull)sf {
    51  	int32_t refnum = go_seq_go_to_refnum(self._ref);
    52  	nstring r0 = proxydoc_S_SF_Get(refnum);
    53  	NSString *_r0 = go_seq_to_objc_string(r0);
    54  	return _r0;
    55  }
    56  
    57  - (void)setSF:(NSString* _Nonnull)v {
    58  	int32_t refnum = go_seq_go_to_refnum(self._ref);
    59  	nstring _v = go_seq_from_objc_string(v);
    60  	proxydoc_S_SF_Set(refnum, _v);
    61  }
    62  
    63  - (DocS2* _Nullable)s2 {
    64  	int32_t refnum = go_seq_go_to_refnum(self._ref);
    65  	int32_t r0 = proxydoc_S_S2_Get(refnum);
    66  	DocS2* _r0 = nil;
    67  	GoSeqRef* _r0_ref = go_seq_from_refnum(r0);
    68  	if (_r0_ref != NULL) {
    69  		_r0 = _r0_ref.obj;
    70  		if (_r0 == nil) {
    71  			_r0 = [[DocS2 alloc] initWithRef:_r0_ref];
    72  		}
    73  	}
    74  	return _r0;
    75  }
    76  
    77  - (void)setS2:(DocS2* _Nullable)v {
    78  	int32_t refnum = go_seq_go_to_refnum(self._ref);
    79  	int32_t _v;
    80  	if ([v conformsToProtocol:@protocol(goSeqRefInterface)]) {
    81  		id<goSeqRefInterface> v_proxy = (id<goSeqRefInterface>)(v);
    82  		_v = go_seq_go_to_refnum(v_proxy._ref);
    83  	} else {
    84  		_v = go_seq_to_refnum(v);
    85  	}
    86  	proxydoc_S_S2_Set(refnum, _v);
    87  }
    88  
    89  - (NSString* _Nonnull)f1 {
    90  	int32_t refnum = go_seq_go_to_refnum(self._ref);
    91  	nstring r0 = proxydoc_S_F1_Get(refnum);
    92  	NSString *_r0 = go_seq_to_objc_string(r0);
    93  	return _r0;
    94  }
    95  
    96  - (void)setF1:(NSString* _Nonnull)v {
    97  	int32_t refnum = go_seq_go_to_refnum(self._ref);
    98  	nstring _v = go_seq_from_objc_string(v);
    99  	proxydoc_S_F1_Set(refnum, _v);
   100  }
   101  
   102  - (NSString* _Nonnull)f2 {
   103  	int32_t refnum = go_seq_go_to_refnum(self._ref);
   104  	nstring r0 = proxydoc_S_F2_Get(refnum);
   105  	NSString *_r0 = go_seq_to_objc_string(r0);
   106  	return _r0;
   107  }
   108  
   109  - (void)setF2:(NSString* _Nonnull)v {
   110  	int32_t refnum = go_seq_go_to_refnum(self._ref);
   111  	nstring _v = go_seq_from_objc_string(v);
   112  	proxydoc_S_F2_Set(refnum, _v);
   113  }
   114  
   115  - (void)after {
   116  	int32_t refnum = go_seq_go_to_refnum(self._ref);
   117  	proxydoc_S_After(refnum);
   118  }
   119  
   120  - (void)before {
   121  	int32_t refnum = go_seq_go_to_refnum(self._ref);
   122  	proxydoc_S_Before(refnum);
   123  }
   124  
   125  @end
   126  
   127  
   128  
   129  @implementation DocS2 {
   130  }
   131  
   132  - (nonnull instancetype)initWithRef:(_Nonnull id)ref {
   133  	self = [super init];
   134  	if (self) { __ref = ref; }
   135  	return self;
   136  }
   137  
   138  - (nonnull instancetype)init {
   139  	self = [super init];
   140  	if (self) {
   141  		__ref = go_seq_from_refnum(new_doc_S2());
   142  	}
   143  	return self;
   144  }
   145  
   146  @end
   147  
   148  
   149  @implementation DocI {
   150  }
   151  
   152  - (nonnull instancetype)initWithRef:(id)ref {
   153  	self = [super init];
   154  	if (self) { __ref = ref; }
   155  	return self;
   156  }
   157  
   158  - (void)im {
   159  	int32_t refnum = go_seq_go_to_refnum(self._ref);
   160  	proxydoc_I_IM(refnum);
   161  }
   162  
   163  @end
   164  
   165  
   166  const BOOL DocC = YES;
   167  
   168  @implementation Doc
   169  + (void) setNoDocVar:(double)v {
   170  	double _v = (double)v;
   171  	var_setdoc_NoDocVar(_v);
   172  }
   173  
   174  + (double) noDocVar {
   175  	double r0 = var_getdoc_NoDocVar();
   176  	double _r0 = (double)r0;
   177  	return _r0;
   178  }
   179  
   180  + (void) setSpecific:(NSString* _Nonnull)v {
   181  	nstring _v = go_seq_from_objc_string(v);
   182  	var_setdoc_Specific(_v);
   183  }
   184  
   185  + (NSString* _Nonnull) specific {
   186  	nstring r0 = var_getdoc_Specific();
   187  	NSString *_r0 = go_seq_to_objc_string(r0);
   188  	return _r0;
   189  }
   190  
   191  + (void) setV:(NSString* _Nonnull)v {
   192  	nstring _v = go_seq_from_objc_string(v);
   193  	var_setdoc_V(_v);
   194  }
   195  
   196  + (NSString* _Nonnull) v {
   197  	nstring r0 = var_getdoc_V();
   198  	NSString *_r0 = go_seq_to_objc_string(r0);
   199  	return _r0;
   200  }
   201  
   202  @end
   203  
   204  
   205  void DocF(void) {
   206  	proxydoc__F();
   207  }
   208  
   209  DocS* _Nullable DocNewS(void) {
   210  	int32_t r0 = proxydoc__NewS();
   211  	DocS* _ret0_ = nil;
   212  	GoSeqRef* _ret0__ref = go_seq_from_refnum(r0);
   213  	if (_ret0__ref != NULL) {
   214  		_ret0_ = _ret0__ref.obj;
   215  		if (_ret0_ == nil) {
   216  			_ret0_ = [[DocS alloc] initWithRef:_ret0__ref];
   217  		}
   218  	}
   219  	return _ret0_;
   220  }
   221  
   222  void cproxydoc_I_IM(int32_t refnum) {
   223  	@autoreleasepool {
   224  		DocI* o = go_seq_objc_from_refnum(refnum);
   225  		[o im];
   226  	}
   227  }
   228  
   229  __attribute__((constructor)) static void init() {
   230  	init_seq();
   231  }