Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h actions.c borders.c buttons.c desktops.c dialog.c edge.c
events.c ewins.c ewins.h iconify.c menus.c moveresize.c
pager.c warp.c x.c
Log Message:
Move some global vars around, cleanups.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.480
retrieving revision 1.481
diff -u -3 -r1.480 -r1.481
--- E.h 13 Aug 2005 16:23:59 -0000 1.480
+++ E.h 15 Aug 2005 16:57:10 -0000 1.481
@@ -774,10 +774,21 @@
} display;
struct
{
+ int x, y;
+ int px, py;
+ Time last_btime;
+ Window last_bpress;
+ unsigned int last_button;
+ unsigned int last_keycode;
+ char double_click;
+ } events;
+ struct
+ {
Group *current;
} groups;
struct
{
+ int server_grabbed;
char pointer_grab_active;
Window pointer_grab_window;
} grabs;
@@ -834,16 +845,10 @@
} wm;
int mode;
char flipp;
- int resize_detail;
- int win_x, win_y, win_w, win_h;
- int start_x, start_y;
- char have_place_grab;
char action_inhibit;
EWin *focuswin;
EWin *mouse_over_ewin;
EWin *context_ewin;
- int px, py, x, y;
- int server_grabbed;
int deskdrag;
Colormap current_cmap;
Window context_win;
@@ -851,11 +856,6 @@
char nogroup;
char keybinds_changed;
Window button_proxy_win;
- Time last_time;
- Window last_bpress;
- unsigned int last_button;
- unsigned int last_keycode;
- char double_click;
}
EMode;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/actions.c,v
retrieving revision 1.190
retrieving revision 1.191
diff -u -3 -r1.190 -r1.191
--- actions.c 2 Aug 2005 16:50:34 -0000 1.190
+++ actions.c 15 Aug 2005 16:57:13 -0000 1.191
@@ -455,10 +455,10 @@
{
int j;
- ev.x = Mode.x;
- ev.y = Mode.y;
- ev.x_root = Mode.x;
- ev.y_root = Mode.y;
+ ev.x = Mode.events.x;
+ ev.y = Mode.events.y;
+ ev.x_root = Mode.events.x;
+ ev.y_root = Mode.events.y;
for (j = 0; j < (int)(sizeof(ks) / sizeof(struct _keyset));
j++)
{
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.271
retrieving revision 1.272
diff -u -3 -r1.271 -r1.272
--- borders.c 4 Aug 2005 16:01:40 -0000 1.271
+++ borders.c 15 Aug 2005 16:57:13 -0000 1.272
@@ -886,7 +886,7 @@
#endif
BorderWinpartChange(ewin, part, 0);
- if (wbit->win == Mode.last_bpress && !wbit->left &&
+ if (wbit->win == Mode.events.last_bpress && !wbit->left &&
ewin->border->part[part].aclass)
ActionclassEvent(ewin->border->part[part].aclass, ev, ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/buttons.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -3 -r1.69 -r1.70
--- buttons.c 13 Aug 2005 16:23:59 -0000 1.69
+++ buttons.c 15 Aug 2005 16:57:13 -0000 1.70
@@ -67,6 +67,7 @@
char loading_user;
char move_pending;
char action_inhibit;
+ int start_x, start_y;
} Mode_buttons;
static void ButtonHandleEvents(XEvent * ev, void *btn);
@@ -479,10 +480,8 @@
GrabPointerSet(EoGetWin(b), ECSR_GRAB, 0);
Mode.mode = MODE_BUTTONDRAG;
Mode_buttons.move_pending = 1;
- Mode.start_x = Mode.x;
- Mode.start_y = Mode.y;
- Mode.win_x = EoGetX(b);
- Mode.win_y = EoGetY(b);
+ Mode_buttons.start_x = Mode.events.x;
+ Mode_buttons.start_y = Mode.events.y;
}
static void
@@ -494,7 +493,7 @@
if (!Mode_buttons.move_pending)
{
- d = DesktopAt(Mode.x, Mode.y);
+ d = DesktopAt(Mode.events.x, Mode.events.y);
ButtonMoveToDesktop(b, d);
d = EoGetDesk(b);
ButtonMoveRelative(b, -DeskGetX(d), -DeskGetY(d));
@@ -614,15 +613,15 @@
if (Mode.mode != MODE_BUTTONDRAG)
return;
- dx = Mode.x - Mode.px;
- dy = Mode.y - Mode.py;
+ dx = Mode.events.x - Mode.events.px;
+ dy = Mode.events.y - Mode.events.py;
if (Mode_buttons.move_pending)
{
int x, y;
- x = Mode.x - Mode.start_x;
- y = Mode.y - Mode.start_y;
+ x = Mode.events.x - Mode_buttons.start_x;
+ y = Mode.events.y - Mode_buttons.start_y;
if (x < 0)
x = -x;
if (y < 0)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -3 -r1.166 -r1.167
--- desktops.c 14 Aug 2005 19:34:20 -0000 1.166
+++ desktops.c 15 Aug 2005 16:57:13 -0000 1.167
@@ -1337,10 +1337,6 @@
Mode.deskdrag = desk;
Mode.mode = MODE_DESKDRAG;
- Mode.start_x = Mode.x;
- Mode.start_y = Mode.y;
- Mode.win_x = EoGetX(d);
- Mode.win_y = EoGetY(d);
}
void
@@ -1349,8 +1345,8 @@
Desk *d;
int desk, dx, dy;
- dx = Mode.x - Mode.px;
- dy = Mode.y - Mode.py;
+ dx = Mode.events.x - Mode.events.px;
+ dy = Mode.events.y - Mode.events.py;
desk = Mode.deskdrag;
d = _DeskGet(desk);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/dialog.c,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -3 -r1.125 -r1.126
--- dialog.c 10 Aug 2005 15:20:26 -0000 1.125
+++ dialog.c 15 Aug 2005 16:57:13 -0000 1.126
@@ -2081,8 +2081,8 @@
break;
if (ev->xmotion.window == di->item.slider.knob_win)
{
- dx = Mode.x - Mode.px;
- dy = Mode.y - Mode.py;
+ dx = Mode.events.x - Mode.events.px;
+ dy = Mode.events.y - Mode.events.py;
if (di->item.slider.horizontal)
{
di->item.slider.wanted_val += dx;
@@ -2259,7 +2259,7 @@
Window win = ev->xbutton.window;
DItem *di, *dii;
- if (win != Mode.last_bpress)
+ if (win != Mode.events.last_bpress)
return;
di = DialogFindDItem(d, win);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/edge.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- edge.c 7 Aug 2005 20:33:16 -0000 1.19
+++ edge.c 15 Aug 2005 16:57:13 -0000 1.20
@@ -88,16 +88,16 @@
dx = 0;
if (ah == 1)
dy = 0;
- Mode.px = Mode.x;
- Mode.py = Mode.y;
- Mode.x += dx;
- Mode.y += dy;
- EWarpPointer(VRoot.win, Mode.x, Mode.y);
+ Mode.events.px = Mode.events.x;
+ Mode.events.py = Mode.events.y;
+ Mode.events.x += dx;
+ Mode.events.y += dy;
+ EWarpPointer(VRoot.win, Mode.events.x, Mode.events.y);
Mode.flipp = 1;
MoveCurrentAreaBy(dax, day);
Mode.flipp = 0;
- Mode.px = Mode.x;
- Mode.py = Mode.y;
+ Mode.events.px = Mode.events.x;
+ Mode.events.py = Mode.events.y;
}
static void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/events.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -3 -r1.96 -r1.97
--- events.c 10 Aug 2005 15:21:28 -0000 1.96
+++ events.c 15 Aug 2005 16:57:13 -0000 1.97
@@ -147,12 +147,12 @@
if (Mode.wm.window)
{
XTranslateCoordinates(disp, rwin, VRoot.win,
- rx, ry, &Mode.x, &Mode.y, &child);
+ rx, ry, &Mode.events.x, &Mode.events.y, &child);
}
else
{
- Mode.x = rx;
- Mode.y = ry;
+ Mode.events.x = rx;
+ Mode.events.y = ry;
}
}
@@ -167,7 +167,7 @@
switch (ev->type)
{
case KeyPress:
- Mode.last_keycode = ev->xkey.keycode;
+ Mode.events.last_keycode = ev->xkey.keycode;
case KeyRelease:
ModeGetXY(ev->xbutton.root, ev->xkey.x_root, ev->xkey.y_root);
#if 0 /* FIXME - Why? */
@@ -182,10 +182,12 @@
}
#endif
goto do_stuff;
+
case ButtonPress:
case ButtonRelease:
ModeGetXY(ev->xbutton.root, ev->xbutton.x_root, ev->xbutton.y_root);
goto do_stuff;
+
case EnterNotify:
Mode.context_win = ev->xany.window;
if (ev->xcrossing.mode == NotifyGrab &&
@@ -196,6 +198,7 @@
Mode.grabs.pointer_grab_active = 2;
}
goto do_stuff;
+
case LeaveNotify:
if (ev->xcrossing.mode == NotifyGrab &&
ev->xcrossing.detail == NotifyInferior)
@@ -222,15 +225,15 @@
case ButtonPress: /* 4 */
SoundPlay("SOUND_BUTTON_CLICK");
- Mode.double_click =
- (((ev->xbutton.time - Mode.last_time) < DOUBLE_CLICK_TIME) &&
- (ev->xbutton.button == Mode.last_button));
-
- Mode.last_bpress = ev->xbutton.window;
- Mode.last_time = ev->xbutton.time;
- Mode.last_button = ev->xbutton.button;
+ Mode.events.double_click =
+ (((ev->xbutton.time - Mode.events.last_btime) < DOUBLE_CLICK_TIME) &&
+ (ev->xbutton.button == Mode.events.last_button));
+
+ Mode.events.last_bpress = ev->xbutton.window;
+ Mode.events.last_btime = ev->xbutton.time;
+ Mode.events.last_button = ev->xbutton.button;
- if (Mode.double_click)
+ if (Mode.events.double_click)
ev->xbutton.time = 0;
break;
case ButtonRelease: /* 5 */
@@ -241,11 +244,11 @@
case MotionNotify: /* 6 */
TooltipsHandleEvent(); /* TBD */
- Mode.px = Mode.x;
- Mode.py = Mode.y;
+ Mode.events.px = Mode.events.x;
+ Mode.events.py = Mode.events.y;
ModeGetXY(ev->xmotion.root, ev->xmotion.x_root, ev->xmotion.y_root);
- DesksSetCurrent(DesktopAt(Mode.x, Mode.y));
+ DesksSetCurrent(DesktopAt(Mode.events.x, Mode.events.y));
ActionsHandleMotion();
break;
@@ -290,7 +293,7 @@
switch (ev->type)
{
case ButtonRelease: /* 5 */
- Mode.last_bpress = 0;
+ Mode.events.last_bpress = 0;
Mode.action_inhibit = 0;
break;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -3 -r1.95 -r1.96
--- ewins.c 13 Aug 2005 16:23:59 -0000 1.95
+++ ewins.c 15 Aug 2005 16:57:13 -0000 1.96
@@ -320,7 +320,7 @@
EWin *const *lst, *ewin;
int i, num;
- desk = DesktopAt(Mode.x, Mode.y);
+ desk = DesktopAt(Mode.events.x, Mode.events.y);
EQueryPointer(DeskGetWin(desk), &px, &py, NULL, NULL);
lst = EwinListGetForDesk(&num, desk);
@@ -748,8 +748,8 @@
DeskGoto(desk);
EQueryPointer(VRoot.win, &rx, &ry, NULL, NULL);
- Mode.x = rx;
- Mode.y = ry;
+ Mode.events.x = rx;
+ Mode.events.y = ry;
ewin->state.placed = 1;
/* try to center the window on the mouse pointer */
@@ -798,16 +798,15 @@
DeskGoto(desk);
EQueryPointer(VRoot.win, &rx, &ry, NULL, NULL);
- Mode.x = rx;
- Mode.y = ry;
+ Mode.events.x = rx;
+ Mode.events.y = ry;
ewin->state.placed = 1;
- x = Mode.x + 1;
- y = Mode.y + 1;
+ x = Mode.events.x + 1;
+ y = Mode.events.y + 1;
EwinMoveToDesktopAt(ewin, desk, x, y);
EwinMove(ewin, x, y);
ShowEwin(ewin);
GrabPointerSet(VRoot.win, ECSR_GRAB, 0);
- Mode.have_place_grab = 1;
Mode.place.doing_manual = 1;
EoSetFloating(ewin, 1); /* Causes reparenting to root */
ActionMoveStart(ewin, 1, 0, 0);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ewins.h 7 Aug 2005 14:06:51 -0000 1.5
+++ ewins.h 15 Aug 2005 16:57:13 -0000 1.6
@@ -39,8 +39,6 @@
const Border *previous_border;
EWinBit *bits;
- char toggle; /* FIXME - Eliminate */
-
struct
{
Window win;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -3 -r1.171 -r1.172
--- iconify.c 7 Aug 2005 22:59:25 -0000 1.171
+++ iconify.c 15 Aug 2005 16:57:13 -0000 1.172
@@ -2075,7 +2075,7 @@
name = EwinGetIconName(ewin);
if (name)
- TooltipShow(tt, name, NULL, Mode.x, Mode.y);
+ TooltipShow(tt, name, NULL, Mode.events.x, Mode.events.y);
break;
case LeaveNotify:
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.208
retrieving revision 1.209
diff -u -3 -r1.208 -r1.209
--- menus.c 14 Aug 2005 21:25:46 -0000 1.208
+++ menus.c 15 Aug 2005 16:57:13 -0000 1.209
@@ -254,20 +254,20 @@
head_num =
GetPointerScreenGeometry(&x_origin, &y_origin, &width, &height);
- if (Mode.x - x - ((int)mw / 2) > x_origin + width)
+ if (Mode.events.x - x - ((int)mw / 2) > x_origin + width)
wx = x_origin + b->border.left;
- else if (Mode.x + ((int)mw / 2) > x_origin + width)
+ else if (Mode.events.x + ((int)mw / 2) > x_origin + width)
wx = x_origin + width - mw - b->border.right;
else
- wx = Mode.x - x - (w / 2);
+ wx = Mode.events.x - x - (w / 2);
if ((wx - ((int)w / 2)) < x_origin)
wx = x_origin + b->border.left;
- if (Mode.y + (int)mh > VRoot.h)
+ if (Mode.events.y + (int)mh > VRoot.h)
wy = (y_origin + height) - mh - b->border.bottom;
else
- wy = Mode.y - y - (h / 2);
+ wy = Mode.events.y - y - (h / 2);
if ((wy - ((int)h / 2) - b->border.top) < y_origin)
wy = y_origin + b->border.top;
@@ -275,14 +275,14 @@
else
{
/* We should never get here */
- wx = Mode.x - x - (w / 2);
- wy = Mode.y - y - (h / 2);
+ wx = Mode.events.x - x - (w / 2);
+ wy = Mode.events.y - y - (h / 2);
}
}
else
{
- wx = Mode.x - x - (w / 2);
- wy = Mode.y - y - (h / 2);
+ wx = Mode.events.x - x - (w / 2);
+ wy = Mode.events.y - y - (h / 2);
}
EMoveWindow(m->win, wx, wy);
@@ -1323,25 +1323,27 @@
static int menu_scroll_dist = 4;
int my_width, my_height, x_org, y_org, head_num = 0;
- head_num = ScreenGetGeometry(Mode.x, Mode.y, &x_org, &y_org,
- &my_width, &my_height);
+ head_num =
+ ScreenGetGeometry(Mode.events.x, Mode.events.y, &x_org, &y_org,
+ &my_width, &my_height);
- if (Mode.x > ((x_org + my_width) - (menu_scroll_dist + 1)))
+ if (Mode.events.x > ((x_org + my_width) - (menu_scroll_dist + 1)))
{
- xdist = -(menu_scroll_dist + (Mode.x - (x_org + my_width)));
+ xdist = -(menu_scroll_dist + (Mode.events.x - (x_org + my_width)));
}
- else if (Mode.x < (menu_scroll_dist + x_org))
+ else if (Mode.events.x < (menu_scroll_dist + x_org))
{
- xdist = x_org + menu_scroll_dist - (Mode.x);
+ xdist = x_org + menu_scroll_dist - (Mode.events.x);
}
- if (Mode.y > (VRoot.h - (menu_scroll_dist + 1)))
+ if (Mode.events.y > (VRoot.h - (menu_scroll_dist + 1)))
{
- ydist = -(menu_scroll_dist + (Mode.y - (y_org + my_height)));
+ ydist =
+ -(menu_scroll_dist + (Mode.events.y - (y_org + my_height)));
}
- else if (Mode.y < (menu_scroll_dist + y_org))
+ else if (Mode.events.y < (menu_scroll_dist + y_org))
{
- ydist = y_org + menu_scroll_dist - (Mode.y);
+ ydist = y_org + menu_scroll_dist - (Mode.events.y);
}
/* That's a hack to avoid unwanted events:
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/moveresize.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- moveresize.c 1 Aug 2005 18:05:20 -0000 1.48
+++ moveresize.c 15 Aug 2005 16:57:13 -0000 1.49
@@ -26,10 +26,14 @@
#include "ewins.h"
#include "xwin.h"
-static EWin *mode_moveresize_ewin = NULL;
-static int move_swapcoord_x = 0;
-static int move_swapcoord_y = 0;
-static int move_mode_real = 0;
+static struct
+{
+ EWin *ewin;
+ int start_x, start_y;
+ int win_x, win_y, win_w, win_h;
+ int swapcoord_x, swapcoord_y;
+ int resize_detail;
+} Mode_mr;
void
EwinShapeSet(EWin * ewin)
@@ -59,13 +63,7 @@
if (!ewin || ewin->state.inhibit_move)
return 0;
- mode_moveresize_ewin = ewin;
- move_mode_real = Conf.movres.mode_move;
-#if 0 /* Why do this? Let's see what happens if we
don't :) */
- if (((ewin->groups) || (ewin->has_transients))
- && (Conf.movres.mode_move > 0))
- Conf.movres.mode_move = 0;
-#endif
+ Mode_mr.ewin = ewin;
SoundPlay("SOUND_MOVE_START");
@@ -80,12 +78,12 @@
dx = DeskGetX(EoGetDesk(ewin));
dy = DeskGetY(EoGetDesk(ewin));
- Mode.start_x = Mode.x + dx;
- Mode.start_y = Mode.y + dy;
- Mode.win_x = EoGetX(ewin) + dx;
- Mode.win_y = EoGetY(ewin) + dy;
- Mode.win_w = ewin->client.w;
- Mode.win_h = ewin->client.h;
+ Mode_mr.start_x = Mode.events.x + dx;
+ Mode_mr.start_y = Mode.events.y + dy;
+ Mode_mr.win_x = EoGetX(ewin) + dx;
+ Mode_mr.win_y = EoGetY(ewin) + dy;
+ Mode_mr.win_w = ewin->client.w;
+ Mode_mr.win_h = ewin->client.h;
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, nogroup
|| Mode.move.swap, &num);
@@ -95,8 +93,8 @@
EwinFloatAt(gwins[i], EoGetX(gwins[i]), EoGetY(gwins[i]));
}
Efree(gwins);
- move_swapcoord_x = EoGetX(ewin);
- move_swapcoord_y = EoGetY(ewin);
+ Mode_mr.swapcoord_x = EoGetX(ewin);
+ Mode_mr.swapcoord_y = EoGetY(ewin);
return 0;
}
@@ -108,14 +106,14 @@
int num, i, desk;
Desk *d1, *d2;
- if (ewin && ewin != mode_moveresize_ewin)
+ if (ewin && ewin != Mode_mr.ewin)
return 0;
GrabPointerRelease();
SoundPlay("SOUND_MOVE_STOP");
- ewin = mode_moveresize_ewin;
+ ewin = Mode_mr.ewin;
if (!ewin)
goto done;
@@ -131,7 +129,7 @@
}
Mode.mode = MODE_NONE;
- desk = DesktopAt(Mode.x, Mode.y);
+ desk = DesktopAt(Mode.events.x, Mode.events.y);
d2 = DeskGet(desk);
if (Conf.movres.mode_move == 0)
@@ -157,10 +155,8 @@
done:
Mode.mode = MODE_NONE;
- Conf.movres.mode_move = move_mode_real;
Mode.nogroup = 0;
Mode.move.swap = 0;
- Mode.have_place_grab = 0;
Mode.place.doing_manual = 0;
if (Conf.movres.mode_move > 0)
@@ -178,7 +174,7 @@
EWin *ewin, **lst;
int i, num;
- ewin = mode_moveresize_ewin;
+ ewin = Mode_mr.ewin;
if (!ewin)
return 0;
@@ -213,7 +209,7 @@
int i, num;
int x, y, ax, ay, fl;
- ewin = mode_moveresize_ewin;
+ ewin = Mode_mr.ewin;
if (!ewin)
return 0;
@@ -243,8 +239,8 @@
y = ewin->shape_y;
if (Mode.flipp)
{
- x += Mode.x - Mode.px;
- y += Mode.y - Mode.py;
+ x += Mode.events.x - Mode.events.px;
+ y += Mode.events.y - Mode.events.py;
}
DrawEwinShape(ewin, Conf.movres.mode_move, x, y,
ewin->client.w, ewin->client.h, fl);
@@ -263,7 +259,7 @@
if (!ewin || ewin->state.inhibit_resize)
return 0;
- mode_moveresize_ewin = ewin;
+ Mode_mr.ewin = ewin;
SoundPlay("SOUND_RESIZE_START");
@@ -287,21 +283,21 @@
{
case MODE_RESIZE:
Mode.mode = hv;
- x = Mode.x - EoGetX(ewin);
- y = Mode.y - EoGetY(ewin);
+ x = Mode.events.x - EoGetX(ewin);
+ y = Mode.events.y - EoGetY(ewin);
w = EoGetW(ewin) >> 1;
h = EoGetH(ewin) >> 1;
ww = EoGetW(ewin) / 6;
hh = EoGetH(ewin) / 6;
if ((x < w) && (y < h))
- Mode.resize_detail = 0;
+ Mode_mr.resize_detail = 0;
if ((x >= w) && (y < h))
- Mode.resize_detail = 1;
+ Mode_mr.resize_detail = 1;
if ((x < w) && (y >= h))
- Mode.resize_detail = 2;
+ Mode_mr.resize_detail = 2;
if ((x >= w) && (y >= h))
- Mode.resize_detail = 3;
+ Mode_mr.resize_detail = 3;
/* The following four if statements added on 07/22/04 by Josh Holtrop.
* They allow strictly horizontal or vertical resizing when the
@@ -309,52 +305,52 @@
if ((abs(x - w) < (w >> 1)) && (y < hh))
{
Mode.mode = MODE_RESIZE_V;
- Mode.resize_detail = 0;
+ Mode_mr.resize_detail = 0;
}
else if ((abs(x - w) < (w >> 1)) && (y > (EoGetH(ewin) - hh)))
{
Mode.mode = MODE_RESIZE_V;
- Mode.resize_detail = 1;
+ Mode_mr.resize_detail = 1;
}
else if ((abs(y - h) < (h >> 1)) && (x < ww))
{
Mode.mode = MODE_RESIZE_H;
- Mode.resize_detail = 0;
+ Mode_mr.resize_detail = 0;
}
else if ((abs(y - h) < (h >> 1)) && (x > (EoGetW(ewin) - ww)))
{
Mode.mode = MODE_RESIZE_H;
- Mode.resize_detail = 1;
+ Mode_mr.resize_detail = 1;
}
break;
case MODE_RESIZE_H:
Mode.mode = hv;
- x = Mode.x - EoGetX(ewin);
+ x = Mode.events.x - EoGetX(ewin);
w = EoGetW(ewin) >> 1;
if (x < w)
- Mode.resize_detail = 0;
+ Mode_mr.resize_detail = 0;
else
- Mode.resize_detail = 1;
+ Mode_mr.resize_detail = 1;
break;
case MODE_RESIZE_V:
Mode.mode = hv;
- y = Mode.y - EoGetY(ewin);
+ y = Mode.events.y - EoGetY(ewin);
h = EoGetH(ewin) >> 1;
if (y < h)
- Mode.resize_detail = 0;
+ Mode_mr.resize_detail = 0;
else
- Mode.resize_detail = 1;
+ Mode_mr.resize_detail = 1;
break;
}
- Mode.start_x = Mode.x;
- Mode.start_y = Mode.y;
- Mode.win_x = EoGetX(ewin);
- Mode.win_y = EoGetY(ewin);
- Mode.win_w = ewin->client.w;
- Mode.win_h = ewin->client.h;
+ Mode_mr.start_x = Mode.events.x;
+ Mode_mr.start_y = Mode.events.y;
+ Mode_mr.win_x = EoGetX(ewin);
+ Mode_mr.win_y = EoGetY(ewin);
+ Mode_mr.win_w = ewin->client.w;
+ Mode_mr.win_h = ewin->client.h;
EwinShapeSet(ewin);
DrawEwinShape(ewin, Conf.movres.mode_resize, EoGetX(ewin), EoGetY(ewin),
ewin->client.w, ewin->client.h, 0);
@@ -365,7 +361,7 @@
int
ActionResizeEnd(EWin * ewin)
{
- if (ewin && ewin != mode_moveresize_ewin)
+ if (ewin && ewin != Mode_mr.ewin)
return 0;
Mode.mode = MODE_NONE;
@@ -374,7 +370,7 @@
SoundPlay("SOUND_RESIZE_STOP");
- ewin = mode_moveresize_ewin;
+ ewin = Mode_mr.ewin;
if (!ewin)
goto done;
@@ -409,11 +405,11 @@
char jumpx, jumpy;
int min_dx, max_dx, min_dy, max_dy;
- ewin = mode_moveresize_ewin;
+ ewin = Mode_mr.ewin;
if (!ewin)
return;
- EdgeCheckMotion(Mode.x, Mode.y);
+ EdgeCheckMotion(Mode.events.x, Mode.events.y);
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE,
Mode.nogroup || Mode.move.swap, &num);
@@ -439,8 +435,8 @@
}
}
- dx = Mode.x - Mode.px;
- dy = Mode.y - Mode.py;
+ dx = Mode.events.x - Mode.events.px;
+ dy = Mode.events.y - Mode.events.py;
jumpx = 0;
jumpy = 0;
@@ -586,26 +582,26 @@
/* check for sufficient overlap and avoid flickering */
if (((ewin1->shape_x >= ewin2->shape_x &&
ewin1->shape_x <= ewin2->shape_x +
- EoGetW(ewin2) / 2 && Mode.x <= Mode.px) ||
+ EoGetW(ewin2) / 2 && Mode.events.x <= Mode.events.px) ||
(ewin1->shape_x <= ewin2->shape_x &&
ewin1->shape_x + EoGetW(ewin1) / 2 >=
ewin2->shape_x &&
- Mode.x >= Mode.px)) &&
+ Mode.events.x >= Mode.events.px)) &&
((ewin1->shape_y >= ewin2->shape_y
&& ewin1->shape_y <=
ewin2->shape_y + EoGetH(ewin2) / 2
- && Mode.y <= Mode.py)
+ && Mode.events.y <= Mode.events.py)
|| (EoGetY(ewin1) <= EoGetY(ewin2)
&& ewin1->shape_y + EoGetH(ewin1) / 2 >=
- ewin2->shape_y && Mode.y >= Mode.py)))
+ ewin2->shape_y && Mode.events.y >= Mode.events.py)))
{
int tmp_swapcoord_x;
int tmp_swapcoord_y;
- tmp_swapcoord_x = move_swapcoord_x;
- tmp_swapcoord_y = move_swapcoord_y;
- move_swapcoord_x = ewin2->shape_x;
- move_swapcoord_y = ewin2->shape_y;
+ tmp_swapcoord_x = Mode_mr.swapcoord_x;
+ tmp_swapcoord_y = Mode_mr.swapcoord_y;
+ Mode_mr.swapcoord_x = ewin2->shape_x;
+ Mode_mr.swapcoord_y = ewin2->shape_y;
EwinMove(ewin2, tmp_swapcoord_x, tmp_swapcoord_y);
break;
}
@@ -624,22 +620,22 @@
int x, y, w, h;
EWin *ewin;
- ewin = mode_moveresize_ewin;
+ ewin = Mode_mr.ewin;
if (!ewin)
return;
switch (Mode.mode)
{
case MODE_RESIZE:
- switch (Mode.resize_detail)
+ switch (Mode_mr.resize_detail)
{
case 0:
pw = ewin->client.w;
ph = ewin->client.h;
- w = Mode.win_w - (Mode.x - Mode.start_x);
- h = Mode.win_h - (Mode.y - Mode.start_y);
- x = Mode.win_x + (Mode.x - Mode.start_x);
- y = Mode.win_y + (Mode.y - Mode.start_y);
+ w = Mode_mr.win_w - (Mode.events.x - Mode_mr.start_x);
+ h = Mode_mr.win_h - (Mode.events.y - Mode_mr.start_y);
+ x = Mode_mr.win_x + (Mode.events.x - Mode_mr.start_x);
+ y = Mode_mr.win_y + (Mode.events.y - Mode_mr.start_y);
ewin->client.w = w;
ewin->client.h = h;
ICCCM_MatchSize(ewin);
@@ -648,36 +644,36 @@
if (pw == ewin->client.w)
x = ewin->shape_x;
else
- x = Mode.win_x + Mode.win_w - w;
+ x = Mode_mr.win_x + Mode_mr.win_w - w;
if (ph == ewin->client.h)
y = ewin->shape_y;
else
- y = Mode.win_y + Mode.win_h - h;
+ y = Mode_mr.win_y + Mode_mr.win_h - h;
ewin->client.w = pw;
ewin->client.h = ph;
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
break;
case 1:
ph = ewin->client.h;
- w = Mode.win_w + (Mode.x - Mode.start_x);
- h = Mode.win_h - (Mode.y - Mode.start_y);
+ w = Mode_mr.win_w + (Mode.events.x - Mode_mr.start_x);
+ h = Mode_mr.win_h - (Mode.events.y - Mode_mr.start_y);
x = ewin->shape_x;
- y = Mode.win_y + (Mode.y - Mode.start_y);
+ y = Mode_mr.win_y + (Mode.events.y - Mode_mr.start_y);
ewin->client.h = h;
ICCCM_MatchSize(ewin);
h = ewin->client.h;
if (ph == ewin->client.h)
y = ewin->shape_y;
else
- y = Mode.win_y + Mode.win_h - h;
+ y = Mode_mr.win_y + Mode_mr.win_h - h;
ewin->client.h = ph;
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
break;
case 2:
pw = ewin->client.w;
- w = Mode.win_w - (Mode.x - Mode.start_x);
- h = Mode.win_h + (Mode.y - Mode.start_y);
- x = Mode.win_x + (Mode.x - Mode.start_x);
+ w = Mode_mr.win_w - (Mode.events.x - Mode_mr.start_x);
+ h = Mode_mr.win_h + (Mode.events.y - Mode_mr.start_y);
+ x = Mode_mr.win_x + (Mode.events.x - Mode_mr.start_x);
y = ewin->shape_y;
ewin->client.w = w;
ICCCM_MatchSize(ewin);
@@ -685,13 +681,13 @@
if (pw == ewin->client.w)
x = ewin->shape_x;
else
- x = Mode.win_x + Mode.win_w - w;
+ x = Mode_mr.win_x + Mode_mr.win_w - w;
ewin->client.w = pw;
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
break;
case 3:
- w = Mode.win_w + (Mode.x - Mode.start_x);
- h = Mode.win_h + (Mode.y - Mode.start_y);
+ w = Mode_mr.win_w + (Mode.events.x - Mode_mr.start_x);
+ h = Mode_mr.win_h + (Mode.events.y - Mode_mr.start_y);
x = ewin->shape_x;
y = ewin->shape_y;
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
@@ -702,13 +698,13 @@
break;
case MODE_RESIZE_H:
- switch (Mode.resize_detail)
+ switch (Mode_mr.resize_detail)
{
case 0:
pw = ewin->client.w;
- w = Mode.win_w - (Mode.x - Mode.start_x);
+ w = Mode_mr.win_w - (Mode.events.x - Mode_mr.start_x);
h = ewin->client.h;
- x = Mode.win_x + (Mode.x - Mode.start_x);
+ x = Mode_mr.win_x + (Mode.events.x - Mode_mr.start_x);
y = ewin->shape_y;
ewin->client.w = w;
ICCCM_MatchSize(ewin);
@@ -716,12 +712,12 @@
if (pw == ewin->client.w)
x = ewin->shape_x;
else
- x = Mode.win_x + Mode.win_w - w;
+ x = Mode_mr.win_x + Mode_mr.win_w - w;
ewin->client.w = pw;
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
break;
case 1:
- w = Mode.win_w + (Mode.x - Mode.start_x);
+ w = Mode_mr.win_w + (Mode.events.x - Mode_mr.start_x);
h = ewin->client.h;
x = ewin->shape_x;
y = ewin->shape_y;
@@ -733,27 +729,27 @@
break;
case MODE_RESIZE_V:
- switch (Mode.resize_detail)
+ switch (Mode_mr.resize_detail)
{
case 0:
ph = ewin->client.h;
w = ewin->client.w;
- h = Mode.win_h - (Mode.y - Mode.start_y);
+ h = Mode_mr.win_h - (Mode.events.y - Mode_mr.start_y);
x = ewin->shape_x;
- y = Mode.win_y + (Mode.y - Mode.start_y);
+ y = Mode_mr.win_y + (Mode.events.y - Mode_mr.start_y);
ewin->client.h = h;
ICCCM_MatchSize(ewin);
h = ewin->client.h;
if (ph == ewin->client.h)
y = ewin->shape_y;
else
- y = Mode.win_y + Mode.win_h - h;
+ y = Mode_mr.win_y + Mode_mr.win_h - h;
ewin->client.h = ph;
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
break;
case 1:
w = ewin->client.w;
- h = Mode.win_h + (Mode.y - Mode.start_y);
+ h = Mode_mr.win_h + (Mode.events.y - Mode_mr.start_y);
x = ewin->shape_x;
y = ewin->shape_y;
DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/pager.c,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -3 -r1.173 -r1.174
--- pager.c 13 Aug 2005 23:06:10 -0000 1.173
+++ pager.c 15 Aug 2005 16:57:13 -0000 1.174
@@ -994,7 +994,8 @@
if (tt)
{
if (ewin)
- TooltipShow(tt, EwinGetIconName(ewin), NULL, Mode.x, Mode.y);
+ TooltipShow(tt, EwinGetIconName(ewin), NULL, Mode.events.x,
+ Mode.events.y);
else
TooltipHide(tt);
}
@@ -1292,8 +1293,8 @@
Hiwin *phi = hiwin;
/* Delta in pager coords */
- dx = Mode.x - Mode.px;
- dy = Mode.y - Mode.py;
+ dx = Mode.events.x - Mode.events.px;
+ dy = Mode.events.y - Mode.events.py;
if (dx == 0 && dy == 0)
return;
@@ -1404,8 +1405,8 @@
in_pager = (px >= 0 && py >= 0 && px < p->w && py < p->h);
- in_vroot = (Mode.x >= 0 && Mode.x < VRoot.w &&
- Mode.y >= 0 && Mode.y < VRoot.h);
+ in_vroot = (Mode.events.x >= 0 && Mode.events.x < VRoot.w &&
+ Mode.events.y >= 0 && Mode.events.y < VRoot.h);
if (button == Conf_pagers.win_button)
{
@@ -1447,8 +1448,8 @@
{
/* Pointer is not in pager or iconbox */
/* Move window(s) to pointer location */
- x = Mode.x - EoGetW(ewin) / 2;
- y = Mode.y - EoGetH(ewin) / 2;
+ x = Mode.events.x - EoGetW(ewin) / 2;
+ y = Mode.events.y - EoGetH(ewin) / 2;
EwinGroupMove(ewin, DesksGetCurrent(), x, y);
}
}
@@ -1477,7 +1478,7 @@
(int)ev->xbutton.button);
break;
case ButtonRelease:
- if (ev->xbutton.window != Mode.last_bpress)
+ if (ev->xbutton.window != Mode.events.last_bpress)
break;
PagerHandleMouseUp(p, ev->xbutton.x, ev->xbutton.y,
(int)ev->xbutton.button);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/warp.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -3 -r1.76 -r1.77
--- warp.c 7 Aug 2005 20:33:21 -0000 1.76
+++ warp.c 15 Aug 2005 16:57:13 -0000 1.77
@@ -241,7 +241,7 @@
/* Remember invoking keycode (ugly hack) */
if (!warpFocusWindow || !warpFocusWindow->shown)
- warpFocusKey = Mode.last_keycode;
+ warpFocusKey = Mode.events.last_keycode;
if (!warplist)
{
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/x.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -3 -r1.105 -r1.106
--- x.c 7 Aug 2005 22:59:27 -0000 1.105
+++ x.c 15 Aug 2005 16:57:13 -0000 1.106
@@ -1365,28 +1365,28 @@
void
EGrabServer(void)
{
- if (Mode.server_grabbed <= 0)
+ if (Mode.grabs.server_grabbed <= 0)
XGrabServer(disp);
- Mode.server_grabbed++;
+ Mode.grabs.server_grabbed++;
}
void
EUngrabServer(void)
{
- if (Mode.server_grabbed == 1)
+ if (Mode.grabs.server_grabbed == 1)
{
XUngrabServer(disp);
XFlush(disp);
}
- Mode.server_grabbed--;
- if (Mode.server_grabbed < 0)
- Mode.server_grabbed = 0;
+ Mode.grabs.server_grabbed--;
+ if (Mode.grabs.server_grabbed < 0)
+ Mode.grabs.server_grabbed = 0;
}
int
EServerIsGrabbed(void)
{
- return Mode.server_grabbed;
+ return Mode.grabs.server_grabbed;
}
void
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs