1 #include "openbox/actions.h"
2 #include "openbox/screen.h"
10 static gpointer setup_func(xmlNodePtr node);
11 static gpointer setup_add_func(xmlNodePtr node);
12 static gpointer setup_remove_func(xmlNodePtr node);
13 static gboolean run_func(ObActionsData *data, gpointer options);
15 void action_addremovedesktop_startup(void)
17 actions_register("AddDesktop", setup_add_func, g_free, run_func,
19 actions_register("RemoveDesktop", setup_remove_func, g_free, run_func,
23 static gpointer setup_func(xmlNodePtr node)
28 o = g_new0(Options, 1);
30 if ((n = obt_parse_find_node(node, "where"))) {
31 gchar *s = obt_parse_node_string(n);
32 if (!g_ascii_strcasecmp(s, "last"))
34 else if (!g_ascii_strcasecmp(s, "current"))
42 static gpointer setup_add_func(xmlNodePtr node)
44 Options *o = setup_func(node);
49 static gpointer setup_remove_func(xmlNodePtr node)
51 Options *o = setup_func(node);
56 /* Always return FALSE because its not interactive */
57 static gboolean run_func(ObActionsData *data, gpointer options)
61 actions_client_move(data, TRUE);
64 screen_add_desktop(o->current);
66 screen_remove_desktop(o->current);
68 actions_client_move(data, FALSE);