+ if ((n = parse_find_node("autoHide", node)))
+ config_dock_hide = parse_bool(doc, n);
+ if ((n = parse_find_node("hideDelay", node)))
+ config_dock_hide_delay = parse_int(doc, n);
+ if ((n = parse_find_node("showDelay", node)))
+ config_dock_show_delay = parse_int(doc, n);
+ if ((n = parse_find_node("moveButton", node))) {
+ gchar *str = parse_string(doc, 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(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
+ gpointer data)
+{
+ xmlNodePtr n;
+ node = node->children;
+
+ if ((n = parse_find_node("hideDelay", node)))
+ config_menu_hide_delay = parse_int(doc, n);
+ if ((n = parse_find_node("middle", node)))
+ config_menu_middle = parse_bool(doc, n);
+ if ((n = parse_find_node("submenuShowDelay", node)))
+ config_submenu_show_delay = parse_int(doc, n);
+ if ((n = parse_find_node("applicationIcons", node)))
+ config_menu_client_list_icons = parse_bool(doc, n);
+ if ((n = parse_find_node("manageDesktops", node)))
+ config_menu_manage_desktops = parse_bool(doc, n);
+
+ while ((node = parse_find_node("file", node))) {
+ gchar *c = parse_string(doc, node);
+ config_menu_files = g_slist_append(config_menu_files,
+ parse_expand_tilde(c));
+ g_free(c);
+ node = node->next;
+ }
+}
+
+static void parse_resistance(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
+ gpointer data)
+{
+ xmlNodePtr n;
+
+ node = node->children;
+ if ((n = parse_find_node("strength", node)))
+ config_resist_win = parse_int(doc, n);
+ if ((n = parse_find_node("screen_edge_strength", node)))
+ config_resist_edge = parse_int(doc, 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 }
+ };