8000 Home · candycode/loco Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
candycode edited this page May 11, 2012 · 44 revisions

LoCO(Loosely Coupled Objects) is a framework for developing applications(command line and GUI) with JavaScript and Qt. The goal is to use JavaScript as a glue for components developed in C++ as either LoCO objects or stand-alone Qt plugins. For the GUI(and application) part the idea is to reuse all the great JavaScript frameworks readily available exposing QObjects to the JavaScript interpreter running inside a WebKit window. Bindings to the standard Qt widgets will be available as well to allow for native look & feel. Both QtScript and JavaScriptCore are supported as script engines and it is possible to create nested script engines as well where the parent context can expose a subset of objects to the child context. When used with the standard QtScript engine only there is no dependency on QtGUI or QtWebkit.

I also tried where possible to replace asynchronous processing with synchronous calls with soft real-time guarantees i.e. you invoke a function with the maximum amount of time you are willing to wait. This is achieved internally by starting a QTimer at the same time an async call is issued and returning when either the timer emits a timeout event or the async call completes.

The code injected into the interpreter is optionally filtered by a chain of user defined filters which allow to support any language that compiles to JavaScript(examples include coffee, scheme and python). So you will basically be able to access Qt objects from coffeescript if you so desire.

Thanks to the Qt resource compiler it is possible to distribute stand-alone executables written in JavaScript(or anything that compiles to it) with all the resources packed into a single file.

LoCO is developed on top of Qt for the ease of exposing objects to JavaScript but it should be possible to run it in other environments as well(namely wxWidgets) with the added burden of having to explicitly wrap and expose each widget and event to the Javascript interpreter as done here and without anything close to the level of C++ - JavaScript integration available through the moc compiler and the QtWebKit bridge.

Clone this wiki locally
0