diff options
author | Sayamindu Dasgupta <sayamindu@gmail.com> | 2009-03-27 15:21:25 (GMT) |
---|---|---|
committer | Sayamindu Dasgupta <sayamindu@gmail.com> | 2009-03-27 15:21:25 (GMT) |
commit | 35bdff681e2c81dd7a78ac459b9b508451dae3a0 (patch) | |
tree | f09193f807e5a466e72fdf32148da3237ef6d147 | |
parent | bec7f286f7a707af68f084f249cf84d98c52b5a4 (diff) |
Added methods for cycling between groups
-rw-r--r-- | pyxkb.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -238,6 +238,29 @@ pyxkbconfig_get_active_group_index(PyObject *self, PyObject *args) } +static PyObject * +pyxkbconfig_lock_next_group(PyObject *self, PyObject *args) +{ + gint next_group; + + next_group = xkl_engine_get_next_group(engine); + xkl_engine_lock_group(engine, next_group); + + Py_RETURN_NONE; +} + +static PyObject * +pyxkbconfig_lock_prev_group(PyObject *self, PyObject *args) +{ + gint prev_group; + + prev_group = xkl_engine_get_prev_group(engine); + xkl_engine_lock_group(engine, prev_group); + + Py_RETURN_NONE; +} + + /* Method table */ static PyMethodDef pyxkb_methods[] = { {"get_layouts", pyxkbconfig_get_layouts, METH_VARARGS, @@ -263,6 +286,10 @@ static PyMethodDef pyxkb_methods[] = { {"get_active_group_index", pyxkbconfig_get_active_group_index, METH_VARARGS, "Gets the index number of the currently active group"}, + {"lock_next_group", pyxkbconfig_lock_next_group, METH_VARARGS, + "Locks to the next group in the list of enabled groups"}, + {"lock_prev_group", pyxkbconfig_lock_prev_group, METH_VARARGS, + "Locks to the previous group in the list of enabled groups"}, {NULL, NULL, 0, NULL} }; |