~ubuntu-branches/ubuntu/natty/lua-gtk/natty

« back to all changes in this revision

Viewing changes to include/module.h

  • Committer: Bazaar Package Importer
  • Author(s): Enrico Tassi
  • Date: 2009-05-17 18:16:21 UTC
  • mfrom: (1.2.1 upstream) (4.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090517181621-9kmdd82nxg54jsio
* new upstream snapshot comprising many more GNOME libraries:
    Gtk, GDK, GLib, Pango, Atk, Libxml2, Cairo, Clutter, Gtkhtml, 
    GtkSourceView, Gio, Gtkspell and GConf. 
* new upstream release includes a new configure script written in Lua,
  no more bashisms there (Closes: #507205)
* renamed binary packages to liblua5.1-gnome-*
* updated standards-version to 3.8.1, no changes needed
* patch to load .so.* version of libraries and not .so (that was requiring
  -dev packages) (Closes: #522087)
* removed redundant Architecture line from the source stanza of control
  (Closes: #498120)
* updated copyright file, Wolfgang Oertl holds it for 2009 too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// vim:sw=4:sts=4
 
2
// Declarations used by the library modules
 
3
 
 
4
#include "common.h"
 
5
 
 
6
extern struct lg_module_api *api;
 
7
extern const char *thismodulename;
 
8
extern struct module_info *thismodule;
 
9
extern const struct luaL_reg module_methods[];
 
10
int load_gnome(lua_State *L);
 
11
 
 
12
/**
 
13
 * This structure is used by modules to communicate with the core (gnome)
 
14
 * module.  It basically contains version information and a jump table.  The
 
15
 * major version must match and the minor version of the core module must be >= 
 
16
 * the version of the library module.
 
17
 *
 
18
 * The jump table makes calls to the core functions easy: just do
 
19
 * retval = api->funcname(arg1, arg2);
 
20
 * 
 
21
 
 
22
 */
 
23
struct lg_module_api {
 
24
    int major, minor;
 
25
    const char *hash_method;
 
26
    const char *msgprefix;
 
27
    int (*register_module)(lua_State *L, struct module_info *mi);
 
28
    int (*register_object_type)(const char *name, object_handler handler);
 
29
 
 
30
/* JUMP TABLE */
 
31
    const char *(*get_object_name)(struct object *o);
 
32
    int (*generic_index)(lua_State *L);
 
33
    int (*generic_new_array)(lua_State *L, cmi mi, int is_array);
 
34
    const char *(*get_type_name)(typespec_t ts);
 
35
 
 
36
    typespec_t (*find_struct)(lua_State *L, const char *type_name,
 
37
        int indirections);
 
38
    void *(*optional_func)(lua_State *L, cmi mi, const char *name,
 
39
        const char *min_version);
 
40
    int (*call_byname)(lua_State *L, cmi mi, const char *func_name);
 
41
    int (*call_function)(lua_State *L, const char *module_name,
 
42
        const char *func_name);
 
43
    void (*lua_to_gvalue_cast)(lua_State *L, int index, GValue *gv, GType type);
 
44
    int (*find_object_type)(const char *name);
 
45
    GType (*gtype_from_name)(lua_State *L, cmi mi, const char *s);
 
46
    void (*get_object)(lua_State *L, void *p, typespec_t ts, int flags);
 
47
    struct object_type *(*get_object_type)(lua_State *L, struct object *w);
 
48
    void (*invalidate_object)(lua_State *L, struct object *w);
 
49
    void (*push_gvalue)(lua_State *L, GValue *gv);
 
50
    struct object *(*object_arg)(lua_State *L, int index, const char *name);
 
51
    int (*push_constant)(lua_State *L, typespec_t ts, int value);
 
52
    struct lg_enum_t *(*get_constant)(lua_State *L, int index, typespec_t ts,
 
53
        int raise_error);
 
54
 
 
55
    void (*empty_table)(lua_State *L, int index);
 
56
};
 
57
#define LUAGNOME_MODULE_MAJOR 0
 
58
#define LUAGNOME_MODULE_MINOR 9
 
59
 
 
60