X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fopenbox_wrap.cc;h=f4db077c2120ba4d8c4d88f3804c26aeb4cb8b91;hb=e05d5f7934ce27893f900627fbd06b1679d4c0ad;hp=ada473b6b6ccca6350549da16907984acf517fbe;hpb=66a26917a0631463df7f72c34cbeb39df466918a;p=chaz%2Fopenbox diff --git a/src/openbox_wrap.cc b/src/openbox_wrap.cc index ada473b6..f4db077c 100644 --- a/src/openbox_wrap.cc +++ b/src/openbox_wrap.cc @@ -780,13 +780,14 @@ static std::string SwigString_AsString(PyObject* o) { enum ActionType { Action_ButtonPress, - Action_ButtonRelease, Action_Click, Action_DoubleClick, Action_EnterWindow, Action_LeaveWindow, Action_KeyPress, - Action_MouseMotion + Action_MouseMotion, + Action_NewWindow, + Action_CloseWindow }; enum WidgetType { Type_Frame, @@ -848,6 +849,10 @@ PyObject * unregister_all(int action) PyObject * bind(PyObject *keylist, PyObject *func) { + if (!PyCallable_Check(func)) { + PyErr_SetString(PyExc_TypeError, "Invalid callback function."); + return NULL; + } if (!PyList_Check(keylist)) { PyErr_SetString(PyExc_TypeError, "Invalid keylist. Not a list."); return NULL; @@ -2911,13 +2916,14 @@ _swigt__p_XUnmapEvent, static swig_const_info swig_const_table[] = { { SWIG_PY_INT, (char *)"Action_ButtonPress", (long) Action_ButtonPress, 0, 0, 0}, -{ SWIG_PY_INT, (char *)"Action_ButtonRelease", (long) Action_ButtonRelease, 0, 0, 0}, { SWIG_PY_INT, (char *)"Action_Click", (long) Action_Click, 0, 0, 0}, { SWIG_PY_INT, (char *)"Action_DoubleClick", (long) Action_DoubleClick, 0, 0, 0}, { SWIG_PY_INT, (char *)"Action_EnterWindow", (long) Action_EnterWindow, 0, 0, 0}, { SWIG_PY_INT, (char *)"Action_LeaveWindow", (long) Action_LeaveWindow, 0, 0, 0}, { SWIG_PY_INT, (char *)"Action_KeyPress", (long) Action_KeyPress, 0, 0, 0}, { SWIG_PY_INT, (char *)"Action_MouseMotion", (long) Action_MouseMotion, 0, 0, 0}, +{ SWIG_PY_INT, (char *)"Action_NewWindow", (long) Action_NewWindow, 0, 0, 0}, +{ SWIG_PY_INT, (char *)"Action_CloseWindow", (long) Action_CloseWindow, 0, 0, 0}, { SWIG_PY_INT, (char *)"Type_Frame", (long) Type_Frame, 0, 0, 0}, { SWIG_PY_INT, (char *)"Type_Titlebar", (long) Type_Titlebar, 0, 0, 0}, { SWIG_PY_INT, (char *)"Type_Handle", (long) Type_Handle, 0, 0, 0},