+ assert(w); // everything should be a widget
+
+ // run the MOTION python hook
+ unsigned int state = e.state & (ControlMask | ShiftMask | Mod1Mask |
+ Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask);
+ unsigned int button = _posqueue[0]->button;
+ MotionData *data = new_motion_data(e.window, e.time, state, button,
+ w->mcontext(), MouseMotion,
+ x_root, y_root, _posqueue[0]->pos,
+ _posqueue[0]->clientarea);
+ Openbox::instance->bindings()->fireButton((ButtonData*)data);
+ Py_DECREF((PyObject*)data);
+}
+
+void OBActions::mapRequestHandler(const XMapRequestEvent &e)
+{
+ doCallback(Action_NewWindow, e.window, (OBWidget::WidgetType)-1,
+ 0, 0, 0, 0, 0);
+}
+
+void OBActions::unmapHandler(const XUnmapEvent &e)
+{
+ (void)e;
+ doCallback(Action_CloseWindow, e.window, (OBWidget::WidgetType)-1,
+ 0, 0, 0, 0, 0);
+}
+
+void OBActions::destroyHandler(const XDestroyWindowEvent &e)
+{
+ (void)e;
+ doCallback(Action_CloseWindow, e.window, (OBWidget::WidgetType)-1,
+ 0, 0, 0, 0, 0);
+}
+
+void OBActions::doCallback(ActionType action, Window window,
+ OBWidget::WidgetType type, unsigned int state,
+ unsigned int button, int xroot, int yroot,
+ Time time)
+{
+ std::pair<CallbackMap::iterator, CallbackMap::iterator> it_pair =
+ _callbacks.equal_range(action);
+
+ CallbackMap::iterator it;
+// for (it = it_pair.first; it != it_pair.second; ++it)
+// python_callback(it->second, action, window, type, state,
+// button, xroot, yroot, time);
+ // XXX do a callback
+}