%rename(register) ob::python_register;
%rename(preregister) ob::python_preregister;
%rename(unregister) ob::python_unregister;
+%rename(unregister_all) ob::python_unregister_all;
%ignore ob::OBScreen::clients;
%{
}
+static PyObject *_wrap_unregister_all(PyObject *self, PyObject *args) {
+ PyObject *resultobj;
+ int arg1 ;
+ bool result;
+
+ if(!PyArg_ParseTuple(args,(char *)"i:unregister_all",&arg1)) goto fail;
+ result = (bool)ob::python_unregister_all(arg1);
+
+ resultobj = PyInt_FromLong((long)result);
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
static PyMethodDef SwigMethods[] = {
{ (char *)"Openbox_instance", _wrap_Openbox_instance, METH_VARARGS },
{ (char *)"Cursors_session_set", _wrap_Cursors_session_set, METH_VARARGS },
{ (char *)"register", _wrap_register, METH_VARARGS },
{ (char *)"preregister", _wrap_preregister, METH_VARARGS },
{ (char *)"unregister", _wrap_unregister, METH_VARARGS },
+ { (char *)"unregister_all", _wrap_unregister_all, METH_VARARGS },
{ NULL, NULL }
};
return true;
}
+bool python_unregister_all(int action)
+{
+ if (action < 0 || action >= OBActions::NUM_ACTIONS) {
+ PyErr_SetString(PyExc_AssertionError, "Invalid action type.");
+ return false;
+ }
+
+ while (!callbacks[action].empty()) {
+ Py_XDECREF(callbacks[action].back());
+ callbacks[action].pop_back();
+ }
+ return true;
+}
+
void python_callback(OBActions::ActionType action, Window window,
OBWidget::WidgetType type, unsigned int state,
long d1, long d2, long d3, long d4)
//! Remove a python callback function from the hook list
bool python_unregister(int action, PyObject *callback);
+//! Removes all python callback functions from the hook list
+bool python_unregister_all(int action);
+
//! Fire a python callback function
void python_callback(OBActions::ActionType action, Window window,
OBWidget::WidgetType type, unsigned int state,