File src/gnome/boxed.c

Functions

local _boxed_copy (val) GObject wants to copy a boxed value.
local l_box (value, type) Sometimes an automatic boxing of Lua values is not possible.
local l_box_debug (L) Return the number of currently allocated boxed objects.
local l_boxed_index (box, key) Access the object stored in the boxed value.
local l_boxed_newindex (L) Write into a field of the Boxed value, which works only if that value is a table or a userdata with an appropriate metamethod.
lg_boxed_free (val) When GObject wants to free a boxed value, unreference the Lua value associated with it, and release the memory.
lg_boxed_to_ffi (ar, argtype) A boxed value should now be used to fill a gtk_arg_types.
lg_get_boxed_value (L, p) Push the Lua value wrapped in the LuaValue box onto the Lua stack.
lg_init_boxed (gnome) Initialize this module.
lg_make_boxed_value (L, index) Create a boxed value for a Lua value, and return that pointer.


Functions

local _boxed_copy (val)
GObject wants to copy a boxed value. We now need another reference for the Lua value.

Parameters

  • val:
local l_box (value, type)
Sometimes an automatic boxing of Lua values is not possible. In this case, the user can explicitely box a value. You can also provide a type name to typecast the value to.

Parameters

  • value: A value to box
  • type: (optional) a string describing the type you want to cast the value to.
local l_box_debug (L)
Return the number of currently allocated boxed objects.

Parameters

  • L:
local l_boxed_index (box, key)
Access the object stored in the boxed value. The type casting for objects is not really useful, is it? If the Lua value is a table or a userdata, try to access its fields.

Parameters

  • box: The boxed value (a userdata)
  • key: The key to access in b
local l_boxed_newindex (L)
Write into a field of the Boxed value, which works only if that value is a table or a userdata with an appropriate metamethod. Input stack: box - key - value

Parameters

  • L:
lg_boxed_free (val)
When GObject wants to free a boxed value, unreference the Lua value associated with it, and release the memory. Note: should the boxed value have been allocated by lua_newuserdata, then it can't be freed this way, obviously. An error message is printed instead.

Parameters

  • val:
lg_boxed_to_ffi (ar, argtype)
A boxed value should now be used to fill a gtk_arg_types.

Parameters

  • ar:
  • argtype:
lg_get_boxed_value (L, p)
Push the Lua value wrapped in the LuaValue box onto the Lua stack.

Parameters

  • L: Lua State
  • p: Pointer to the boxed value

Return value:

1, and the Lua value on the Lua stack
lg_init_boxed (gnome)
Initialize this module.

Parameters

  • gnome: The "gnome" table
lg_make_boxed_value (L, index)
Create a boxed value for a Lua value, and return that pointer. Note that the caller needs to take care of this allocated region.

Parameters

  • L:
  • index:

Valid XHTML 1.0!