add e actions for moving a window to next/prev screen: this can be found in Window...
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 27 Jun 2012 08:02:03 +0000 (08:02 +0000)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 27 Jun 2012 08:02:03 +0000 (08:02 +0000)
SVN revision: 72924

src/bin/e_actions.c

index 5000cb2..d502b52 100644 (file)
@@ -1208,6 +1208,41 @@ ACT_FN_GO(window_desk_move_by, )
 }
 
 /***************************************************************************/
+ACT_FN_GO(window_zone_move_by, )
+{
+   E_Border *bd;
+   E_Zone *zone;
+   int move;
+   char *end;
+
+   if (!params) return;
+   if (!obj) obj = E_OBJECT(e_border_focused_get());
+   if (!obj) return;
+   if (obj->type != E_BORDER_TYPE)
+     {
+        obj = E_OBJECT(e_border_focused_get());
+        if (!obj) return;
+     }
+
+   bd = (E_Border *)obj;
+   /* bad */
+   if (!bd->zone) return;
+   /* only one screen */
+   if (eina_list_count(bd->zone->container->zones) < 2) return;
+   errno = 0;
+   move = strtol(params, &end, 10);
+   if ((!end) || end[0] || errno) return;
+   move += bd->zone->num;
+   if (move < 0)
+     move = eina_list_count(bd->zone->container->zones) - 1;
+   else if ((unsigned int)move >= eina_list_count(bd->zone->container->zones))
+     move = 0;
+   zone = eina_list_nth(bd->zone->container->zones, move);
+   if ((!zone) || (zone->num != (unsigned int)move)) return;
+   e_border_zone_set(bd, zone);
+}
+
+/***************************************************************************/
 ACT_FN_GO(window_desk_move_to, )
 {
    E_Border *bd;
@@ -3081,6 +3116,13 @@ e_actions_init(void)
                             "window_desk_move_to", NULL,
                             "syntax: X Y, example: 0 1", 1);
 
+   /* window_zone_move_by */
+   ACT_GO(window_zone_move_by);
+   e_action_predef_name_set(N_("Window : Moving"), N_("To Next Screen"),
+                            "window_zone_move_by", "1", NULL, 0);
+   e_action_predef_name_set(N_("Window : Moving"), N_("To Previous Screen"),
+                            "window_zone_move_by", "-1", NULL, 0);
+
    /* menu_show */
    ACT_GO(menu_show);
    e_action_predef_name_set(N_("Menu"), N_("Show Main Menu"),