Commit Graph
84 Commits
Author SHA1 Message Date
gmp 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
gmp 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
gmp f93a893060 Bug fix in Objective-C method signature parsing. 2019-06-04 13:01:51 -04:00
gmp 773886e0f1 Complete unit tests for nswrap/types. 2019-06-04 11:27:46 -04:00
gmp a251e7382e Improve test coverage. 2019-06-04 00:14:04 -04:00
gmp 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
gmp 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
gmp 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
gmp 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
gmp 5a5a4f9406 AST tweaks and new tests. 2019-05-31 10:21:04 -04:00
gmp 96edbba641 Documentation updates. 2019-05-29 22:57:10 -04:00
gmp 8ce3b6a6de Remove dependencies, improve documentation. 2019-05-29 22:36:49 -04:00
gmp 370a2eb604 Package name tweaks. 2019-05-29 13:26:22 -04:00
gmp 9230222634 Merge branch 'master' of https://git.wow.st/gmp/nswrap 2019-05-29 13:15:31 -04:00
gmp a94969338b Move main command to the main package directory. 2019-05-29 13:14:26 -04:00
gmp 7bcd25bb05 Move main command to the main package directory. 2019-05-29 13:13:04 -04:00
gmp a2d0f9bc4f Change domain name in package path. 2019-05-29 12:57:53 -04:00
gmp 749fd503dd Add README.md and LICENSE. 2019-05-29 00:03:51 -04:00
gmp 2f4d76c6af Better handling of slice size vs. capacity in pointers to pointers. 2019-05-29 00:02:27 -04:00
gmp 840a055a11 Clean up variadic functions and methods. 2019-05-28 20:04:39 -04:00
gmp 1cc0f0e26a Handle pointers to pointers as Go slices. 2019-05-28 15:52:16 -04:00
gmp 86b27e6c42 Simplify polymorphic implementation, bug fix to variadic functions. 2019-05-28 13:20:44 -04:00
gmp 154a2fac14 Disambiguate all class and instance method names. 2019-05-28 13:03:23 -04:00
gmp d086c0fdfe Intermediate commit to work on polymorphic method handling. 2019-05-27 13:47:59 -04:00
gmp 86ff14b533 A few small fixes. 2019-05-24 15:40:01 -04:00
gmp 34fbcec965 Subclasses can have new methods in addition to overriding existing
methods (first draft).
2019-05-24 12:36:01 -04:00
gmp 38c7856b89 Bug fix and start improvements to subclassing. 2019-05-24 00:12:46 -04:00
gmp a616761475 Change Go types to plain structs instead of pointers to structs.
Add methods for protocols that Objective-C interfaces claim to
implement. Separate class methods from instance methods in
internal data structures. Add layout constraints with visual
formats to examples/app. Fix typedefs for wrapped objective-c
object types.
2019-05-23 16:31:47 -04:00
gmp 4f6930002d First draft that handles subclasses and improvements to delegate
implementation.
2019-05-21 16:26:52 -04:00
gmp 8de87cddb7 Performance improvements (do not parse addresses or locations unless
location tracking is enabled). Allow profiling option. Add some
comments and clean-ups to types/*.go.
2019-05-11 23:03:56 -04:00
gmp 49fd749fe3 Use C.GoBytes() in examples/bluetooth. 2019-05-10 02:35:52 -04:00
gmp 2fe435f137 Bug fix: delete exports.go if it is not needed.
Clean up some warnings around deprecated methods and sending
the "initialize" message to NSObject.
2019-05-10 02:23:07 -04:00
gmp dcb7105fca Complete the Delegates wrapper. Disambiguate polymorphic methods.
Bluetooth example is now a functioning heart rate monitor. Additional
bug fixes in Go types (instances where *Id needs to be used instead
of NSObject).
2019-05-10 02:00:56 -04:00
gmp 0de9249e6a Update .gitignore. 2019-05-09 22:35:21 -04:00
gmp e7e2c2c7b6 Begin moving the bluetooth example to the new delegates system. 2019-05-09 22:33:06 -04:00
gmp 44b3b75e23 Complete implementation of delegates. Update app example with an
NSApplicationDelegate.
2019-05-09 22:05:04 -04:00
gmp 0d2321d516 Add autorelease helpers. 2019-05-09 13:33:28 -04:00
gmp b00ecd4ac0 Switch from toml to yaml for configuration files. Begin scaffolding
for Protocols and Delegates.
2019-05-09 12:25:45 -04:00
gmp cccbfbbc00 Autorelease all objective-C objects constructed using "alloc".
Clean up type-related comments in generated code. Do not use
pointers to Go interfaces as receivers, use pointer to Id instead.
2019-05-09 08:52:35 -04:00
gmp ea34821fe6 Add a button to examples/app. 2019-05-07 15:49:43 -04:00
gmp 1c5c61308c Add SelectorHelpers() so you can send named selectors to Objective-C. 2019-05-07 15:17:23 -04:00
gmp 8ed05fb451 Work around cgo (or Clang dwarf) bug with incorrect struct size
calculation by returning void pointers for NS object constructors.
Expand examples/app to start building menus.
2019-05-07 14:48:06 -04:00
gmp 511f2f1968 Improve type handling for enums. Handle "__kindof" qualifiers.
Add examples/app. Allow VisibilityAttr "Hidden".
2019-05-06 13:21:36 -04:00
gmp 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
gmp 717c7e76fe Change name of New* functions to *Alloc to mimic Objective-C's
nested alloc/init call idiom.
2019-05-04 23:32:57 -04:00
gmp 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
gmp 8ea3d57cf0 Fix bug in examples/bluetooth/ble/ble_delegate: deleted references
to unused scanCallback property.
2019-05-02 14:22:20 -04:00
gmp c5a523a8b8 Add bluetooth example. 2019-05-02 14:17:11 -04:00
gmp 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
gmp 9b71889a69 Include type qualifiers and nullability attributes in Objective-C
function return types. Add NSEnumerator to examples/foundation.
2019-05-01 13:58:20 -04:00
gmp 11366be6d0 Convert *Id to any wrapped type. Shorten names for class methods
that return an instance of the class. Fix return types for Go
interfaces.
2019-05-01 12:34:29 -04:00
gmp 57ad898945 Bug fix: Process types before converting to go function parameter
lists.
2019-05-01 11:01:50 -04:00
gmp be92b200ad Handle functions identified by regexp in nswrap.toml config
file. Handle inherited class methods.
2019-05-01 10:58:29 -04:00
gmp 380fee39bf Update foundation example to query whether the array contains
specified objects.
2019-04-30 10:34:56 -04:00
gmp e6232bdccb Fix VaArgs configuration. 2019-04-30 09:21:54 -04:00
gmp 3573aa9144 Change Go types to simple unsafe Pointers instead of pointers
wrapped in structs. It could be possible to handle pointers to
pointers now.
2019-04-30 09:14:25 -04:00
gmp 0e89d2c29a Do not memoize type parser as it causes bugs with typedefs,
'instancetype' etc. Clean up typedefs and type parameters as
soon as Types are created.
2019-04-30 06:59:05 -04:00
gmp d78e055008 Handle Objective-C methods with variadic arguments. 2019-04-29 16:14:45 -04:00
gmp 57232548fa Go type declarations should point to C typedefs. Add parser for
C enum types.
2019-04-29 13:31:13 -04:00
gmp 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
gmp c0c17e88d1 Fix to go type declarations. 2019-04-29 10:37:43 -04:00
gmp 500b457d32 Fix type wrapping and procesing so duplicate types do not get
declared.
2019-04-27 22:24:05 -04:00
gmp 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
gmp 6135381cc7 Allow #pragma directives to be provided in the config file. 2019-04-26 15:41:29 -04:00
gmp 009a974a1a Rename to nswrap, put configuration in a toml file, allow imports
and sysimports.
2019-04-26 15:34:36 -04:00
gmp ead1623d4b Eliminate unnecessary code from wrap/main.go. Include full attributes
in return types of C functions to reduce compiler warnings.
2019-04-26 15:08:44 -04:00
gmp b93ba4c01f Fix handling of signed, unsigned, complex, and long long types
in Go type declarations.
2019-04-26 14:15:18 -04:00
gmp 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
gmp 98e19ca726 Fix handling of wrapped types. Use new type system for go
function declarations. Working wrapper for simple test case.
2019-04-26 10:56:00 -04:00
gmp e143dbb6a7 Fixed type wrapping, further conversion to new type system. The
Go side looks pretty good at this point.
2019-04-26 10:07:34 -04:00
gmp fb21881a8b Add type conversion functions to types package. Start moving the
wrapper to the new type system. Intermediate commit before I rip
out the old stuff, not working yet.
2019-04-26 09:04:53 -04:00
gmp 885658b67b Implement new type system. Working wrapper for simple Objective-C
interfaces.
2019-04-23 15:48:11 -04:00
gmp 4867bb80f4 Memoize types/TypeName() for performance.
types/Parse() returns an error if the parse is incomplete.
2019-04-18 14:40:02 -04:00
gmp da2008c597 Function to print text version of a C TypeName. Fix bugs in Nest(),
ZeroOrMore(), OneOrMore() and Objective-C Generics parsers.
2019-04-18 14:04:01 -04:00
gmp b7134bedb7 Restructure the type parsers. Remove struct declaration parsers. 2019-04-18 11:22:53 -04:00
gmp 6955d79702 Bug fix to stripAbstract(), some minor parser restructuring. 2019-04-18 10:21:03 -04:00
gmp e7270e95cf Add type parsing infrastructure. 2019-04-18 09:38:46 -04:00
gmp 0b0b73c6bd Handle class methods. 2019-04-11 17:00:36 -04:00
gmp 3ecb3b1eeb Fix types in c and go parameter lists. 2019-04-11 13:09:02 -04:00
gmp 9e3c7c2ce8 Fix objective-c method calls. 2019-04-11 12:00:10 -04:00
gmp 74f4073d35 Improved type handling. 2019-04-11 11:46:24 -04:00
gmp 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
gmp bcb4a0680d Identify methods from interfaces and categories, determine their
parameter and return types.
2019-04-09 23:19:49 -04:00
gmp 6a9c5c2811 Initial commit. 2019-04-09 11:52:21 -04:00