summaryrefslogtreecommitdiff
path: root/atk.override
diff options
context:
space:
mode:
authorJohn Finlay <finlay@src.gnome.org>2006-07-05 22:24:21 +0000
committerJohn Finlay <finlay@src.gnome.org>2006-07-05 22:24:21 +0000
commitd902335cfe1720c4fe20493312bab63b3f5cf806 (patch)
tree0610cb7e0cfe03b4dc3876255634cd9243251fb5 /atk.override
parentb1a34256ed60ad93bc3051bdd6bebc5f6ff36f82 (diff)
downloadpygtk-d902335cfe1720c4fe20493312bab63b3f5cf806.tar.gz
Add.
* atk.override (_wrap_atk_state_set_contains_states) (_wrap_atk_state_set_add_states): Add.
Diffstat (limited to 'atk.override')
-rw-r--r--atk.override68
1 files changed, 68 insertions, 0 deletions
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;
+}