summaryrefslogtreecommitdiff
path: root/src/openbox.i
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-01-03 00:26:36 +0000
committerDana Jansens <danakj@orodu.net>2003-01-03 00:26:36 +0000
commit579ed5aa8d1b33a69476c2182a98ebc30557f096 (patch)
treea898cca77fa4e5dd63b174069b2cef4e5ebb0be2 /src/openbox.i
parent4721c53868187d10e3732cea63efa9fbd352178d (diff)
trasitioning for new button event handling
Diffstat (limited to 'src/openbox.i')
-rw-r--r--src/openbox.i30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/openbox.i b/src/openbox.i
index b88175d9..dfd532f3 100644
--- a/src/openbox.i
+++ b/src/openbox.i
@@ -14,8 +14,8 @@
#include "actions.hh"
%}
-%include stl.i
-%include exception.i
+%include "stl.i"
+%include "exception.i"
//%include std_list.i
//%template(ClientList) std::list<OBClient*>;
@@ -49,13 +49,13 @@
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.");
@@ -95,8 +95,23 @@ PyObject * unregister_all(int action)
}
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.");
@@ -125,7 +140,7 @@ PyObject * bind(PyObject *keylist, PyObject *func)
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.");
@@ -147,7 +162,7 @@ PyObject * unbind(PyObject *keylist)
Py_INCREF(Py_None); return Py_None;
}
-void unbind_all()
+void kunbind_all()
{
ob::Openbox::instance->bindings()->removeAll();
}
@@ -183,6 +198,7 @@ void set_reset_key(const std::string &key)
%include "openbox.hh"
%include "screen.hh"
%include "client.hh"
+%include "python.hh"
// for Mod1Mask etc
%include "X11/X.h"