Lua experiments

After dodging the topic for a long time now I've decided it's about time to add some proper Lua support to bb.Or at least to play around with Lua.

Considerations and limitations:

[*]bb's plugin interface is incredibly thin[*]bb plugins are essentially standalone programs. integration points are: api access, broams, menus, styles, slit integration[*]bb's current API is horrible and will get a rewrite once somebody can be bothered breaking approximately every plugin[*]integrating lua into bb as a plugin is straight-forward[*]I can't be bothered to write C code atm[/list]

So far I've got https://code.google..../luaforwindows/ up and running (installation was straightforward).I've checked out IUP and CD (both included in the distribution) and deemed them good enough to create non-transparent graphical output (they support transparency! awesome).

Next I've started work on the SDK by implementing an rc-reader: http://pastebin.com/Lv8Vp7kiSince I don't have a real connection to bb, I'll just fake the connection points for now (by reading bb's settings, etc), although I'm pretty sure that a lot of the API is accessible via SendMessage.

Bottomline: Stuff is happening, lua is coming. Slowly, but it's coming.Well, actually it's crawling and it might never make it

Things are progressing slowly.As you can see in the screenshot below, I now have ~90% of bb8Ball's functionality ported.I've expanded on the rc reader: it can now properly parse colors defined as #RRGGBB, #RGB, rgb:RR/GG/BB colors and all 752 X11 color literals.

I've played around a little with it, so I can now safely say that IUP is a cute and sane GUI framework.The documentation can be sparse at times, but it's complete. Also all the functions I expect from a solid framework are there and as a bonus the HWND is exposed.

Next big step: Porting/implementing style item parsing/rendering.That's right, I'll be rendering the gradients and everything right in lua.Since it's much much easier to write high-level algorithms in Lua than C, I'll use this opportunity to get the rendering code algorithmically right, feature-complete and elegant. In a later step we* can back-port it into bblib to get that extra speed.

I've played around a little with it, so I can now safely say that IUP is a cute and sane GUI framework.
The documentation can be sparse at times, but it's complete. Also all the functions I expect from a solid framework are there and as a bonus the HWND is exposed.

Well, I'll back off from that. It's been ages since IUP last saw an update, there doesn't seem to be a simple way to draw to a pixel-based framebuffer and the community is mainly based on mailing lists. Heck, they even refer to the mailing list on StackOverflow ._.

Looking around, the situation seems to be the same for all the other Lua GUI bindings (GTK, Qt, wxWidgets, ..) - they are either inactive or immature and inactive.

That makes it quite hard to actually draw stuff in Lua and since that is kinda important, I'll look elsewhere.

Initially, Python seems like a good option as a scripting language - active community, good (and recent) Qt bindings and other GUI options.