]> Dogcows Code - chaz/openbox/blobdiff - openbox/action.c
add decoration state to the frame struct. make client_configure adjust the frame...
[chaz/openbox] / openbox / action.c
index 9015939e854d5ef1e6fc0f5cc5b204f471cc6772..e166dd8bdfff95bc37cbe266d07b38007c3619d5 100644 (file)
@@ -246,11 +246,6 @@ ActionString actionstrings[] =
         action_lower,
         NULL
     },
-    {
-        "focusraise",
-        action_focusraise,
-        NULL
-    },
     {
         "close",
         action_close,
@@ -548,6 +543,56 @@ Action *action_from_string(char *name)
     return a;
 }
 
+Action *action_parse(xmlDocPtr doc, xmlNodePtr node)
+{
+    char *actname;
+    Action *act = NULL;
+    xmlNodePtr n;
+
+    if (parse_attr_string("name", node, &actname)) {
+        if ((act = action_from_string(actname))) {
+            if (act->func == action_execute || act->func == action_restart) {
+                if ((n = parse_find_node("execute", node->xmlChildrenNode)))
+                    act->data.execute.path = parse_string(doc, n);
+            } else if (act->func == action_showmenu) {
+                if ((n = parse_find_node("menu", node->xmlChildrenNode)))
+                    act->data.showmenu.name = parse_string(doc, n);
+            } else if (act->func == action_desktop) {
+                if ((n = parse_find_node("desktop", node->xmlChildrenNode)))
+                    act->data.desktop.desk = parse_int(doc, n);
+                if (act->data.desktop.desk > 0) act->data.desktop.desk--;
+            } else if (act->func == action_send_to_desktop) {
+                if ((n = parse_find_node("desktop", node->xmlChildrenNode)))
+                    act->data.sendto.desk = parse_int(doc, n);
+                if (act->data.sendto.desk > 0) act->data.sendto.desk--;
+            } else if (act->func == action_move_relative_horz ||
+                       act->func == action_move_relative_vert ||
+                       act->func == action_resize_relative_horz ||
+                       act->func == action_resize_relative_vert) {
+                if ((n = parse_find_node("delta", node->xmlChildrenNode)))
+                    act->data.relative.delta = parse_int(doc, n);
+            } else if (act->func == action_desktop_right ||
+                       act->func == action_desktop_left ||
+                       act->func == action_desktop_up ||
+                       act->func == action_desktop_down) {
+                if ((n = parse_find_node("wrap", node->xmlChildrenNode))) {
+                    g_message("WRAP %d", parse_bool(doc, n));
+                    act->data.desktopdir.wrap = parse_bool(doc, n);
+                }
+            } else if (act->func == action_send_to_desktop_right ||
+                       act->func == action_send_to_desktop_left ||
+                       act->func == action_send_to_desktop_up ||
+                       act->func == action_send_to_desktop_down) {
+                if ((n = parse_find_node("wrap", node->xmlChildrenNode)))
+                    act->data.sendtodir.wrap = parse_bool(doc, n);
+                if ((n = parse_find_node("follow", node->xmlChildrenNode)))
+                    act->data.sendtodir.follow = parse_bool(doc, n);
+            }
+        }
+    }
+    return act;
+}
+
 void action_execute(union ActionData *data)
 {
     GError *e = NULL;
@@ -583,14 +628,6 @@ void action_iconify(union ActionData *data)
         client_iconify(data->client.c, TRUE, TRUE);
 }
 
-void action_focusraise(union ActionData *data)
-{
-    if (data->client.c) {
-        client_focus(data->client.c);
-        stacking_raise(CLIENT_AS_WINDOW(data->client.c));
-    }
-}
-
 void action_raise(union ActionData *data)
 {
     if (data->client.c)
@@ -1081,7 +1118,7 @@ void action_moveresize(union ActionData *data)
 
 void action_restart(union ActionData *data)
 {
-    ob_restart_path = data->execute.path;
+    ob_restart_path = g_strdup(data->execute.path);
     ob_shutdown = ob_restart = TRUE;
 }
 
This page took 0.022522 seconds and 4 git commands to generate.