diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-05-24 21:47:06 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-05-24 21:47:06 +0000 |
| commit | d1e355de2c6aae38cea3cdc0e0b902ea2b194e86 (patch) | |
| tree | dcb99d7232895e2b54ed58fbaa7d3a775da9ccfc /openbox/action.c | |
| parent | 927f99e4125743bbecf41b1aa7dbce9587fb6156 (diff) | |
this is a big one! im putting stats in here just cuz!
59 files changed, 1691 insertions(+), 607 deletions(-)
Adding the beginings of ObConf. Adding a resistance-config plugin for ObConf.
Creating an obparser library that obrender can use, the kernel can use, plugins can use, and ObConf and its plugins can use. (its just code for using libXml2)
Diffstat (limited to 'openbox/action.c')
| -rw-r--r-- | openbox/action.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/openbox/action.c b/openbox/action.c index 9015939e..2dde0f0b 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -548,6 +548,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; |
