LGI is gobject-introspection based dynamic Lua binding to GObject based libraries. It allows using GObject-based libraries directly from Lua.
Licensed under MIT-style license, see LICENSE file for full text.
Home of the project is on GitHub.
LGI is tested and compatible with standard Lua 5.1 and Lua 5.2 and recent LuaJIT 2 betas. Compatibility with other Lua implementations is not tested yet.
If you need to support pre-gobject-introspection GTK (ancient GTK+ 2.x releases), use Lua-Gnome.
In order to be able to compile native part of lgi,
gobject-introspection >= 0.10.8 development package must be installed,
although preferred version is >= 1.30. The development package is
called libgirepository1.0-dev
on debian-based systems (like Ubuntu)
and gobject-introspection-devel
on RedHat-based systems (like Fedora).
Using LuaRocks:
luarocks install lgi
Alternatively, use make-based installation:
make
[sudo] make install [PREFIX=<prefix>] [DESTDIR=<destdir>]
Please note that on BSD-systems you may need to use 'gmake'.
See examples in samples/ directory. Documentation is available in doc/ directory in markdown format. Process it with your favorite markdown processor if you want to read it in HTML.
- Avoid unexpected dependency on cairo-devel, cairo-runtime is now enough - Make setresident() more robust and fix stack leak for lua5.2 case, avoid useless warning when setresident() fails (to accomodate for static linking case). - Fix small memory leak (mutex) which occured once per opened lua_State using lgi.
- objects and structs: actually implement 'type' property as documented - tests: Fix regression tests for less common platforms - Pango: Add a few missing overrides - cairo: Fix Context:usertodevice() family of methods. - GStreamer: Add support for transfer!=none for input objects. This is needed to avoid leaks caused by strange usage of transfer annotations of gstreamer-0.10 - GStreamer: Add more missing overrides - GStreamer: Fix and improve samples - Various fixes for usecase when lua context with loaded lgi is closed and opened again - Gtk: Add missing Gtk.Builder:connectsignals() override
- Add cairo bindings, cairo sample and finish some gtk-demo parts which were requiring cairo
- Fix a few problems on more exotic architectures (s390x, mips, ia64).
- Allow passing byte.buffer
when UTF8 string is requested.
docs/gtk.lua
, chapter about Gtk.Container
for overview and
samples.waf
to simple Makefile-based oneGdk.threads_enter()
,
Gdk.threads_leave()
and Clutter.threads_enter()
,
Clutter.threads_leave()
pairs into application, lgi handles this
automatically.samples/console.lua
, which implements already
quite usable Lua console using Gtk widgets.setlocale()
initialization, which could break Lua when used
with some regional locales. The downside of this change is that
marshaling file names containing non-ASCII characters on systems
which define G_BROKEN_FILENAMES
environment variable (probably
only Fedora 15) does not work now.First public release