From e5687c0dc54011a83a97d9ec4c3676e5046b5c81 Mon Sep 17 00:00:00 2001 From: James Henstridge Date: Thu, 31 Jul 2003 13:17:33 +0000 Subject: add wrapper (from bug #118676). 2003-07-31 James Henstridge * pygobject.c (pygobject_handler_is_connected): add wrapper (from bug #118676). --- gobject/pygobject.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gobject/pygobject.c b/gobject/pygobject.c index a76e35b..76e94cb 100644 --- a/gobject/pygobject.c +++ b/gobject/pygobject.c @@ -801,6 +801,21 @@ pygobject_disconnect(PyGObject *self, PyObject *args) return Py_None; } +static PyObject * +pygobject_handler_is_connected(PyGObject *self, PyObject *args) +{ + guint handler_id; + PyObject *ret; + + if (!PyArg_ParseTuple(args, "i:GObject.handler_is_connected", &handler_id)) + return NULL; + + ret = g_signal_handler_is_connected(self->obj, handler_id) + ? Py_True : Py_False; + Py_INCREF(ret); + return ret; +} + static PyObject * pygobject_handler_block(PyGObject *self, PyObject *args) { @@ -1012,6 +1027,7 @@ static PyMethodDef pygobject_methods[] = { { "connect_object_after", (PyCFunction)pygobject_connect_object_after, METH_VARARGS }, { "disconnect", (PyCFunction)pygobject_disconnect, METH_VARARGS }, { "handler_disconnect", (PyCFunction)pygobject_disconnect, METH_VARARGS }, + { "handler_is_connected", (PyCFunction)pygobject_handler_is_connected, METH_VARARGS }, { "handler_block", (PyCFunction)pygobject_handler_block, METH_VARARGS }, { "handler_unblock", (PyCFunction)pygobject_handler_unblock,METH_VARARGS }, { "emit", (PyCFunction)pygobject_emit, METH_VARARGS }, -- cgit