From d902335cfe1720c4fe20493312bab63b3f5cf806 Mon Sep 17 00:00:00 2001 From: John Finlay Date: Wed, 5 Jul 2006 22:24:21 +0000 Subject: Add. * atk.override (_wrap_atk_state_set_contains_states) (_wrap_atk_state_set_add_states): Add. --- atk.override | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'atk.override') diff --git a/atk.override b/atk.override index 58ee788b..d32aca4b 100644 --- a/atk.override +++ b/atk.override @@ -253,3 +253,71 @@ _wrap_atk_relation_get_target (PyGObject *self) } return py_targets; } +%% +override atk_state_set_add_states kwargs +static PyObject * +_wrap_atk_state_set_add_states(PyGObject *self, PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "types", NULL }; + AtkStateType *types; + gint count, i; + PyObject *py_types; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, + "O:atk.StateSet.add_states", + kwlist, &py_types)) + return NULL; + + if (!(py_types = PySequence_Fast(py_types, "types must be a sequence"))) + return NULL; + + count = PySequence_Fast_GET_SIZE(py_types); + types = g_new0(AtkStateType, count); + for (i = 0; i < count; i++) { + if (pyg_enum_get_value(ATK_TYPE_STATE_TYPE, + PySequence_Fast_GET_ITEM(py_types, i), + (gpointer)&types[i])) + return NULL; + } + atk_state_set_add_states(ATK_STATE_SET(self->obj), types, count); + Py_INCREF(Py_None); + return Py_None; +} +%% +override atk_state_set_contains_states kwargs +static PyObject * +_wrap_atk_state_set_contains_states(PyGObject *self, PyObject *args, + PyObject *kwargs) +{ + static char *kwlist[] = { "types", NULL }; + AtkStateType *types; + gint count, i; + gboolean ret; + PyObject *py_types, *py_ret; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, + "O:atk.StateSet.contains_states", + kwlist, &py_types)) + return NULL; + + if (!(py_types = PySequence_Fast(py_types, "types must be a sequence"))) + return NULL; + + count = PySequence_Fast_GET_SIZE(py_types); + types = g_new0(AtkStateType, count); + for (i = 0; i < count; i++) { + if (pyg_enum_get_value(ATK_TYPE_STATE_TYPE, + PySequence_Fast_GET_ITEM(py_types, i), + (gpointer)&types[i])) + return NULL; + } + ret = atk_state_set_contains_states(ATK_STATE_SET(self->obj), types, + count); + if (ret) + py_ret = Py_True; + else + py_ret = Py_False; + Py_INCREF(py_ret); + return py_ret; +} -- cgit v1.2.1