%% headers #include #define NO_IMPORT_PYGOBJECT #include "pygobject.h" #include "mooedit/mooeditor.h" #include "mooedit/mooeditsearch.h" #include "mooedit/mootextbuffer.h" #include "mooedit/moocmdview.h" #include "mooedit/mootextiter.h" #include "moopython/mooplugin-python.h" #include "mooutils/mooutils-python.h" void moo_edit_add_constants (PyObject *module, const gchar *strip_prefix); void moo_edit_register_classes (PyObject *d); %% modulename moo %% import gtk.Widget as PyGtkWidget_Type import gtk.TextView as PyGtkTextView_Type import gtk.TextBuffer as PyGtkTextBuffer_Type import gtk.TextTagTable as PyGtkTextTagTable_Type import gtk.TextTag as PyGtkTextTag_Type import gtk.gdk.Pixbuf as PyGdkPixbuf_Type import gobject.GObject as PyGObject_Type import _moo.Window as PyMooWindow_Type import _moo.UIXML as PyMooUIXML_Type %% ignore-glob *_get_type %% override moo_python_plugin_hook varargs static PyObject * _wrap_moo_python_plugin_hook (G_GNUC_UNUSED PyObject *self, PyObject *args) { PyObject *event, *callback; PyObject *data = NULL; PyObject *result; int len; len = PyTuple_GET_SIZE (args); if (len < 2) return_TypeErr ("at least two arguments required"); event = PyTuple_GET_ITEM (args, 0); if (!PyString_Check (event)) return_TypeErr ("event must be a string"); callback = PyTuple_GET_ITEM (args, 1); if (!PyCallable_Check (callback)) return_TypeErr ("callback must be a callable"); if (len > 2) data = PyTuple_GetSlice (args, 2, len); result = _moo_python_plugin_hook (PyString_AS_STRING (event), callback, data); Py_XDECREF (data); return result; }