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, Lua 5.2 and LuaJIT2. 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.
List of contributors, in no particular order:
Many other people contributed to what lgi is today, in many forms - writing patches, reporting bugs, packaging for distributions, providing ideas, spreading a word... Many thanks to all of you!
CFLAGS
and LDFLAGS
env vars values - Avoid unexpected dependency on cairo-devel, cairo-runtime is now
enough
- Make set_resident()
more robust and fix stack leak for Lua 5.2 case,
avoid useless warning when set_resident()
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:user_to_device()
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:connect_signals()
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.
GType
into lua_Number
any more; this could
cause crashes on some 64bit arches.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