martin geisler's patch :)

SVN revision: 15656
This commit is contained in:
Carsten Haitzler 2005-07-07 03:55:29 +00:00
parent 94d2f8e8bd
commit 1a489c344e
1 changed files with 112 additions and 0 deletions

View File

@ -287,6 +287,112 @@ ACT_FN_GO(window_shaded_toggle)
}
}
/***************************************************************************/
ACT_FN_GO(move_relative)
{
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;
}
if (params)
{
int dx, dy;
if (sscanf(params, "%i %i", &dx, &dy) == 2) {
E_Border *bd;
bd = (E_Border *)obj;
e_border_move(bd, bd->x + dx, bd->y + dy);
if (e_config->focus_policy != E_FOCUS_CLICK)
ecore_x_pointer_warp(bd->zone->container->win,
bd->x + (bd->w / 2),
bd->y + (bd->h / 2));
}
}
}
/***************************************************************************/
ACT_FN_GO(move_absolute)
{
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;
}
if (params)
{
E_Border *bd;
int x, y;
char cx, cy;
bd = (E_Border *)obj;
if (sscanf(params, "%c%i %c%i", &cx, &x, &cy, &y) == 4)
{
// Nothing, both x and y is updated.
}
else if (sscanf(params, "* %c%i", &cy, &y) == 2)
{
// Updated y, reset x.
x = bd->x;
}
else if (sscanf(params, "%c%i *", &cx, &x) == 2)
{
// Updated x, reset y.
y = bd->y;
}
if (cx == '-') x = bd->zone->w - bd->w - x;
if (cy == '-') y = bd->zone->h - bd->h - y;
if (x != bd->x || y != bd->y)
{
e_border_move(bd, x, y);
if (e_config->focus_policy != E_FOCUS_CLICK)
ecore_x_pointer_warp(bd->zone->container->win,
bd->x + (bd->w / 2),
bd->y + (bd->h / 2));
}
}
}
/***************************************************************************/
ACT_FN_GO(resize)
{
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;
}
if (params)
{
int dw, dh;
if (sscanf(params, "%i %i", &dw, &dh) == 2) {
E_Border *bd;
bd = (E_Border *)obj;
e_border_resize(bd, bd->w + dw, bd->h + dh);
if (e_config->focus_policy != E_FOCUS_CLICK)
ecore_x_pointer_warp(bd->zone->container->win,
bd->x + (bd->w / 2),
bd->y + (bd->h / 2));
}
}
}
/***************************************************************************/
ACT_FN_GO(desk_flip_by)
{
@ -788,6 +894,12 @@ e_actions_init(void)
ACT_GO(desk_linear_flip_to);
ACT_GO(move_absolute);
ACT_GO(move_relative);
ACT_GO(resize);
ACT_GO(menu_show);
ACT_GO_MOUSE(menu_show);
ACT_GO_KEY(menu_show);