Module src/gnome/object_meta.c

Functions

local _array_access (L, o) Try to access one element of an array.
local _check_override (L, module_idx, name) Override? This can be one defined in the gtk_methods[] array, i.e.
local _fe_check_env (stack, stack, stack) Look in the object's environment for a given key.
local _fe_check_function (L, recursed, ts) Look for a function with the desired name.
local _fe_check_interfaces (L, attr_name) The class being looked at may implement interfaces; look for these functions, too.
local _fe_check_metatable (L, recursed) Look at the current metatable.
local _fe_check_struct (L, attr_name, ts) Maybe the element being looked for is an attribute of the Gtk object, i.e. part of its C structure.
local _fe_recurse (stack, stack, stack, stack) Search an object's class and parent classes for an attribute.
local _find_element (L, must_exist) Look for a method or attribute of the given object.
local _found_function (L, name, fi) An entry has been found.
local _push_attribute (L, ts, se, ptr) Given a pointer to a structure and the description of the desired element, push a value onto the Lua stack with this item.
local _read_meta_entry (L) A meta entry is on the top of the stack; use it to retrieve the method pointer or attribute value.
local _try_overwrite_function (L, index) Try to overwrite a function, which is possible if it is in the virtual table of an interface.
local _write_meta_entry (L, index) Assignment to an attribute of a structure.
lg_object_index (object, key) __index function for the metatable used for userdata (objects).
lg_object_newindex (L) Set existing attributes of an object, or arbitrary values.


Functions

local _array_access (L, o)
Try to access one element of an array.

Parameters

  • L: Lua State
  • o: The object (also on Lua Stack position 1)
In file: src/gnome/object_meta.c line 358
local _check_override (L, module_idx, name)
Override? This can be one defined in the gtk_methods[] array, i.e. implemented in C, or one defined in override.lua; these functions must also be inserted into the gtk table. Input stack: 1=unused, [2]=key, [-2]=dest metatable, [-1]=curr metatable Output stack: same on failure (returns 0), or an additional item (returns 1)

Parameters

  • L:
  • module_idx:
  • name:
In file: src/gnome/object_meta.c line 16
local _fe_check_env (stack, stack, stack)
Look in the object's environment for a given key.

Parameters

  • stack: [-1] Metatable of the object
  • stack: [-1] Metatable of the object
  • stack: [-1] Metatable of the object

Return values:

  1. The value, or nothing
In file: src/gnome/object_meta.c line 210
local _fe_check_function (L, recursed, ts)
Look for a function with the desired name. Input stack: [1]=object [2]=key [-2]=object's metatable [-1]=curr metatable Returns 0 if not found, >0 otherwise.

Parameters

  • L:
  • recursed:
  • ts:
In file: src/gnome/object_meta.c line 231
local _fe_check_interfaces (L, attr_name)
The class being looked at may implement interfaces; look for these functions, too. Returns: 0=nothing found, 1=found something Stack: [1]=object [2]=key ... [-2]=dest mt [-1]=curr mt

Parameters

  • L:
  • attr_name:
In file: src/gnome/object_meta.c line 126
local _fe_check_metatable (L, recursed)
Look at the current metatable. If it contains the desired item, copy it into the base meta table and return 2. Input stack: 1=object, 2=key, [-2]=dest metatable, [-1]=curr metatable

Parameters

  • L: lua_State
  • recursed: true if current metatable is not the object's metatable.
In file: src/gnome/object_meta.c line 70
local _fe_check_struct (L, attr_name, ts)
Maybe the element being looked for is an attribute of the Gtk object, i.e. part of its C structure. Stack: [1]=object [2]=key [-2]=dest mt [-1]=curr mt

Parameters

  • L:
  • attr_name:
  • ts:
In file: src/gnome/object_meta.c line 100
local _fe_recurse (stack, stack, stack, stack)
Search an object's class and parent classes for an attribute.

Parameters

  • stack: [-1] mt2 Metatable of object or one of its parents.
  • stack: [-1] mt2 Metatable of object or one of its parents.
  • stack: [-1] mt2 Metatable of object or one of its parents.
  • stack: [-1] mt2 Metatable of object or one of its parents.
In file: src/gnome/object_meta.c line 279
local _find_element (L, must_exist)
Look for a method or attribute of the given object. It handles accesses to methods and attributes found in this class or any base class. Once the method or attribute has been found, it is inserted into the object's table to avoid looking it up again. Input Stack: 1=object, 2=key Output Stack: depends on the return value.

Parameters

  • L: lua_State
  • must_exist: Set to 1 to print an error message on failure @return 0 nothing found 1 found an entry or function (returned on the stack) 2 found a meta entry (meta entry returned) -1 other error
In file: src/gnome/object_meta.c line 393
local _found_function (L, name, fi)
An entry has been found. Store this fact in the object's meta table, and then handle the entry. Called from: _find_element. Stack: [1]=object [2]=key ... [-2]=dest mt [-1]=curr mt Output stack: meta entry added.

Parameters

  • L:
  • name:
  • fi:
In file: src/gnome/object_meta.c line 47
local _push_attribute (L, ts, se, ptr)
Given a pointer to a structure and the description of the desired element, push a value onto the Lua stack with this item.

Parameters

  • L: Lua State
  • ts: Typespec of the structure containing the element
  • se: Description of the structure element to access
  • ptr: Pointer to the structure

Return value:

Number of pushed items, i.e. 1 on success, 0 on failure. In file: src/gnome/object_meta.c line 465
local _read_meta_entry (L)
A meta entry is on the top of the stack; use it to retrieve the method pointer or attribute value. Stack: 1=object, 2=key, 3=dest metatable, 4=current metatable,... meta entry

Parameters

  • L:
In file: src/gnome/object_meta.c line 505
local _try_overwrite_function (L, index)
Try to overwrite a function, which is possible if it is in the virtual table of an interface.

Parameters

  • L: Lua State
  • index: Stack position with a closure object
In file: src/gnome/object_meta.c line 565
local _write_meta_entry (L, index)
Assignment to an attribute of a structure. Must not be a built-in method, but basically could be... Stack: 1=object, 2=key, ... [-1]=meta entry

Parameters

  • L:
  • index: Lua stack position where the value is at
In file: src/gnome/object_meta.c line 614
lg_object_index (object, key)
__index function for the metatable used for userdata (objects). This is to access a method or an attribute of the class, or a value stored by the user with an arbitrary key.

Parameters

  • object: The Lua object (a userdata of type struct object) to examine
  • key: The key to look up

Return values:

  1. The resulting object, or nothing in case of failure. It can be a function, a meta entry describing a structure element, or any object that the user stored.
In file: src/gnome/object_meta.c line 529
lg_object_newindex (L)
Set existing attributes of an object, or arbitrary values. The environment of the userdata will be used to store additional values. Input stack: 1=object, 2=key, 3=value

Parameters

  • L:
In file: src/gnome/object_meta.c line 658

Valid XHTML 1.0!