Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
      Tag: branch-exp
        E.h events.c evhandlers.c mod-tt.c 


Log Message:
Move tooltip event handling.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.314.2.12
retrieving revision 1.314.2.13
diff -u -3 -r1.314.2.12 -r1.314.2.13
--- E.h 15 Aug 2004 07:28:26 -0000      1.314.2.12
+++ E.h 15 Aug 2004 07:55:45 -0000      1.314.2.13
@@ -2444,6 +2444,7 @@
                                ActionClass * ac, int x, int y);
 void                TooltipHide(ToolTip * tt);
 
+void                TooltipsHandleEvent(void);
 void                TooltipsHide(void);
 int                 TooltipsConfigLoad(FILE * ConfigFile);
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/events.c,v
retrieving revision 1.69.2.2
retrieving revision 1.69.2.3
diff -u -3 -r1.69.2.2 -r1.69.2.3
--- events.c    8 Aug 2004 00:02:18 -0000       1.69.2.2
+++ events.c    15 Aug 2004 07:55:46 -0000      1.69.2.3
@@ -104,6 +104,8 @@
      case ButtonRelease:
      case EnterNotify:
      case LeaveNotify:
+       TooltipsHandleEvent();  /* TBD */
+
        if (((ev->type == KeyPress) || (ev->type == KeyRelease))
            && (ev->xkey.root != VRoot.win))
          {
@@ -145,6 +147,7 @@
        HandleMouseUp(ev);
        break;
      case MotionNotify:        /*  6 */
+       TooltipsHandleEvent();  /* TBD */
        HandleMotion(ev);
        break;
      case EnterNotify:         /*  7 */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/evhandlers.c,v
retrieving revision 1.173.2.7
retrieving revision 1.173.2.8
diff -u -3 -r1.173.2.7 -r1.173.2.8
--- evhandlers.c        15 Aug 2004 07:28:27 -0000      1.173.2.7
+++ evhandlers.c        15 Aug 2004 07:55:46 -0000      1.173.2.8
@@ -24,78 +24,6 @@
 
 static char         sentpress = 0;
 
-static ToolTip     *ttip = NULL;
-
-static void
-ToolTipTimeout(int val, void *data)
-{
-   int                 x, y, dum;
-   unsigned int        mask;
-   Window              win, rt, ch;
-   ActionClass        *ac;
-
-   EDBUG(5, "ToolTipTimeout");
-
-   /* In the case of multiple screens, check to make sure
-    * the root window is still where the mouse is... */
-   if (False ==
-       XQueryPointer(disp, VRoot.win, &rt, &ch, &dum, &dum, &x, &y, &mask))
-      EDBUG_RETURN_;
-
-   /* In case this is a virtual root */
-   if (x < 0 || y < 0 || x >= VRoot.w || y >= VRoot.h)
-      EDBUG_RETURN_;
-
-   /* dont pop up tooltip is mouse button down */
-   if (mask &
-       (Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask))
-      EDBUG_RETURN_;
-
-   win = WindowAtXY(x, y);
-   ac = FindActionClass(win);
-   if (!ac)
-      EDBUG_RETURN_;
-
-   if (!ttip)
-      ttip = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_TOOLTIP);
-
-   if (ac->tooltipstring)
-     {
-       if (Conf.tooltips.showroottooltip)
-         {
-            TooltipShow(ttip, ac->tooltipstring, ac, x, y);
-         }
-       else
-         {
-            int                 i;
-            int                 show = 1;
-
-            for (i = 0; i < Conf.desks.num; i++)
-              {
-                 if (win == desks.desk[i].win)
-                    show = 0;
-              }
-            if (show)
-               TooltipShow(ttip, ac->tooltipstring, ac, x, y);
-         }
-     }
-   data = NULL;
-   val = 0;
-
-   EDBUG_RETURN_;
-}
-
-static void
-TooltipsHandleEvent(void)
-{
-   if (ttip)
-      TooltipHide(ttip);
-   RemoveTimerEvent("TOOLTIP_TIMEOUT");
-   if (Conf.tooltips.enable)
-      DoIn("TOOLTIP_TIMEOUT", 0.001 * Conf.tooltips.delay, ToolTipTimeout, 0,
-          NULL);
-}
-
 static void
 ModeGetXY(Window rwin, int rx, int ry)
 {
@@ -169,8 +97,6 @@
          }
      }
 
-   TooltipsHandleEvent();
-
    if ((((float)(ev->xbutton.time - Mode.last_time) / 1000) <
        mode_double_click_time) &&
        ((int)(ev->xbutton.button) == (int)(Mode.last_button)))
@@ -253,7 +179,6 @@
           EDBUG_RETURN_;
      }
 
-   TooltipsHandleEvent();
    GrabPointerRelease();
 
    ModeGetXY(ev->xbutton.root, ev->xbutton.x_root, ev->xbutton.y_root);
@@ -327,8 +252,6 @@
 {
    EDBUG(5, "HandleMotion");
 
-   TooltipsHandleEvent();
-
    Mode.px = Mode.x;
    Mode.py = Mode.y;
    ModeGetXY(ev->xmotion.root, ev->xmotion.x_root, ev->xmotion.y_root);
@@ -522,8 +445,6 @@
 
    Mode.context_win = win;
 
-   TooltipsHandleEvent();
-
    if ( /*!Mode.menus.clicked && */ BordersEventMouseIn(ev))
       goto done;
 
@@ -543,8 +464,6 @@
    if (Mode.mode != MODE_NONE)
       EDBUG_RETURN_;
 
-   TooltipsHandleEvent();
-
    Mode.context_win = win;
 
    if ( /*!Mode.menus.clicked && */ BordersEventMouseOut(ev))
@@ -671,11 +590,10 @@
 }
 
 void
-HandleReparent(XEvent * ev)
+HandleReparent(XEvent * ev __UNUSED__)
 {
    EDBUG(5, "HandleReparent");
    EDBUG_RETURN_;
-   ev = NULL;
 }
 
 void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/mod-tt.c,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -3 -r1.1.2.4 -r1.1.2.5
--- mod-tt.c    8 Aug 2004 00:02:19 -0000       1.1.2.4
+++ mod-tt.c    15 Aug 2004 07:55:46 -0000      1.1.2.5
@@ -23,6 +23,80 @@
  */
 #include "E.h"
 
+static ToolTip     *ttip = NULL;
+
+static void
+ToolTipTimeout(int val __UNUSED__, void *data __UNUSED__)
+{
+   int                 x, y, dum;
+   unsigned int        mask;
+   Window              win, rt, ch;
+   ActionClass        *ac;
+
+   EDBUG(5, "ToolTipTimeout");
+
+   /* In the case of multiple screens, check to make sure
+    * the root window is still where the mouse is... */
+   if (False ==
+       XQueryPointer(disp, VRoot.win, &rt, &ch, &dum, &dum, &x, &y, &mask))
+      EDBUG_RETURN_;
+
+   /* In case this is a virtual root */
+   if (x < 0 || y < 0 || x >= VRoot.w || y >= VRoot.h)
+      EDBUG_RETURN_;
+
+   /* dont pop up tooltip is mouse button down */
+   if (mask &
+       (Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask))
+      EDBUG_RETURN_;
+
+   win = WindowAtXY(x, y);
+   ac = FindActionClass(win);
+   if (!ac)
+      EDBUG_RETURN_;
+
+   if (!ttip)
+      ttip = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_TOOLTIP);
+
+   if (ac->tooltipstring)
+     {
+       if (Conf.tooltips.showroottooltip)
+         {
+            TooltipShow(ttip, ac->tooltipstring, ac, x, y);
+         }
+       else
+         {
+            int                 i;
+            int                 show = 1;
+
+            for (i = 0; i < Conf.desks.num; i++)
+              {
+                 if (win == desks.desk[i].win)
+                    show = 0;
+              }
+            if (show)
+               TooltipShow(ttip, ac->tooltipstring, ac, x, y);
+         }
+     }
+
+   EDBUG_RETURN_;
+}
+
+/*
+ * We want this on
+ * ButtonPress, ButtonRelease, MotionNotify, EnterNotify, LeaveNotify
+ */
+void
+TooltipsHandleEvent(void)
+{
+   if (ttip)
+      TooltipHide(ttip);
+   RemoveTimerEvent("TOOLTIP_TIMEOUT");
+   if (Conf.tooltips.enable)
+      DoIn("TOOLTIP_TIMEOUT", 0.001 * Conf.tooltips.delay, ToolTipTimeout, 0,
+          NULL);
+}
+
 /*
  * Tooltips Module
  */
@@ -47,7 +121,7 @@
 static char         tmp_roottip;
 
 static void
-CB_ConfigureTooltips(int val, void *data)
+CB_ConfigureTooltips(int val, void *data __UNUSED__)
 {
    if (val < 2)
      {
@@ -56,7 +130,6 @@
        Conf.tooltips.showroottooltip = tmp_roottip;
      }
    autosave();
-   data = NULL;
 }
 
 static void




-------------------------------------------------------
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

Reply via email to