+ if ((n = obt_parse_find_node(node, "autoHide")))
+ config_dock_hide = obt_parse_node_bool(n);
+ if ((n = obt_parse_find_node(node, "hideDelay")))
+ config_dock_hide_delay = obt_parse_node_int(n);
+ if ((n = obt_parse_find_node(node, "showDelay")))
+ config_dock_show_delay = obt_parse_node_int(n);
+ if ((n = obt_parse_find_node(node, "moveButton"))) {
+ gchar *str = obt_parse_node_string(n);
+ guint b, s;
+ if (translate_button(str, &s, &b)) {
+ config_dock_app_move_button = b;
+ config_dock_app_move_modifiers = s;
+ } else {
+ g_message(_("Invalid button \"%s\" specified in config file"), str);
+ }
+ g_free(str);
+ }
+}
+
+static void parse_menu(xmlNodePtr node, gpointer d)
+{
+ xmlNodePtr n;
+ for (node = node->children; node; node = node->next) {
+ if (!xmlStrcasecmp(node->name, (const xmlChar*) "file")) {
+ gchar *c;
+
+ c = obt_parse_node_string(node);
+ config_menu_files = g_slist_append(config_menu_files,
+ obt_paths_expand_tilde(c));
+ g_free(c);
+ }
+ if ((n = obt_parse_find_node(node, "hideDelay")))
+ config_menu_hide_delay = obt_parse_node_int(n);
+ if ((n = obt_parse_find_node(node, "middle")))
+ config_menu_middle = obt_parse_node_bool(n);
+ if ((n = obt_parse_find_node(node, "submenuShowDelay")))
+ config_submenu_show_delay = obt_parse_node_int(n);
+ if ((n = obt_parse_find_node(node, "applicationIcons")))
+ config_menu_client_list_icons = obt_parse_node_bool(n);
+ if ((n = obt_parse_find_node(node, "manageDesktops")))
+ config_menu_manage_desktops = obt_parse_node_bool(n);
+ }
+}
+
+static void parse_resistance(xmlNodePtr node, gpointer d)
+{
+ xmlNodePtr n;
+
+ node = node->children;
+ if ((n = obt_parse_find_node(node, "strength")))
+ config_resist_win = obt_parse_node_int(n);
+ if ((n = obt_parse_find_node(node, "screen_edge_strength")))
+ config_resist_edge = obt_parse_node_int(n);
+}
+
+typedef struct
+{
+ const gchar *key;
+ const gchar *actname;
+} ObDefKeyBind;
+
+static void bind_default_keyboard(void)
+{
+ ObDefKeyBind *it;
+ ObDefKeyBind binds[] = {
+ { "A-Tab", "NextWindow" },
+ { "S-A-Tab", "PreviousWindow" },
+ { "A-F4", "Close" },
+ { NULL, NULL }
+ };
+ for (it = binds; it->key; ++it) {
+ GList *l = g_list_append(NULL, g_strdup(it->key));
+ keyboard_bind(l, actions_parse_string(it->actname));
+ }
+}
+
+typedef struct
+{
+ const gchar *button;
+ const gchar *context;
+ const ObMouseAction mact;
+ const gchar *actname;
+} ObDefMouseBind;
+
+static void bind_default_mouse(void)
+{
+ ObDefMouseBind *it;
+ ObDefMouseBind binds[] = {
+ { "Left", "Client", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Middle", "Client", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Right", "Client", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "Desktop", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Middle", "Desktop", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Right", "Desktop", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "Titlebar", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "Bottom", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "BLCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "BRCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "TLCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "TRCorner", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "Close", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "Maximize", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "Iconify", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "Icon", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "AllDesktops", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "Shade", OB_MOUSE_ACTION_PRESS, "Focus" },
+ { "Left", "Client", OB_MOUSE_ACTION_CLICK, "Raise" },
+ { "Left", "Titlebar", OB_MOUSE_ACTION_CLICK, "Raise" },
+ { "Middle", "Titlebar", OB_MOUSE_ACTION_CLICK, "Lower" },
+ { "Left", "BLCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
+ { "Left", "BRCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
+ { "Left", "TLCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
+ { "Left", "TRCorner", OB_MOUSE_ACTION_CLICK, "Raise" },
+ { "Left", "Close", OB_MOUSE_ACTION_CLICK, "Raise" },
+ { "Left", "Maximize", OB_MOUSE_ACTION_CLICK, "Raise" },
+ { "Left", "Iconify", OB_MOUSE_ACTION_CLICK, "Raise" },
+ { "Left", "Icon", OB_MOUSE_ACTION_CLICK, "Raise" },
+ { "Left", "AllDesktops", OB_MOUSE_ACTION_CLICK, "Raise" },
+ { "Left", "Shade", OB_MOUSE_ACTION_CLICK, "Raise" },
+ { "Left", "Close", OB_MOUSE_ACTION_CLICK, "Close" },
+ { "Left", "Maximize", OB_MOUSE_ACTION_CLICK, "ToggleMaximize" },
+ { "Left", "Iconify", OB_MOUSE_ACTION_CLICK, "Iconify" },
+ { "Left", "AllDesktops", OB_MOUSE_ACTION_CLICK, "ToggleOmnipresent" },
+ { "Left", "Shade", OB_MOUSE_ACTION_CLICK, "ToggleShade" },
+ { "Left", "TLCorner", OB_MOUSE_ACTION_MOTION, "Resize" },
+ { "Left", "TRCorner", OB_MOUSE_ACTION_MOTION, "Resize" },
+ { "Left", "BLCorner", OB_MOUSE_ACTION_MOTION, "Resize" },
+ { "Left", "BRCorner", OB_MOUSE_ACTION_MOTION, "Resize" },
+ { "Left", "Top", OB_MOUSE_ACTION_MOTION, "Resize" },
+ { "Left", "Bottom", OB_MOUSE_ACTION_MOTION, "Resize" },
+ { "Left", "Left", OB_MOUSE_ACTION_MOTION, "Resize" },
+ { "Left", "Right", OB_MOUSE_ACTION_MOTION, "Resize" },
+ { "Left", "Titlebar", OB_MOUSE_ACTION_MOTION, "Move" },
+ { "A-Left", "Frame", OB_MOUSE_ACTION_MOTION, "Move" },
+ { "A-Middle", "Frame", OB_MOUSE_ACTION_MOTION, "Resize" },
+ { NULL, NULL, 0, NULL }
+ };
+
+ for (it = binds; it->button; ++it)
+ mouse_bind(it->button, it->context, it->mact,
+ actions_parse_string(it->actname));