Commit Graph

16 Commits

Author SHA1 Message Date
Hyang-Ah (Hana) Kim 6fb2670129 bind/objc: Remove reference of seq.h from generated header file.
This allows gomobile bind to stop copying seq.h to the destination.

Change-Id: I4a23613fe0407500ad483ae9d8f6bb823d82f082
Reviewed-on: https://go-review.googlesource.com/12300
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-16 14:02:16 +00:00
Hyang-Ah (Hana) Kim a922dd97b1 bind/objc: remove '_' after Go<pkgname> prefix from names.
Before this change, func Hello() of mypkg package generated a function
GoMypkg_Hello to distinguish the prefix from the function name.
It seems the use of '_' is very rare in Objective-C though.
After this change, it generates GoMypkgHello.

Change-Id: Ic7aa2b667363a447a5ff3500262502d3137d6853
Reviewed-on: https://go-review.googlesource.com/11893
Reviewed-by: Damien Neil <dneil@google.com>
2015-07-07 03:29:17 +00:00
James Schofield 5878957524 mobile/bind: Fix objc bindings for multiple return vals.
The existing implementation generates uncompilable objc code for
functions returning two results.

Change-Id: I13f7329596d8fa6103c4b7827c26c5461e16a925
Reviewed-on: https://go-review.googlesource.com/11364
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-06-24 18:25:43 +00:00
Hyang-Ah (Hana) Kim 3a9b5b50ac bind: correct methods' return arg type mapping in obj-c binding.
Change-Id: Ieda05982c7f894c5603103b8890658e682e97423
Reviewed-on: https://go-review.googlesource.com/11307
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-06-23 13:13:31 +00:00
Hyang-Ah (Hana) Kim d7fb1ce757 bind: fix a bug in handling func returning a struct.
Change-Id: I63963c20c283638cfdc86b037f6aff70a115a78c
Reviewed-on: https://go-review.googlesource.com/10893
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-06-11 17:32:32 +00:00
Hyang-Ah (Hana) Kim 8f4eb9eb49 bind: add objective-c code generator.
Translate error type to NSError.
Interface type is not supported yet.

Change-Id: I54abba2360cff41ef8ca08063b0120e7edd65a47
Reviewed-on: https://go-review.googlesource.com/10793
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
2015-06-09 20:58:21 +00:00
David Crawshaw f373bd373c bind: rename parameter p
Fixes golang/go#11064.

Change-Id: Idb4376f0143b0d1c8e87e7ccc54aae343b504e4a
Reviewed-on: https://go-review.googlesource.com/10689
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-06-04 17:29:43 +00:00
Hyang-Ah (Hana) Kim cc98479faf bind: make generated names less go-like to avoid name collision.
Change-Id: Ib3f27ceb38ae0d2416e8aef6f3ffe81c7f6c9044
Reviewed-on: https://go-review.googlesource.com/10550
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-05-29 19:58:06 +00:00
Hyang-Ah (Hana) Kim 6d80e5a85f bind: support Bool types.
Also add missing int8/int16 handling in bind/seq.

Fixes golang/go#10855.

Change-Id: I326ada44df10fc3c22628bdd2ae4ee2c3dc7902e
Reviewed-on: https://go-review.googlesource.com/10046
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-05-14 22:17:57 +00:00
Hyang-Ah (Hana) Kim b658bfdf39 bind: support reference types as struct fields.
Reference types here mean pointers to struct types and
exported interface types. Previously, gobind generated invalid
go/java sources.

Change-Id: Icd666ebbb8edb70c613311798d602fd88cb4479c
Reviewed-on: https://go-review.googlesource.com/9997
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-05-14 19:48:46 +00:00
Hyang-Ah (Hana) Kim 4f4272d70b bind: fix Java code generation that takes reference type params.
Also fixes a parameter name handling problem when processing a
function signature that omits parameter names.

Fixes golang/go#10788.

Change-Id: I65273d330bbf3a836ec9e4ffb691927970d795d8
Reviewed-on: https://go-review.googlesource.com/9926
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-05-12 22:05:40 +00:00
Hyang-Ah (Hana) Kim 334412418f bind: replace {Read,Write}UTF16 with {Read,Write}String for string.
This is to enable more flexible encoding/decoding of Go string.
For Java, we use UTF16 to be compatible with java string.
For other languages, we will want other way to represent a string.

Change-Id: Iccd53e2eea18d37636c3c619d06cb473facef0cd
Reviewed-on: https://go-review.googlesource.com/8628
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-04-09 12:44:56 +00:00
Hyang-Ah Hana Kim 2b3c96656c cmd/gobind: implement interface method binding.
This change makes gobind to generate proper Go-side proxy code to
handle interface methods that have parameters and return values.

It allows gobind to accept struct pointer types as parameters
or a return value of a method.

Fixes golang/go#9487, golang/go#9488.

Change-Id: Id243c42ee0701d40e3871e392140368c2f8f9bc6
Reviewed-on: https://go-review.googlesource.com/2348
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-01-07 18:26:42 +00:00
Hyang-Ah Hana Kim b2e453e1cd bind/java: support byte arrays.
Fixes golang/go#9338.

Change-Id: I6e2af67cdf7f923963fa525b944613a91aac994e
Reviewed-on: https://go-review.googlesource.com/1884
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2014-12-19 20:07:11 +00:00
Hana Kim 32f2370535 go.mobile/bind: include the bind invocation command in generated files.
This change also updates bind/testdata/*.golden.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/167160043
2014-11-10 13:46:47 -05:00
David Crawshaw 9f144f9410 go.mobile/bind: language binding generator
Details: http://golang.org/s/gobind

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/118240044
2014-07-31 15:09:13 -04:00