Main module for the Lua-Gnome binding.
|local __index (table, key)||Look up a name in the given module.|
|local _init_module_info (L)||Add some meta information to the new module.|
|local default_allocate_object (mi, L, ts, count, flags)||If a module doesn't provide a handler to allocate objects, use this default handler.|
|local get_osname ()||Give the application an idea of the platform.|
|local l_destroy (L)||When a proxy object should be destroyed right away, without waiting for the garbage collection, this can be used.|
|local lg_generic_new_array (typename, ...)||Allocate a structure, initialize with zero and return it.|
|lg_get_closure (L, index)||The specified Lua value might contain a closure created with the function above, or contain a .|
|lg_push_closure (L, fi, alloc_fi)||Create a closure for a C (library) function.|
|lg_use_c_closure (ar)||A function should be used as a function pointer.|
|luaopen_gnome (name)||Initialize the library, returns a table.|
- local __index (table, key)
Look up a name in the given module. This works for functions, like gtk.window_new(), and constants, like gtk.WINDOW_TOPLEVEL. Lua Stack: =gnome =name
- table: The table to look in
- key: The name of the item to look up
- Either a userdata (for ENUMs) or a closure (for functions)
- local _init_module_info (L)
Add some meta information to the new module.
- local default_allocate_object (mi, L, ts, count, flags)
If a module doesn't provide a handler to allocate objects, use this default handler.
- local get_osname ()
Give the application an idea of the platform. Could be used to select path separators and more. I have not found a way to determine this in any other way, so far.
- The the operating system, e.g. "win32" or "linux".
- The CPU, e.g. "i386", "amd64"
- local l_destroy (L)
When a proxy object should be destroyed right away, without waiting for the garbage collection, this can be used.
- local lg_generic_new_array (typename, ...)
Allocate a structure, initialize with zero and return it. This is NOT intended for objects or structures that have specialized creator functions, like gtk_window_new and such. Use it for simple structures like GtkTreeIter. The object is, as usual, a Lua wrapper in the form of a userdata, containing a pointer to the actual object.
- typename: Type of the structure to allocate
- ...: array size, or optional additional arguments to the allocator function.
- The new structure
- lg_get_closure (L, index)
The specified Lua value might contain a closure created with the function above, or contain a . If so, return the func_info embedded in it, otherwise raise an error.
- lg_push_closure (L, fi, alloc_fi)
Create a closure for a C (library) function. The function info may be static, which is for elements of structures, or dynamically created, as is the case for regular library functions. XXX when alloc_fi is not 0, when will this memory be freed again?
- L: Lua State
- fi: Function Info with name, address and signature
- alloc_fi: 0=use fi as-is; 1=duplicate the structure; 2=also duplicate the name.
- lg_use_c_closure (ar)
A function should be used as a function pointer. If this is a C closure to a library function, we can use that library function's address directly. This avoids a C closure for a Lua closure, the invocation of which would look like this: FFI closure -> closure_handler -> lg_call_wrapper -> library function.
Return value:1 on success, i.e. ar->arg->p has been set to the C function, or 0 otherwise. In file: src/gnome/init.c line 95
- luaopen_gnome (name)
Initialize the library, returns a table. This function is called by Lua when this library is dynamically loaded. Note that the table is also stored as the global "gnome" (by the "require" command), and that is accessed from this library sometimes.
- name: This library's name, i.e. "gnome".