Implemented AdgPair as "special" type
commitebee34b6cf2b4c8998f1a8c05dd13265d8dd751e
authorNicola Fontana <ntd@entidi.it>
Sun, 5 Jun 2011 01:24:57 +0000 (5 03:24 +0200)
committerNicola Fontana <ntd@entidi.it>
Sat, 18 Jun 2011 05:51:20 +0000 (18 07:51 +0200)
tree59f8b497d2253fb53e8e15dab2e587196da52df7
parent67e2821a5348d74334773cb25bafb26e3b225e26
Implemented AdgPair as "special" type

lgob relies on the underline API to provide getter/setter methods.
Although it works fine with GObject items, this approach is not enough
for GBoxed types and structs because, usually, the fields are expected
to be accessed directly from the application (after all, they are C
libraries).

This patch explores a way to solve the problem without touching lgob:
it considers AdgPair (a GBoxed type) as a "special" type and provides
__index and __newindex implementation for accessing the fields.
adg/src/adg.c
adg/src/adg.ovr
examples/Adg.lua