• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

docs/H09-Oct-2017-1,7791,387

lgi/H03-May-2022-12,6359,200

samples/H09-Oct-2017-8,0746,708

tests/H09-Oct-2017-3,7013,026

tools/H09-Oct-2017-182142

.gitignoreH A D09-Oct-201764 87

.travis.ymlH A D09-Oct-20172.4 KiB6150

LICENSEH A D09-Oct-20171 KiB2117

MakefileH A D09-Oct-2017496 3418

README.mdH A D09-Oct-201710.6 KiB278232

lgi.luaH A D09-Oct-2017756 201

rockspec.inH A D09-Oct-2017769 3529

README.md

1# LGI
2
3LGI is gobject-introspection based dynamic Lua binding to GObject
4based libraries.  It allows using GObject-based libraries directly
5from Lua.
6
7Licensed under
8[MIT-style](http://www.opensource.org/licenses/mit-license.php)
9license, see LICENSE file for full text.
10
11Home of the project is on [GitHub](http://github.com/pavouk/lgi).
12
13LGI is tested and compatible with standard Lua 5.1, Lua 5.2, Lua 5.3 and
14LuaJIT2.  Compatibility with other Lua implementations is not tested
15yet.
16
17If you need to support pre-gobject-introspection GTK (ancient GTK+ 2.x
18releases), use [Lua-Gnome](http://sourceforge.net/projects/lua-gnome/).
19
20## Installation:
21
22In order to be able to compile native part of lgi,
23gobject-introspection >= 0.10.8 development package must be installed,
24although preferred version is >= 1.30.  The development package is
25called `libgirepository1.0-dev` on debian-based systems (like Ubuntu)
26and `gobject-introspection-devel` on RedHat-based systems (like Fedora).
27
28Using LuaRocks:
29
30    luarocks install lgi
31
32Alternatively, use make-based installation:
33
34    make
35    [sudo] make install [PREFIX=<prefix>] [DESTDIR=<destdir>]
36
37Please note that on BSD-systems you may need to use 'gmake'.
38
39## Usage
40
41See examples in samples/ directory.  Documentation is available in
42doc/ directory in markdown format.  Process it with your favorite
43Markdown processor if you want to read it in HTML.
44
45## Credits
46
47List of contributors, in no particular order:
48
49- Uli Schlachter
50- Jasper Lievisse Adriaanse
51- Ildar Mulyukov
52- Nils Nordman
53- Ignas Anikevicius
54- Craig Barnes
55- Nicola Fontana
56- Andreas Stührk
57- Aaron Faanes
58- Jiří Klimeš
59- Garrett Regier
60- Kenneth Zhou
61- Travis Hoppe
62- Tobias Jakobs
63- Heiko Becker
64- Vincent Bermel
65- Szunti
66
67Many other people contributed to what lgi is today, in many forms -
68writing patches, reporting bugs, packaging for distributions,
69providing ideas, spreading a word...  *Many thanks to all of you!*
70
71## History
72
73### 0.9.2 (9-Oct-2017)
74
75 - fix assorted crashes in closure callback invocation code
76 - fix double-free bug caused by incorrect annotation of Gio.DBusProxy.get_interface_info
77 - fix marshaling of arrays of pointers
78 - make objects unusable in __gc metamethod
79 - work around API break in GLib 2.54
80 - use structured GLib logging when available
81 - add Gio.Async support also for static methods and global functions
82 - better error message when Gtk.init fails
83 - add support for Travis
84 - don't hardcode pkg-config executable
85 - fix URI in GStreamer sample
86 - fix flags for DBus samples
87
88### 0.9.1 (27-May-2016)
89
90 - marshal NULL strings as nil instead of empty strings.  This allows
91   use of e.g. DataInputStream:read_line() APIs.
92 - fix and improve build for OSX and Win-based configurations
93 - add support for arrays with lengths as struct fields
94 - allow GLib.Variant construction for lightuserdata
95 - fix gtop binding (certain structs could not be imported)
96 - adapt to new set of annotations in newer glib
97 - assorted Lua5.3 fixes, lgi is now fully Lua5.3 compatible
98 - fix binding of Gdk.Rectangle from newer GDK
99
100### 0.9.0 (23-Mar-2015)
101
102 - new feature: allow defining new properties on custom GObject
103   subclasses implemented using lgi
104 - fix: improve compatibility with locales (turkish)
105 - fix: GPtrArray handling
106 - fix: improve behavior when running in assorted multiple-embedded
107   and concurrent scenarios
108
109### 0.8.0 (02-Jul-2014)
110
111 - new feature: add automatically-generated wrappers for
112   do_async()/do_finish() pairs.  Documented as Gio.Async namespace
113   functionality.
114 - new feature: automatically initialize objects implementing
115   Gio.Initable and Gio.AsyncInitable interfaces.
116 - new feature: GLib.Error is now handled properly, functions
117   returning errors return GLib.Error instances instead of error
118   numbers and strings.  This also allows overriding virtual methods
119   from Lua which report errors by returning GLib.Error
120 - new feature: GLib.Bytes support, adding # operator and 'data'
121   property allowing easy use of GLib.Bytes object.  This leads to
122   deprecation of seldomly used modifiable buffers extensions.
123 - optimization: type attribute caching brings significant speedup of
124   method and property lookups.
125 - fix: Gtk: override for Gtk.Menu.popup() compatible with new GTK
126   annotation.
127 - fix: cairo: assorted small fixes of bad signatures, added some
128   convenience properties.
129 - fix: GLib: add overrides for GLib.MarkupParser
130 - fix: Gio: add overrides for Gio.DBus*Info structures
131 - fix: Pango: add override for Pango.GlyphString.glyphs array
132 - fix: Gdk: Add override inheriting specific Gdk.EventXxx from Gdk.Event
133 - fix: Compile cleanly against Lua5.2 with compatibility mode turned on
134 - fix: avoid leak when adding already cached owned record and for
135   retrieving Variant from Value.
136
137### 0.7.2 (12-Sep-2013)
138
139 - fix: improper marshalling of certain APIs passing pointers to
140   records.
141 - fix: cairo.PsSurface.create() had incorrect signature, missing
142   filename.
143 - fix: If GTK initialization fails, raise Lua exception instead of
144   hard-crash of calling process.
145 - fix: when running test in devel tree, prefer lgi from devel tree
146   instead of the installed one.
147 - add: cairo.Status.to_string() API
148 - fix: avoid referencing GdkRGBA in GDk override when targetting
149   Gdk2.0, which does not have GdkRGBA.
150 - fix: replace GStaticRecMutex with GRecMutex to avoid compilation
151   warnings.
152 - fix: Gtk.Container.'child' pseudoproperty works even in Gtk2, where
153   it was shadowed by internal field.
154 - fix: add workaround for improperly parsed g_bytes_get_data()
155   annotation.
156 - fix: add workarounf for incorrect annotation on
157   Pango.Layour.set_attributes(), which caused memory leak.
158 - fix: adapt to Gio.InputStream.[read|read_all|read_async] API
159   change, which does not accept buffer length argument any more (due
160   to the newly added annotations).
161
162### 0.7.1 (4-Mar-2013)
163
164 - Add support for GStreamer 1.0, while still retaining GStreamer 0.10
165   compatibility.
166 - fix: crash when trying to to access '_class' attribute of class
167   which does not have public classstruct exposed in typelib
168 - fix: crash when passing 'nil' to transfer=full struct (caused crash
169   of Awesome WM during startup).
170
171### 0.7.0 (23-Feb-2013)
172
173 - New feature - subclassing.  Allows creating GObject subclasses and
174   implementing their virtual methods in Lua.
175 - cairo: add support for most 1.12-specific cairo features
176 - cairo: create hierarchy for Pattern subclasses
177 - cairo: assorted small cairo bugfixes
178 - samples: add GDBus client example
179 - samples: add GnomeKeyring example
180 - samples: GTK: offscreen window demos
181 - samples: libsoup simple http server example
182 - platforms: added support for darwin/macosx platform
183 - platforms: additional fixes for OpenBSD
184 - build: Makefiles now respect `CFLAGS` and `LDFLAGS` env vars values
185 - build: Add Lua version option into Makefile
186 - fix: custom ffi enum/flags handling
187 - fix: more exotic callback-to-Lua marshalling scenarios
188 - fix: do not allow GTK+ and gstreamer to call setlocale() - this
189   might break Lua in some locales
190 - fix: small adjustments, fixes and additions in Gtk override
191 - fix: tons of other small fixes
192
193### 0.6.2 (25-Jun-2012)
194 - Avoid unexpected dependency on cairo-devel, cairo-runtime is now
195   enough
196 - Make `set_resident()` more robust and fix stack leak for Lua 5.2 case,
197   avoid useless warning when `set_resident()` fails (to accommodate for
198   static linking case).
199 - Fix small memory leak (mutex) which occured once per opened
200   `lua_State` using lgi.
201
202### 0.6.1 (19-Jun-2012)
203 - objects and structs: actually implement `_type` property as documented
204 - tests: Fix regression tests for less common platforms
205 - Pango: Add a few missing overrides
206 - cairo: Fix `Context:user_to_device()` family of methods.
207 - GStreamer: Add support for transfer!=none for input objects.  This
208   is needed to avoid leaks caused by strange usage of transfer
209   annotations of gstreamer-0.10
210 - GStreamer: Add more missing overrides
211 - GStreamer: Fix and improve samples
212 - Various fixes for usecase when Lua context with loaded lgi is
213   closed and opened again
214 - Gtk: Add missing `Gtk.Builder:connect_signals()` override
215
216### 0.6 (22-May-2012)
217- Add cairo bindings, cairo sample and finish some gtk-demo parts
218  which were requiring cairo
219
220### 0.5.1 (not officially released)
221- Fix a few problems on more exotic architectures (s390x, mips, ia64).
222- Allow passing `byte.buffer` when UTF8 string is requested.
223
224### 0.5 (15-Apr-2012)
225
226- Port gtk3-demo to Lua code.  Try running 'lua samples/gtk-demo/main.lua'
227- Finish override set for Gtk
228- Extend and document features for interfacing LGI with external
229  libraries (exporting and importing objects and structures via
230  lightuserdata pointers).
231- Fix: a few bugs with resolving bitflags values
232- Fix: a few bugs in coroutines-as-callbacks feature
233- Fix: workaround for crashing bug in gobject-introspection 1.32.0
234- Fix: don't try to squeeze `GType` into `lua_Number` any more; this could
235  cause crashes on some 64bit arches.
236
237### 0.4 (4-Jan-2012)
238
239- Changed handling of enums and bitflags, switched from marshaling
240  them as numbers to prefering strings for enums and tables (sets or
241  lists) for bitflags.  Numeric values still work for Lua->C
242  marshalling, but backward compatibility is broken in C->Lua enum and
243  bitflags marshalling.
244- Compatible with Lua 5.2 and LuaJIT
245- Added standardized way for overrides to handle constructor argument
246  table array part.
247- Existing Gtk overrides reworked and improved, there is now a way to
248  describe and create widget hierarchies in Lua-friendly way.  See
249  `docs/gtk.lua`, chapter about `Gtk.Container` for overview and
250  samples.
251- Various bugfixes and portability fixes.
252
253### 0.3 (28-Nov-2011)
254
255- Project hosting moved to GitHub.
256- Build system switched from `waf` to simple Makefile-based one
257- Added automatic locking of thread-sensitive libraries (Gdk and
258  Clutter).  There is no need to add `Gdk.threads_enter()`,
259  `Gdk.threads_leave()` and `Clutter.threads_enter()`,
260  `Clutter.threads_leave()` pairs into application, lgi handles this
261  automatically.
262- Added new sample `samples/console.lua`, which implements already
263  quite usable Lua console using Gtk widgets.
264- Fixes for compatibility with older gobject-introspection 0.10.8
265  package
266- Testsuite is not built automatically, because building it can be
267  apparently problematic on some systems, causing installation failure
268  even when testsuite is not needed at all.
269- Remove `setlocale()` initialization, which could break Lua when used
270  with some regional locales.  The downside of this change is that
271  marshaling file names containing non-ASCII characters on systems
272  which define `G_BROKEN_FILENAMES` environment variable (probably
273  only Fedora 15) does not work now.
274
275### 0.2 (7-Nov-2011)
276
277First public release
278