Chocolat scripting API
This is the API for the Chocolat text editor. It's open source so that others can add any functionality that is missing.
prelude.js which goes first.
The deps folder contains all JS dependencies. Currently this is
buckets.js. While I have no particular objection to including extra libraries with Chocolat, size matters. Bigger libraries increase how long Chocolat takes to download, which means less money and fewer yachts for us :)
To call Objective-C methods, use the three
objc_msgSend functions. These mimic their C counterparts and have the form
objc_msgSend(<receiver>, <selector>, <arguments>...)
The two others are
objc_msgSendSync() which blocks and returns a value, and
objc_msgSendThread() which executes the function on the JS thread instead of the main thread (do not use
objc_msgSendThread() unless you know what you're doing).
objc folder contains a bunch of Objective-C categories.
Note that Chocolat currently uses GC and will probably switch to ARC in the future, so please try to write code that works with both.
The Chocolat API is public domain and released under the terms of Unlicense. Basically this means you can do whatever the hell you want with it.
If you submit a pull request or patch, you must agree to license your changes similarly.