medit/moo/moopython/mooterm-pygtk.override

53 lines
1.3 KiB
Plaintext

%%
headers
#include <Python.h>
#define NO_IMPORT_PYGOBJECT
#include "pygobject.h"
#include "mooterm/mooterm.h"
#include "mooutils/mooutils-python.h"
void moo_term_register_classes(PyObject *d);
%%
modulename moo
%%
import gtk.Widget as PyGtkWidget_Type
import gobject.GObject as PyGObject_Type
%%
ignore-glob
*_get_type
%%
override moo_term_new kwargs
static int
_wrap_moo_term_new (PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = {NULL};
if (!PyArg_ParseTupleAndKeywords (args, kwargs, ":Term", kwlist))
return -1;
self->obj = g_object_new (MOO_TYPE_TERM, NULL);
pygobject_register_wrapper ((PyObject*)self);
return 0;
}
%%
override moo_term_fork_command_line kwargs
static PyObject *
_wrap_moo_term_fork_command_line (PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = {"cmd", "working_dir", NULL};
const char *cmd = NULL;
const char *working_dir = NULL;
gboolean result;
if (!PyArg_ParseTupleAndKeywords (args, kwargs, "s|s:Term.fork_command",
kwlist, &cmd, &working_dir))
return NULL;
result = moo_term_fork_command_line (MOO_TERM (self->obj), cmd,
working_dir, NULL, NULL);
return_Bool (result);
}