Add all the action names used in 3.4 so configs don't break
[mikachu/openbox.git] / openbox / actions / maximize.c
index bb6f470..5cc7141 100644 (file)
@@ -12,10 +12,14 @@ typedef struct {
     MaxDirection dir;
 } Options;
 
-static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node);
+static gpointer setup_func(xmlNodePtr node);
 static gboolean run_func_on(ObActionsData *data, gpointer options);
 static gboolean run_func_off(ObActionsData *data, gpointer options);
 static gboolean run_func_toggle(ObActionsData *data, gpointer options);
+/* 3.4-compatibility */
+static gpointer setup_both_func(xmlNodePtr node);
+static gpointer setup_horz_func(xmlNodePtr node);
+static gpointer setup_vert_func(xmlNodePtr node);
 
 void action_maximize_startup(void)
 {
@@ -25,9 +29,28 @@ void action_maximize_startup(void)
                      NULL, NULL);
     actions_register("ToggleMaximize", setup_func, g_free, run_func_toggle,
                      NULL, NULL);
+    /* 3.4-compatibility */
+    actions_register("MaximizeFull", setup_both_func, g_free,
+                     run_func_on, NULL, NULL);
+    actions_register("UnmaximizeFull", setup_both_func, g_free,
+                     run_func_off, NULL, NULL);
+    actions_register("ToggleMaximizeFull", setup_both_func, g_free,
+                     run_func_toggle, NULL, NULL);
+    actions_register("MaximizeHorz", setup_horz_func, g_free,
+                     run_func_on, NULL, NULL);
+    actions_register("UnmaximizeHorz", setup_horz_func, g_free,
+                     run_func_off, NULL, NULL);
+    actions_register("ToggleMaximizeHorz", setup_horz_func, g_free,
+                     run_func_toggle, NULL, NULL);
+    actions_register("MaximizeVert", setup_vert_func, g_free,
+                     run_func_on, NULL, NULL);
+    actions_register("UnmaximizeVert", setup_vert_func, g_free,
+                     run_func_off, NULL, NULL);
+    actions_register("ToggleMaximizeVert", setup_vert_func, g_free,
+                     run_func_toggle, NULL, NULL);
 }
 
-static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
+static gpointer setup_func(xmlNodePtr node)
 {
     xmlNodePtr n;
     Options *o;
@@ -35,8 +58,8 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
     o = g_new0(Options, 1);
     o->dir = BOTH;
 
-    if ((n = parse_find_node("direction", node))) {
-        gchar *s = parse_string(doc, n);
+    if ((n = obt_parse_find_node(node, "direction"))) {
+        gchar *s = obt_parse_node_string(n);
         if (!g_ascii_strcasecmp(s, "vertical") ||
             !g_ascii_strcasecmp(s, "vert"))
             o->dir = VERT;
@@ -89,3 +112,26 @@ static gboolean run_func_toggle(ObActionsData *data, gpointer options)
     }
     return FALSE;
 }
+
+/* 3.4-compatibility */
+static gpointer setup_both_func(xmlNodePtr node)
+{
+    Options *o = g_new0(Options, 1);
+    o->dir = BOTH;
+    return o;
+}
+
+static gpointer setup_horz_func(xmlNodePtr node)
+{
+    Options *o = g_new0(Options, 1);
+    o->dir = HORZ;
+    return o;
+}
+
+static gpointer setup_vert_func(xmlNodePtr node)
+{
+    Options *o = g_new0(Options, 1);
+    o->dir = VERT;
+    return o;
+}
+