#include "actions.hh"
%}
-%include stl.i
-%include exception.i
+%include "stl.i"
+%include "exception.i"
//%include std_list.i
//%template(ClientList) std::list<OBClient*>;
Type_StickyButton,
Type_LeftGrip,
Type_RightGrip,
- Type_Client,
+ Type_Window,
Type_Root
};
%}
%rename(register) python_register;
%inline %{
-PyObject * python_register(int action, PyObject *func, bool infront = false)
+/*PyObject * python_register(int action, PyObject *func, bool infront = false)
{
if (!PyCallable_Check(func)) {
PyErr_SetString(PyExc_TypeError, "Invalid callback function.");
}
Py_INCREF(Py_None); return Py_None;
}
+*/
+PyObject * mbind(const std::string &button, MouseContext context,
+ PyObject *func)
+{
+ if (!PyCallable_Check(func)) {
+ PyErr_SetString(PyExc_TypeError, "Invalid callback function.");
+ return NULL;
+ }
+
+ if (!ob::Openbox::instance->bindings()->add(vectkeylist, func)) {
+ PyErr_SetString(PyExc_RuntimeError,"Unable to add binding.");
+ return NULL;
+ }
+ Py_INCREF(Py_None); return Py_None;
+}
-PyObject * bind(PyObject *keylist, PyObject *func)
+PyObject * kbind(PyObject *keylist, KeyContext context, PyObject *func)
{
if (!PyCallable_Check(func)) {
PyErr_SetString(PyExc_TypeError, "Invalid callback function.");
Py_INCREF(Py_None); return Py_None;
}
-PyObject * unbind(PyObject *keylist)
+PyObject * kunbind(PyObject *keylist)
{
if (!PyList_Check(keylist)) {
PyErr_SetString(PyExc_TypeError, "Invalid keylist. Not a list.");
Py_INCREF(Py_None); return Py_None;
}
-void unbind_all()
+void kunbind_all()
{
ob::Openbox::instance->bindings()->removeAll();
}
%include "openbox.hh"
%include "screen.hh"
%include "client.hh"
+%include "python.hh"
// for Mod1Mask etc
%include "X11/X.h"