Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
Tag: branch-exp
E.h actions.c areas.c desktops.c events.c evhandlers.c main.c
menus.c
Log Message:
Remove some obsolete event handlers, move some menu code to where it belongs.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.314.2.14
retrieving revision 1.314.2.15
diff -u -3 -r1.314.2.14 -r1.314.2.15
--- E.h 15 Aug 2004 08:15:21 -0000 1.314.2.14
+++ E.h 15 Aug 2004 10:00:18 -0000 1.314.2.15
@@ -1780,21 +1780,17 @@
void EventShow(const XEvent * ev);
/* evhandlers.c */
-void HandleKeyPress(XEvent * ev);
void HandleMouseDown(XEvent * ev);
void HandleMouseUp(XEvent * ev);
void HandleMotion(XEvent * ev);
void HandleMouseIn(XEvent * ev);
void HandleMouseOut(XEvent * ev);
-void HandleFocusIn(XEvent * ev);
-void HandleFocusOut(XEvent * ev);
void HandleExpose(XEvent * ev);
void HandleVisibilityNotify(XEvent * ev);
void HandleDestroy(XEvent * ev);
void HandleUnmap(XEvent * ev);
void HandleMap(XEvent * ev);
void HandleMapRequest(XEvent * ev);
-void HandleReparent(XEvent * ev);
void HandleConfigureNotify(XEvent * ev);
void HandleConfigureRequest(XEvent * ev);
void HandleResizeRequest(XEvent * ev);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/actions.c,v
retrieving revision 1.174.2.5
retrieving revision 1.174.2.6
diff -u -3 -r1.174.2.5 -r1.174.2.6
--- actions.c 15 Aug 2004 07:28:26 -0000 1.174.2.5
+++ actions.c 15 Aug 2004 10:00:18 -0000 1.174.2.6
@@ -591,8 +591,10 @@
}
#endif
+#if 0 /* FIXME - Why? */
if (Mode.button)
Mode.menus.clicked = 1;
+#endif
sscanf(params, "%1000s %1000s", s, s2);
if (!strcmp(s, "deskmenu"))
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/areas.c,v
retrieving revision 1.71.2.3
retrieving revision 1.71.2.4
diff -u -3 -r1.71.2.3 -r1.71.2.4
--- areas.c 15 Aug 2004 07:28:26 -0000 1.71.2.3
+++ areas.c 15 Aug 2004 10:00:20 -0000 1.71.2.4
@@ -274,7 +274,6 @@
SoundPlay("SOUND_MOVE_AREA_DOWN");
ActionsSuspend();
- MenusHide();
/* remove lots of event masks from windows.. we dont want to bother */
/* handling events as a result of our playing wiht windows */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.95.2.7
retrieving revision 1.95.2.8
diff -u -3 -r1.95.2.7 -r1.95.2.8
--- desktops.c 15 Aug 2004 07:28:27 -0000 1.95.2.7
+++ desktops.c 15 Aug 2004 10:00:20 -0000 1.95.2.8
@@ -721,7 +721,6 @@
Eprintf("GotoDesktop %d\n", desk);
SlideoutsHide();
- MenusHide();
ModulesSignal(ESIGNAL_DESK_SWITCH);
@@ -916,7 +915,6 @@
if ((desk < 0) || (desk >= Conf.desks.num))
EDBUG_RETURN_;
- MenusHide();
FocusNewDeskBegin();
desks.desk[desk].viewable = 1;
RefreshDesktop(desk);
@@ -954,7 +952,6 @@
if ((desk <= 0) || (desk >= Conf.desks.num))
EDBUG_RETURN_;
- MenusHide();
FocusNewDeskBegin();
MoveToDeskBottom(desk);
UncoverDesktop(desks.order[0]);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/events.c,v
retrieving revision 1.69.2.3
retrieving revision 1.69.2.4
diff -u -3 -r1.69.2.3 -r1.69.2.4
--- events.c 15 Aug 2004 07:55:46 -0000 1.69.2.3
+++ events.c 15 Aug 2004 10:00:20 -0000 1.69.2.4
@@ -134,7 +134,6 @@
switch (ev->type)
{
case KeyPress: /* 2 */
- HandleKeyPress(ev);
break;
case KeyRelease: /* 3 */
break;
@@ -157,10 +156,8 @@
HandleMouseOut(ev);
break;
case FocusIn: /* 9 */
- HandleFocusIn(ev);
break;
case FocusOut: /* 10 */
- HandleFocusOut(ev);
break;
case KeymapNotify: /* 11 */
break;
@@ -189,7 +186,6 @@
HandleMapRequest(ev);
break;
case ReparentNotify: /* 21 */
- HandleReparent(ev);
break;
case ConfigureNotify: /* 22 */
HandleConfigureNotify(ev);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/evhandlers.c,v
retrieving revision 1.173.2.8
retrieving revision 1.173.2.9
diff -u -3 -r1.173.2.8 -r1.173.2.9
--- evhandlers.c 15 Aug 2004 07:55:46 -0000 1.173.2.8
+++ evhandlers.c 15 Aug 2004 10:00:20 -0000 1.173.2.9
@@ -41,13 +41,6 @@
}
}
-void
-HandleKeyPress(XEvent * ev __UNUSED__)
-{
- EDBUG(5, "HandleKeyPress");
- EDBUG_RETURN_;
-}
-
static void
ButtonProxySendEvent(XEvent * ev)
{
@@ -72,31 +65,6 @@
if (Mode.mode != MODE_NONE)
EDBUG_RETURN_;
- if (MenusActive() && (!Mode.menus.clicked))
- {
- unsigned int bmask = 0, evmask;
-
- evmask =
- ev->xbutton.state & (Button1Mask | Button2Mask | Button3Mask |
- Button4Mask | Button5Mask);
- if (ev->xbutton.button == 1)
- bmask = Button1Mask;
- else if (ev->xbutton.button == 2)
- bmask = Button2Mask;
- else if (ev->xbutton.button == 3)
- bmask = Button3Mask;
- else if (ev->xbutton.button == 4)
- bmask = Button4Mask;
- else if (ev->xbutton.button == 5)
- bmask = Button5Mask;
- if (bmask != evmask)
- Mode.menus.clicked = 1;
- else
- {
- EDBUG_RETURN_;
- }
- }
-
if ((((float)(ev->xbutton.time - Mode.last_time) / 1000) <
mode_double_click_time) &&
((int)(ev->xbutton.button) == (int)(Mode.last_button)))
@@ -209,13 +177,6 @@
Mode.context_win = Mode.last_bpress;
- if ((((float)(ev->xbutton.time - Mode.last_time) / 1000) < 0.5)
- && (MenusActive()) && (!Mode.menus.clicked))
- {
- Mode.menus.clicked = 1;
- Mode.justclicked = 1;
- }
-
if ( /*!Mode.menus.clicked && */ BordersEventMouseUp(ev))
goto done;
@@ -268,165 +229,6 @@
ActionsHandleMotion();
-#define SCROLL_RATIO 2/3
- if ((MenusActive() || (Mode.menus.clicked)))
- {
- int i, offx = 0, offy = 0, xdist = 0, ydist = 0;
- EWin *ewin;
- EWin *menus[256];
- int fx[256];
- int fy[256];
- int tx[256];
- int ty[256];
- 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);
-
- if (Mode.x > ((x_org + my_width) - (menu_scroll_dist + 1)))
- {
- xdist = -(menu_scroll_dist + (Mode.x - (x_org + my_width)));
- }
- else if (Mode.x < (menu_scroll_dist + x_org))
- {
- xdist = x_org + menu_scroll_dist - (Mode.x);
- }
-
- if (Mode.y > (VRoot.h - (menu_scroll_dist + 1)))
- {
- ydist = -(menu_scroll_dist + (Mode.y - (y_org + my_height)));
- }
- else if (Mode.y < (menu_scroll_dist + y_org))
- {
- ydist = y_org + menu_scroll_dist - (Mode.y);
- }
-
- /* That's a hack to avoid unwanted events:
- * If the user entered the border area, he has to
- * leave it first, before he can scroll menus again ...
- */
- if ((xdist != 0) || (ydist != 0) || Mode.doingslide)
- {
- /* -10 has no meaning, only makes sure that the if's */
- /* above can't be fulfilled ... */
- menu_scroll_dist = -10;
- }
- else
- {
- menu_scroll_dist = 13;
- }
-
- if (Mode.menus.current_depth > 0)
- {
- int x1, y1, x2, y2;
-
- x1 = x_org + my_width;
- x2 = x_org - 1;
- y1 = y_org + my_height;
- y2 = y_org - 1;
- /* work out the minimum and maximum extents of our */
- /* currently active menus */
- for (i = 0; i < Mode.menus.current_depth; i++)
- {
- if (Mode.menus.list[i])
- {
- ewin = FindEwinByMenu(Mode.menus.list[i]);
- if (ewin)
- {
- if (ewin->x < x1)
- x1 = ewin->x;
- if (ewin->y < y1)
- y1 = ewin->y;
- if ((ewin->x + ewin->w - 1) > x2)
- x2 = ewin->x + ewin->w - 1;
- if ((ewin->y + ewin->h - 1) > y2)
- y2 = ewin->y + ewin->h - 1;
- }
- }
- }
-
- if (xdist < 0)
- {
- offx = (x_org + my_width) - x2;
- }
- else if (xdist > 0)
- {
- offx = x_org - x1;
- }
- if (ydist < 0)
- {
- offy = (y_org + my_height) - y2;
- }
- else if (ydist > 0)
- {
- offy = y_org - y1;
- }
-
- if ((xdist < 0) && (offx <= 0))
- xdist = offx;
- if ((xdist > 0) && (offx >= 0))
- xdist = offx;
- if ((ydist < 0) && (offy <= 0))
- ydist = offy;
- if ((ydist > 0) && (offy >= 0))
- ydist = offy;
-
- /* only if any active menus are partially off screen then scroll */
- if ((((xdist > 0) && (x1 < x_org))
- || ((xdist < 0) && (x2 >= (x_org + my_width))))
- || (((ydist > 0) && (y1 < y_org))
- || ((ydist < 0) && (y2 >= (y_org + my_height)))))
- {
- /* If we would scroll too far, limit scrolling to 2/3s of screen */
- if (ydist < -my_width)
- ydist = -my_width * SCROLL_RATIO;
- if (ydist > my_width)
- ydist = my_width * SCROLL_RATIO;
-
- if (xdist < -my_height)
- xdist = -my_height * SCROLL_RATIO;
- if (xdist > my_height)
- xdist = my_height * SCROLL_RATIO;
-
- if (Mode.menus.current_depth)
- {
-#ifdef HAS_XINERAMA
- ewin = FindEwinByMenu(Mode.menus.list[0]);
- if (ewin->head == head_num)
- {
-#endif
- for (i = 0; i < Mode.menus.current_depth; i++)
- {
- menus[i] = NULL;
- if (Mode.menus.list[i])
- {
- ewin = FindEwinByMenu(Mode.menus.list[i]);
- if (ewin)
- {
- menus[i] = ewin;
- fx[i] = ewin->x;
- fy[i] = ewin->y;
- tx[i] = ewin->x + xdist;
- ty[i] = ewin->y + ydist;
- }
- }
- }
- SlideEwinsTo(menus, fx, fy, tx, ty,
- Mode.menus.current_depth,
- Conf.shadespeed);
- if (((xdist != 0) || (ydist != 0))
- && (Conf.menus.warp))
- XWarpPointer(disp, None, None, 0, 0, 0, 0, xdist,
- ydist);
-#ifdef HAS_XINERAMA
- }
-#endif
- }
- }
- }
- }
-
EDBUG_RETURN_;
}
@@ -476,16 +278,6 @@
}
void
-HandleFocusIn(XEvent * ev __UNUSED__)
-{
-}
-
-void
-HandleFocusOut(XEvent * ev __UNUSED__)
-{
-}
-
-void
HandleExpose(XEvent * ev)
{
EDBUG(5, "HandleExpose");
@@ -590,13 +382,6 @@
}
void
-HandleReparent(XEvent * ev __UNUSED__)
-{
- EDBUG(5, "HandleReparent");
- EDBUG_RETURN_;
-}
-
-void
HandleConfigureNotify(XEvent * ev)
{
EDBUG(5, "HandleConfigureNotify");
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/main.c,v
retrieving revision 1.99.2.5
retrieving revision 1.99.2.6
diff -u -3 -r1.99.2.5 -r1.99.2.6
--- main.c 8 Aug 2004 00:02:19 -0000 1.99.2.5
+++ main.c 15 Aug 2004 10:00:21 -0000 1.99.2.6
@@ -248,8 +248,9 @@
desks.desk[0].viewable = 0;
/* now we're going to load the configuration/theme */
- ConfigurationLoad();
+ ConfigurationLoad(); /* Load settings */
LoadEConfig(themepath);
+ ConfigurationLoad(); /* FIXME - Override private settings set
elsewhere */
SetAreaSize(Conf.areas.nx, Conf.areas.ny);
TransparencySet(Conf.trans.alpha);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.147.2.5
retrieving revision 1.147.2.6
diff -u -3 -r1.147.2.5 -r1.147.2.6
--- menus.c 15 Aug 2004 07:28:28 -0000 1.147.2.5
+++ menus.c 15 Aug 2004 10:00:21 -0000 1.147.2.6
@@ -1385,6 +1385,32 @@
Menu *m;
EWin *ewin;
+#if 1 /* Previously in HandleMouseDown() ??? */
+ if (MenusActive() && (!Mode.menus.clicked))
+ {
+ unsigned int bmask = 0, evmask;
+
+ evmask =
+ ev->xbutton.state & (Button1Mask | Button2Mask | Button3Mask |
+ Button4Mask | Button5Mask);
+ if (ev->xbutton.button == 1)
+ bmask = Button1Mask;
+ else if (ev->xbutton.button == 2)
+ bmask = Button2Mask;
+ else if (ev->xbutton.button == 3)
+ bmask = Button3Mask;
+ else if (ev->xbutton.button == 4)
+ bmask = Button4Mask;
+ else if (ev->xbutton.button == 5)
+ bmask = Button5Mask;
+
+ if (bmask != evmask)
+ Mode.menus.clicked = 1;
+ else
+ EDBUG_RETURN_;
+ }
+#endif
+
m = mi->menu;
mi->state = STATE_CLICKED;
MenuDrawItem(m, mi, 1);
@@ -1436,6 +1462,15 @@
Menu *m;
EWin *ewin;
+#if 1 /* Previously in HandleMouseUp() ??? */
+ if ((((float)(ev->xbutton.time - Mode.last_time) / 1000) < 0.5)
+ && (MenusActive()) && (!Mode.menus.clicked))
+ {
+ Mode.menus.clicked = 1;
+ Mode.justclicked = 1;
+ }
+#endif
+
m = mi->menu;
if ((m) && (mi->state))
@@ -1487,6 +1522,171 @@
}
}
+#if 0 /* Was in HandleMotion() */
+void
+MenusHandleMotion(void)
+{
+#define SCROLL_RATIO 2/3
+ if ((MenusActive() || (Mode.menus.clicked)))
+ {
+ int i, offx = 0, offy = 0, xdist = 0, ydist = 0;
+ EWin *ewin;
+ EWin *menus[256];
+ int fx[256];
+ int fy[256];
+ int tx[256];
+ int ty[256];
+ 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);
+
+ if (Mode.x > ((x_org + my_width) - (menu_scroll_dist + 1)))
+ {
+ xdist = -(menu_scroll_dist + (Mode.x - (x_org + my_width)));
+ }
+ else if (Mode.x < (menu_scroll_dist + x_org))
+ {
+ xdist = x_org + menu_scroll_dist - (Mode.x);
+ }
+
+ if (Mode.y > (VRoot.h - (menu_scroll_dist + 1)))
+ {
+ ydist = -(menu_scroll_dist + (Mode.y - (y_org + my_height)));
+ }
+ else if (Mode.y < (menu_scroll_dist + y_org))
+ {
+ ydist = y_org + menu_scroll_dist - (Mode.y);
+ }
+
+ /* That's a hack to avoid unwanted events:
+ * If the user entered the border area, he has to
+ * leave it first, before he can scroll menus again ...
+ */
+ if ((xdist != 0) || (ydist != 0) || Mode.doingslide)
+ {
+ /* -10 has no meaning, only makes sure that the if's */
+ /* above can't be fulfilled ... */
+ menu_scroll_dist = -10;
+ }
+ else
+ {
+ menu_scroll_dist = 13;
+ }
+
+ if (Mode.menus.current_depth > 0)
+ {
+ int x1, y1, x2, y2;
+
+ x1 = x_org + my_width;
+ x2 = x_org - 1;
+ y1 = y_org + my_height;
+ y2 = y_org - 1;
+ /* work out the minimum and maximum extents of our */
+ /* currently active menus */
+ for (i = 0; i < Mode.menus.current_depth; i++)
+ {
+ if (Mode.menus.list[i])
+ {
+ ewin = FindEwinByMenu(Mode.menus.list[i]);
+ if (ewin)
+ {
+ if (ewin->x < x1)
+ x1 = ewin->x;
+ if (ewin->y < y1)
+ y1 = ewin->y;
+ if ((ewin->x + ewin->w - 1) > x2)
+ x2 = ewin->x + ewin->w - 1;
+ if ((ewin->y + ewin->h - 1) > y2)
+ y2 = ewin->y + ewin->h - 1;
+ }
+ }
+ }
+
+ if (xdist < 0)
+ {
+ offx = (x_org + my_width) - x2;
+ }
+ else if (xdist > 0)
+ {
+ offx = x_org - x1;
+ }
+ if (ydist < 0)
+ {
+ offy = (y_org + my_height) - y2;
+ }
+ else if (ydist > 0)
+ {
+ offy = y_org - y1;
+ }
+
+ if ((xdist < 0) && (offx <= 0))
+ xdist = offx;
+ if ((xdist > 0) && (offx >= 0))
+ xdist = offx;
+ if ((ydist < 0) && (offy <= 0))
+ ydist = offy;
+ if ((ydist > 0) && (offy >= 0))
+ ydist = offy;
+
+ /* only if any active menus are partially off screen then scroll */
+ if ((((xdist > 0) && (x1 < x_org))
+ || ((xdist < 0) && (x2 >= (x_org + my_width))))
+ || (((ydist > 0) && (y1 < y_org))
+ || ((ydist < 0) && (y2 >= (y_org + my_height)))))
+ {
+ /* If we would scroll too far, limit scrolling to 2/3s of screen */
+ if (ydist < -my_width)
+ ydist = -my_width * SCROLL_RATIO;
+ if (ydist > my_width)
+ ydist = my_width * SCROLL_RATIO;
+
+ if (xdist < -my_height)
+ xdist = -my_height * SCROLL_RATIO;
+ if (xdist > my_height)
+ xdist = my_height * SCROLL_RATIO;
+
+ if (Mode.menus.current_depth)
+ {
+#ifdef HAS_XINERAMA
+ ewin = FindEwinByMenu(Mode.menus.list[0]);
+ if (ewin->head == head_num)
+ {
+#endif
+ for (i = 0; i < Mode.menus.current_depth; i++)
+ {
+ menus[i] = NULL;
+ if (Mode.menus.list[i])
+ {
+ ewin = FindEwinByMenu(Mode.menus.list[i]);
+ if (ewin)
+ {
+ menus[i] = ewin;
+ fx[i] = ewin->x;
+ fy[i] = ewin->y;
+ tx[i] = ewin->x + xdist;
+ ty[i] = ewin->y + ydist;
+ }
+ }
+ }
+ SlideEwinsTo(menus, fx, fy, tx, ty,
+ Mode.menus.current_depth,
+ Conf.shadespeed);
+ if (((xdist != 0) || (ydist != 0))
+ && (Conf.menus.warp))
+ XWarpPointer(disp, None, None, 0, 0, 0, 0, xdist,
+ ydist);
+#ifdef HAS_XINERAMA
+ }
+#endif
+ }
+ }
+ }
+ }
+}
+#endif
+
struct _mdata
{
Menu *m;
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs