]> Dogcows Code - chaz/openbox/blobdiff - openbox/config.c
prefix/capitalize the mouse actions enum
[chaz/openbox] / openbox / config.c
index f051452348ee4531cdb042eceb4f316ca3ba610f..9e32609d55dd8ec0e77408d83a7a8381508d96e5 100644 (file)
@@ -2,6 +2,7 @@
 #include "keyboard.h"
 #include "mouse.h"
 #include "prop.h"
+#include "translate.h"
 #include "parser/parse.h"
 
 gboolean config_focus_new;
@@ -29,6 +30,9 @@ ObOrientation   config_dock_orient;
 gboolean        config_dock_hide;
 guint           config_dock_hide_timeout;
 
+guint config_keyboard_reset_keycode;
+guint config_keyboard_reset_state;
+
 gint config_mouse_threshold;
 gint config_mouse_dclicktime;
 
@@ -49,6 +53,12 @@ static void parse_key(xmlDocPtr doc, xmlNodePtr node, GList *keylist)
     xmlNodePtr n, nact;
     GList *it;
 
+    if ((n = parse_find_node("chainQuitKey", node))) {
+        key = parse_string(doc, n);
+        translate_key(key, &config_keyboard_reset_state,
+                      &config_keyboard_reset_keycode);
+    }
+
     n = parse_find_node("keybind", node);
     while (n) {
         if (parse_attr_string("key", n, &key)) {
@@ -89,8 +99,6 @@ static void parse_keyboard(xmlDocPtr doc, xmlNodePtr node, void *d)
     parse_key(doc, node->xmlChildrenNode, NULL);
 }
 
-static int threshold;
-static int dclicktime;
 /*
 
 <context name="Titlebar"> 
@@ -112,9 +120,9 @@ static void parse_mouse(xmlDocPtr doc, xmlNodePtr node, void *d)
     node = node->xmlChildrenNode;
     
     if ((n = parse_find_node("dragThreshold", node)))
-        threshold = parse_int(doc, n);
+        config_mouse_threshold = parse_int(doc, n);
     if ((n = parse_find_node("doubleClickTime", node)))
-        dclicktime = parse_int(doc, n);
+        config_mouse_dclicktime = parse_int(doc, n);
 
     n = parse_find_node("context", node);
     while (n) {
@@ -125,22 +133,22 @@ static void parse_mouse(xmlDocPtr doc, xmlNodePtr node, void *d)
             if (!parse_attr_string("button", nbut, &buttonstr))
                 goto next_nbut;
             if (parse_attr_contains("press", nbut, "action"))
-                mact = MouseAction_Press;
+                mact = OB_MOUSE_ACTION_PRESS;
             else if (parse_attr_contains("release", nbut, "action"))
-                mact = MouseAction_Release;
+                mact = OB_MOUSE_ACTION_RELEASE;
             else if (parse_attr_contains("click", nbut, "action"))
-                mact = MouseAction_Click;
+                mact = OB_MOUSE_ACTION_CLICK;
             else if (parse_attr_contains("doubleclick", nbut,"action"))
-                mact = MouseAction_DClick;
+                mact = OB_MOUSE_ACTION_DOUBLE_CLICK;
             else if (parse_attr_contains("drag", nbut, "action"))
-                mact = MouseAction_Motion;
+                mact = OB_MOUSE_ACTION_MOTION;
             else
                 goto next_nbut;
             nact = parse_find_node("action", nbut->xmlChildrenNode);
             while (nact) {
                 if ((action = action_parse(doc, nact))) {
                     /* validate that its okay for a mouse binding*/
-                    if (mact == MouseAction_Motion) {
+                    if (mact == OB_MOUSE_ACTION_MOTION) {
                         if (action->func != action_moveresize ||
                             action->data.moveresize.corner ==
                             prop_atoms.net_wm_moveresize_move_keyboard ||
@@ -343,6 +351,9 @@ void config_startup()
 
     parse_register("dock", parse_dock, NULL);
 
+    translate_key("C-g", &config_keyboard_reset_state,
+                  &config_keyboard_reset_keycode);
+
     parse_register("keyboard", parse_keyboard, NULL);
 
     config_mouse_threshold = 3;
This page took 0.022092 seconds and 4 git commands to generate.