another round of WinAPI binding and call to action

  • From: Cosmin Apreutesei <cosmin.apreutesei@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 28 Aug 2015 22:58:57 +0300

Hello everyone,

This message is for anyone interested in developing GUI apps for
Windows using LuaJIT and for anyone who might want to get involved
with developing a binding of the Windows API, especially UI-related
stuff (but other parts too).

Some 3 years ago (some time after the ffi got support for callbacks) I
started working on a binding[1] of the Windows API which includes
top-level windows, a some standard controls, an OpenGL widget and a
cairo widget. I sat on it for 2-3 months and then I made it public.
But the docs were thin.

I started working on it again this week and this is the result:

- the class system and most of the class hierarchy is now documented
- there's developer documentation for how to bind more APIs
- there's an all-in-one demo (screenshot[2], code[3])
- bugs were crushed
- it almost works with a 64bit build of luajit except for one big bad bug[4]
- the list of modules is auto-generated so it always shows what's
actually available.
- the whole thing is at 19KLOC but it's very modular (the classes are 5KLOC)

There's a lot more work to be done (coding _and_ docs) to get to the
state of any-noob-can-use-it. Currently it's closer to the typical
Linux experience: it sometimes blows in your face and you have to go
to the guts and fix it -- but it's not a 50MB pile of C++ guts ;) The
good news is that when it works it's very easy to use because it's
100% OOified and Luaized (see[3]).

Now for the call to action part: if you are interested in this stuff,
this is one project where it will be easy for you to collaborate on.
There's a list of open issues, a status page, developer docs, a forum
and you'll get my full assistance. Sure, you'll have to learn your way
around a low-level API. OTOH there's helpers to sweep it all under the
rug to the point where making new widget classes can be almost
entirely declarative[5]. So if you want to help, PM me or post on
github or on the luapower forum.

Thank you.


[1] https://luapower.com/winapi
[2] https://luapower.com/files/luapower/media/www/winapi_demo.png
[3] https://github.com/luapower/winapi/blob/master/winapi_demo.lua
[4] https://github.com/luapower/winapi/issues/24
[5] https://github.com/luapower/winapi/blob/master/winapi/labelclass.lua

Other related posts: