Commit Graph

27 Commits

Author SHA1 Message Date
ac9eecafd8 Convert all Go wrapped objects to pointers so the Go GC can track
all of the Objective-C pointers. Still working on bug with typedefs
to wrapped types.
2019-06-13 09:25:53 -04:00
9a4fabda24 Run gofmt -w on everything. Add 'gogc' option to use Go garbage
collector for memory management.
2019-06-11 12:38:22 -04:00
90166a4379 Bug fixes. Read availability attributes when adding interfaces and
categories. Memory leak fixes. Add "autorelease" confiruation directive.
Fix parameter types for subclass method overriding.
2019-06-06 00:22:07 -04:00
50b9387a91 Add frameworkdirs: directive to allow the user to point to directories
where Objective-C frameworks can be found. Rework the cgoFlags. Search
Objective-C protocols when looking for subclass methods to override.
2019-06-04 21:18:06 -04:00
a251e7382e Improve test coverage. 2019-06-04 00:14:04 -04:00
d8552bcf9d Use strict unmarshal for configuration file, to detect typos in
config directives. Do not panic on failed regexp in AST parsing,
instead return &ast.Unknown{} for further debugging. Add debutast:
directive to print context when AST nodes are not recognized.
2019-06-03 11:07:12 -04:00
4f0cdf4d1a Some AST tweaks and add astfile: config option to read AST from a file
instead of running Clang. Attempt to port to MacOS Mojave.
2019-06-01 15:10:51 -04:00
a7df3a4e71 Enable -fobjc-arc for AST generation when arc=true in nswrap.yaml.
This still doesn't work
2019-05-31 16:28:51 -04:00
e29ae58a9c Add experimental "arc" directive to nswrap.yaml to experiment
with enabling Objective-C automatic reference counting. Bindings
currently will not compile with this turned on.
2019-05-31 12:42:52 -04:00
8ce3b6a6de Remove dependencies, improve documentation. 2019-05-29 22:36:49 -04:00
gmp
a94969338b Move main command to the main package directory. 2019-05-29 13:14:26 -04:00
959b87342e Return Golang bools from Objective-C functions that return BOOL.
Move nswrap command to cmd/nswrap.
2019-05-06 09:00:38 -04:00
eced251710 Create GoString helper methods for anything that has a "WithString"
method. Multiple bug fixes in type system, fixed parsing of id,
instancename and instancetype, allow NullableAnnotations after
generic lists (e.g. "id<ObjectType> _Nullable"). Helper function
to identify types that are function pointers.
2019-05-03 13:14:30 -04:00
758ea40679 Add constants for C enum types. Add NSEnumerator helper. Fix
bugs in Go class names. Add "Frameworks" option to nswrap.toml.
Improve handling of ast.EnumDecl and ast.EnumConstantDecl.
2019-05-02 14:14:29 -04:00
be92b200ad Handle functions identified by regexp in nswrap.toml config
file. Handle inherited class methods.
2019-05-01 10:58:29 -04:00
e6232bdccb Fix VaArgs configuration. 2019-04-30 09:21:54 -04:00
d78e055008 Handle Objective-C methods with variadic arguments. 2019-04-29 16:14:45 -04:00
c03e37bd54 Make a Go Interface instead of a struct for top level objects.
Use a new struct Id as a concrete version of that type.
2019-04-29 11:46:48 -04:00
977a09e77e Better handling of multiple classes and input files. Handle
Objective C type parameter declarations. Check Typedefs when
determining if a Type is a pointer or a function.
2019-04-26 22:44:30 -04:00
6135381cc7 Allow #pragma directives to be provided in the config file. 2019-04-26 15:41:29 -04:00
009a974a1a Rename to nswrap, put configuration in a toml file, allow imports
and sysimports.
2019-04-26 15:34:36 -04:00
4f260dda0e Fix handling of id and void* types. Add helper functions to convert
char* to and from Go strings. Parse block (^) types. Skip methods
with functions as parameters. Fix passing pointers go C code.
2019-04-26 14:08:43 -04:00
885658b67b Implement new type system. Working wrapper for simple Objective-C
interfaces.
2019-04-23 15:48:11 -04:00
74f4073d35 Improved type handling. 2019-04-11 11:46:24 -04:00
2fbd9134a0 Generate go and objc wrapper functions. Translate classes into wrapped
unsafe.Pointer() instances. Embed super-class to simulate inheritance
and hold pointers only at the base class.
2019-04-10 14:00:48 -04:00
bcb4a0680d Identify methods from interfaces and categories, determine their
parameter and return types.
2019-04-09 23:19:49 -04:00
6a9c5c2811 Initial commit. 2019-04-09 11:52:21 -04:00