github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/mobile/bind/java/testpkg/go_testpkg/go_testpkg.go (about)

     1  // Package go_testpkg is an autogenerated binder stub for package testpkg.
     2  //   gobind -lang=go golang.org/x/mobile/bind/java/testpkg
     3  //
     4  // File is generated by gobind. Do not edit.
     5  package go_testpkg
     6  
     7  import (
     8  	"golang.org/x/mobile/bind/java/testpkg"
     9  	"golang.org/x/mobile/bind/seq"
    10  )
    11  
    12  func proxy_Add(out, in *seq.Buffer) {
    13  	param_x := in.ReadInt()
    14  	param_y := in.ReadInt()
    15  	res := testpkg.Add(param_x, param_y)
    16  	out.WriteInt(res)
    17  }
    18  
    19  func proxy_Call(out, in *seq.Buffer) {
    20  	var param_i testpkg.I
    21  	param_i_ref := in.ReadRef()
    22  	if param_i_ref.Num < 0 {
    23  		param_i = param_i_ref.Get().(testpkg.I)
    24  	} else {
    25  		param_i = (*proxyI)(param_i_ref)
    26  	}
    27  	testpkg.Call(param_i)
    28  }
    29  
    30  func proxy_Err(out, in *seq.Buffer) {
    31  	param_s := in.ReadUTF16()
    32  	err := testpkg.Err(param_s)
    33  	if err == nil {
    34  		out.WriteUTF16("")
    35  	} else {
    36  		out.WriteUTF16(err.Error())
    37  	}
    38  }
    39  
    40  func proxy_GC(out, in *seq.Buffer) {
    41  	testpkg.GC()
    42  }
    43  
    44  const (
    45  	proxyIDescriptor = "go.testpkg.I"
    46  	proxyIFCode      = 0x10a
    47  )
    48  
    49  type proxyI seq.Ref
    50  
    51  func (p *proxyI) F() {
    52  	out := new(seq.Buffer)
    53  	seq.Transact((*seq.Ref)(p), proxyIFCode, out)
    54  }
    55  
    56  func proxy_Keep(out, in *seq.Buffer) {
    57  	var param_i testpkg.I
    58  	param_i_ref := in.ReadRef()
    59  	if param_i_ref.Num < 0 {
    60  		param_i = param_i_ref.Get().(testpkg.I)
    61  	} else {
    62  		param_i = (*proxyI)(param_i_ref)
    63  	}
    64  	testpkg.Keep(param_i)
    65  }
    66  
    67  func proxy_New(out, in *seq.Buffer) {
    68  	res := testpkg.New()
    69  	out.WriteGoRef(res)
    70  }
    71  
    72  func proxy_NumSCollected(out, in *seq.Buffer) {
    73  	res := testpkg.NumSCollected()
    74  	out.WriteInt(res)
    75  }
    76  
    77  const (
    78  	proxySDescriptor = "go.testpkg.S"
    79  	proxySFCode      = 0x00c
    80  )
    81  
    82  type proxyS seq.Ref
    83  
    84  func proxySF(out, in *seq.Buffer) {
    85  	ref := in.ReadRef()
    86  	v := ref.Get().(*testpkg.S)
    87  	v.F()
    88  }
    89  
    90  func init() {
    91  	seq.Register(proxySDescriptor, proxySFCode, proxySF)
    92  }
    93  
    94  func proxy_StrDup(out, in *seq.Buffer) {
    95  	param_s := in.ReadUTF16()
    96  	res := testpkg.StrDup(param_s)
    97  	out.WriteUTF16(res)
    98  }
    99  
   100  func init() {
   101  	seq.Register("testpkg", 1, proxy_Add)
   102  	seq.Register("testpkg", 2, proxy_Call)
   103  	seq.Register("testpkg", 3, proxy_Err)
   104  	seq.Register("testpkg", 4, proxy_GC)
   105  	seq.Register("testpkg", 5, proxy_Keep)
   106  	seq.Register("testpkg", 6, proxy_New)
   107  	seq.Register("testpkg", 7, proxy_NumSCollected)
   108  	seq.Register("testpkg", 8, proxy_StrDup)
   109  }