[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Winapi - a minimal but useful Windows API binding
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 9 Jun 2011 15:23:59 +0200
2011/6/9 Ignacio Burgueño <firstname.lastname@example.org>:
> Hi Steve. This looks really nice. How does it compare to this other binding
>  by Jerome Vuarand?
They seem complementary. I will confess to the usual sin of not doing
a more thorough literature search.
It's hard to know when to stop when binding something like the Windows
API. Some things are best dealt with with a portable existing
solution (like FTP and HTTP protocols) and some things may be outside
the scope of a 'minimal' binding (for instance, a little lightweight
The async angle is important. The rule I've enforced is that only one
Lua callback can be active at a time, and in a GUI application it's
also important to dispatch the callback so that it happens in the main
thread. Unfortunately it's not so easy to hijack Lua file objects -
it can be done for regular Lua (which exposes a metatable for userdata
which just points to a FILE*) but this does not work for LuaJIT.
Perhaps an io.fdopen function would be generally useful, even if only
exposed on the API level.
The ultimate aim is to define a API which provides a reasonable
intersection of the facilities provided by different platforms. For
instance, Jeff Pohlmeyer's xctrl module can also send fake input to
windows, and enumerate top-level windows for X.