]> Dogcows Code - chaz/openbox/blobdiff - openbox/action.c
add resizerelative action
[chaz/openbox] / openbox / action.c
index 2dca0dd5eeea079ae8d72b1429b63d5c023bd01d..24f4b36f7d91e6e6113234e149f8d9d710d99346 100644 (file)
@@ -162,13 +162,6 @@ void setup_action_send_to_desktop_down(ObAction **a, ObUserAction uact)
     (*a)->data.sendtodir.follow = TRUE;
 }
 
-void setup_action_desktop(ObAction **a, ObUserAction uact)
-{
-/*
-    (*a)->data.desktop.inter.any.interactive = FALSE;
-*/
-}
-
 void setup_action_desktop_prev(ObAction **a, ObUserAction uact)
 {
     (*a)->data.desktopdir.inter.any.interactive = TRUE;
@@ -352,16 +345,6 @@ ActionString actionstrings[] =
         action_unshaderaise,
         setup_client_action
     },
-    {
-        "resizerelativevert",
-        action_resize_relative_vert,
-        setup_client_action
-    },
-    {
-        "resizerelative",
-        action_resize_relative,
-        setup_client_action
-    },
     {
         "sendtodesktop",
         action_send_to_desktop,
@@ -397,51 +380,11 @@ ActionString actionstrings[] =
         action_send_to_desktop_dir,
         setup_action_send_to_desktop_down
     },
-    {
-        "desktop",
-        action_desktop,
-        setup_action_desktop
-    },
-    {
-        "desktopnext",
-        action_desktop_dir,
-        setup_action_desktop_next
-    },
-    {
-        "desktopprevious",
-        action_desktop_dir,
-        setup_action_desktop_prev
-    },
-    {
-        "desktopright",
-        action_desktop_dir,
-        setup_action_desktop_right
-    },
-    {
-        "desktopleft",
-        action_desktop_dir,
-        setup_action_desktop_left
-    },
-    {
-        "desktopup",
-        action_desktop_dir,
-        setup_action_desktop_up
-    },
-    {
-        "desktopdown",
-        action_desktop_dir,
-        setup_action_desktop_down
-    },
     {
         "toggledockautohide",
         action_toggle_dockautohide,
         NULL
     },
-    {
-        "desktoplast",
-        action_desktop_last,
-        NULL
-    },
     {
         "sendtotoplayer",
         action_send_to_layer,
@@ -595,36 +538,13 @@ ObAction *action_parse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
 
     if (parse_attr_string("name", node, &actname)) {
         if ((act = action_from_string(actname, uact))) {
-            } else if (act->func == action_resize_relative) {
-                if ((n = parse_find_node("left", node->xmlChildrenNode)))
-                    act->data.relative.deltaxl = parse_int(doc, n);
-                if ((n = parse_find_node("up", node->xmlChildrenNode)))
-                    act->data.relative.deltayu = parse_int(doc, n);
-                if ((n = parse_find_node("right", node->xmlChildrenNode)))
-                    act->data.relative.deltax = parse_int(doc, n);
-                if ((n = parse_find_node("down", node->xmlChildrenNode)))
-                    act->data.relative.deltay = parse_int(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--;
-/*
-                if ((n = parse_find_node("dialog", node->xmlChildrenNode)))
-                    act->data.desktop.inter.any.interactive =
-                        parse_bool(doc, n);
-*/
            } 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--;
                 if ((n = parse_find_node("follow", node->xmlChildrenNode)))
                     act->data.sendto.follow = parse_bool(doc, n);
-            } else if (act->func == action_desktop_dir) {
-                if ((n = parse_find_node("wrap", node->xmlChildrenNode)))
-                    act->data.desktopdir.wrap = parse_bool(doc, n); 
-                if ((n = parse_find_node("dialog", node->xmlChildrenNode)))
-                    act->data.desktopdir.inter.any.interactive =
-                        parse_bool(doc, n);
             } else if (act->func == action_send_to_desktop_dir) {
                 if ((n = parse_find_node("wrap", node->xmlChildrenNode)))
                     act->data.sendtodir.wrap = parse_bool(doc, n);
@@ -756,55 +676,8 @@ void action_shadelower(union ActionData *data)
         action_shade(data);
 }
 
-void action_resize_relative_horz(union ActionData *data)
-{
-    ObClient *c = data->relative.any.c;
-    client_action_start(data);
-    client_resize(c,
-                  c->area.width + data->relative.deltax * c->size_inc.width,
-                  c->area.height);
-    client_action_end(data, FALSE);
-}
-
-void action_resize_relative_vert(union ActionData *data)
-{
-    ObClient *c = data->relative.any.c;
-    if (!c->shaded) {
-        client_action_start(data);
-        client_resize(c, c->area.width, c->area.height +
-                      data->relative.deltax * c->size_inc.height);
-        client_action_end(data, FALSE);
-    }
-}
-
 void action_resize_relative(union ActionData *data)
 {
-    ObClient *c = data->relative.any.c;
-    gint x, y, ow, xoff, nw, oh, yoff, nh, lw, lh;
-
-    client_action_start(data);
-
-    x = c->area.x;
-    y = c->area.y;
-    ow = c->area.width;
-    xoff = -data->relative.deltaxl * c->size_inc.width;
-    nw = ow + data->relative.deltax * c->size_inc.width
-        + data->relative.deltaxl * c->size_inc.width;
-    oh = c->area.height;
-    yoff = -data->relative.deltayu * c->size_inc.height;
-    nh = oh + data->relative.deltay * c->size_inc.height
-        + data->relative.deltayu * c->size_inc.height;
-
-    g_print("deltax %d %d x %d ow %d xoff %d nw %d\n",
-            data->relative.deltax, 
-            data->relative.deltaxl, 
-            x, ow, xoff, nw);
-    
-    client_try_configure(c, &x, &y, &nw, &nh, &lw, &lh, TRUE);
-    xoff = xoff == 0 ? 0 : (xoff < 0 ? MAX(xoff, ow-nw) : MIN(xoff, ow-nw));
-    yoff = yoff == 0 ? 0 : (yoff < 0 ? MAX(yoff, oh-nh) : MIN(yoff, oh-nh));
-    client_move_resize(c, x + xoff, y + yoff, nw, nh);
-    client_action_end(data, FALSE);
 }
 
 void action_send_to_desktop(union ActionData *data)
@@ -821,40 +694,6 @@ void action_send_to_desktop(union ActionData *data)
     }
 }
 
-void action_desktop(union ActionData *data)
-{
-    /* XXX add the interactive/dialog option back again once the dialog
-       has been made to not use grabs */
-    if (data->desktop.desk < screen_num_desktops ||
-        data->desktop.desk == DESKTOP_ALL)
-    {
-        screen_set_desktop(data->desktop.desk, TRUE);
-        if (data->inter.any.interactive)
-            screen_desktop_popup(data->desktop.desk, TRUE);
-    }
-}
-
-void action_desktop_dir(union ActionData *data)
-{
-    guint d;
-
-    d = screen_cycle_desktop(data->desktopdir.dir,
-                             data->desktopdir.wrap,
-                             data->desktopdir.linear,
-                             data->desktopdir.inter.any.interactive,
-                             data->desktopdir.inter.final,
-                             data->desktopdir.inter.cancel);
-    /* only move the desktop when the action is complete. if we switch
-       desktops during the interactive action, focus will move but with
-       NotifyWhileGrabbed and applications don't like that. */
-    if (!data->sendtodir.inter.any.interactive ||
-        (data->sendtodir.inter.final && !data->sendtodir.inter.cancel))
-    {
-        if (d != screen_desktop)
-            screen_set_desktop(d, TRUE);
-    }
-}
-
 void action_send_to_desktop_dir(union ActionData *data)
 {
     ObClient *c = data->sendtodir.inter.any.c;
@@ -879,12 +718,6 @@ void action_send_to_desktop_dir(union ActionData *data)
     }
 }
 
-void action_desktop_last(union ActionData *data)
-{
-    if (screen_last_desktop < screen_num_desktops)
-        screen_set_desktop(screen_last_desktop, TRUE);
-}
-
 void action_directional_focus(union ActionData *data)
 {
     /* if using focus_delay, stop the timer now so that focus doesn't go moving
This page took 0.025384 seconds and 4 git commands to generate.