diff options
author | Huang Peng <shawn.p.huang@gmail.com> | 2009-02-05 10:39:56 +0800 |
---|---|---|
committer | Huang Peng <shawn.p.huang@gmail.com> | 2009-02-05 10:39:56 +0800 |
commit | aedad1ea0a7fef604aa27f4b58433fd8f2ece29e (patch) | |
tree | ffcb531d8474bde18b90341bcd4eb639edd74525 /bindings/python/ibusmodule.c | |
parent | 41ad46305a88637dd99f00a2d2a3f455505d357b (diff) | |
download | ibus-aedad1ea0a7fef604aa27f4b58433fd8f2ece29e.tar.gz ibus-aedad1ea0a7fef604aa27f4b58433fd8f2ece29e.tar.xz ibus-aedad1ea0a7fef604aa27f4b58433fd8f2ece29e.zip |
re-implement ibus in c language.
Diffstat (limited to 'bindings/python/ibusmodule.c')
-rw-r--r-- | bindings/python/ibusmodule.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/bindings/python/ibusmodule.c b/bindings/python/ibusmodule.c new file mode 100644 index 0000000..875ff88 --- /dev/null +++ b/bindings/python/ibusmodule.c @@ -0,0 +1,29 @@ +#include <Python.h> +#include <pygobject.h> + +void pyibus_register_classes (PyObject *d); +void pyibus_add_constants (PyObject *module, const gchar *strip_prefix); +extern PyMethodDef pyibus_functions[]; + + +DL_EXPORT(void) +initibus (void) +{ + PyObject *m, *d; + + init_pygobject (); + + m = Py_InitModule ("ibus", pyibus_functions); + d = PyModule_GetDict (m); + + pyibus_register_classes (d); + + if (PyErr_Occurred ()) { + Py_FatalError ("unable to initialise ibus module"); + } + pyibus_add_constants (m, "GIK_"); + if (PyErr_Occurred ()) { + Py_FatalError ("unable to initialise ibus module"); + } +} + |