+static void parse_keyboard(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
+ void *d)
+{
+ parse_key(i, doc, node->children, NULL);
+}
+
+/*
+
+<context name="Titlebar">
+ <mousebind button="Left" action="Press">
+ <action name="Raise"></action>
+ </mousebind>
+</context>
+
+*/
+
+static void parse_mouse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
+ void *d)
+{
+ xmlNodePtr n, nbut, nact;
+ char *buttonstr;
+ char *contextstr;
+ ObUserAction uact;
+ ObMouseAction mact;
+ ObAction *action;
+
+ node = node->children;
+
+ if ((n = parse_find_node("dragThreshold", node)))
+ config_mouse_threshold = parse_int(doc, n);
+ if ((n = parse_find_node("doubleClickTime", node)))
+ config_mouse_dclicktime = parse_int(doc, n);
+
+ n = parse_find_node("context", node);
+ while (n) {
+ if (!parse_attr_string("name", n, &contextstr))
+ goto next_n;
+ nbut = parse_find_node("mousebind", n->children);
+ while (nbut) {
+ if (!parse_attr_string("button", nbut, &buttonstr))
+ goto next_nbut;
+ if (parse_attr_contains("press", nbut, "action")) {
+ uact = OB_USER_ACTION_MOUSE_PRESS;
+ mact = OB_MOUSE_ACTION_PRESS;
+ } else if (parse_attr_contains("release", nbut, "action")) {
+ uact = OB_USER_ACTION_MOUSE_RELEASE;
+ mact = OB_MOUSE_ACTION_RELEASE;
+ } else if (parse_attr_contains("click", nbut, "action")) {
+ uact = OB_USER_ACTION_MOUSE_CLICK;
+ mact = OB_MOUSE_ACTION_CLICK;
+ } else if (parse_attr_contains("doubleclick", nbut,"action")) {
+ uact = OB_USER_ACTION_MOUSE_DOUBLE_CLICK;
+ mact = OB_MOUSE_ACTION_DOUBLE_CLICK;
+ } else if (parse_attr_contains("drag", nbut, "action")) {
+ uact = OB_USER_ACTION_MOUSE_MOTION;
+ mact = OB_MOUSE_ACTION_MOTION;
+ } else
+ goto next_nbut;
+ nact = parse_find_node("action", nbut->children);
+ while (nact) {
+ if ((action = action_parse(i, doc, nact, uact)))
+ mouse_bind(buttonstr, contextstr, mact, action);
+ nact = parse_find_node("action", nact->next);
+ }
+ g_free(buttonstr);
+ next_nbut:
+ nbut = parse_find_node("mousebind", nbut->next);
+ }
+ g_free(contextstr);
+ next_n:
+ n = parse_find_node("context", n->next);
+ }
+}
+
+static void parse_focus(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
+ void *d)