add e actions for moving a window to next/prev screen: this can be found in Window : Moving for keybinds

SVN revision: 72924
This commit is contained in:
Mike Blumenkrantz 2012-06-27 08:02:03 +00:00
parent 4febddc346
commit 54f2079b25
1 changed files with 42 additions and 0 deletions

View File

@ -1207,6 +1207,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, )
{
@ -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"),