View Single Post
Old 11-01-2009, 12:20 PM   #12
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Post

Quote:
Originally Posted by ericshliao View Post
You are right. I just can't understand why.
For inspiration look in lgob-9.09/gdk/src/gdk.def:
Code:
defFunction('gdk_color_parse',
        {
                since = '0.1',
                args = {'char* none', 'struct* full'},
                ret = 'boolean none'
        }
)
This generates: lgob-9.09/gdk/src/iface.c where you can see that color_parse has a string as input and a color as output:

Code:
static int _wrap_gdk_color_parse(lua_State* L)
{
        GdkColor color;
        gdk_color_parse(lua_tostring(L, 1), &color);
        boxed_new(L, GDK_TYPE_COLOR, &color);
        return 1;
}
It takes some time to get used to this, but after a while it becomes quite readable. For me it is easier to parse than those Chinese glyphs ;-)

PS: shall we start a new thread for lgob discussions to avoid 'polluting' the software release threads?
hansel is offline   Reply With Quote