Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h actions.c desktops.c evhandlers.c finders.c icccm.c 
        pager.c snaps.c 


Log Message:
Shuffling around some pager stuff.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -3 -r1.143 -r1.144
--- E.h 8 Nov 2003 23:39:20 -0000       1.143
+++ E.h 8 Nov 2003 23:57:48 -0000       1.144
@@ -1705,6 +1705,7 @@
 
 };
 
+#ifdef DECLARE_STRUCT_PAGER
 struct _pager
 {
    char               *name;
@@ -1723,6 +1724,7 @@
    Window              hi_win;
    EWin               *hi_ewin;
 };
+#endif
 
 typedef struct _drawqueue
 {
@@ -2859,8 +2861,6 @@
 void                EnableAllPagers(void);
 void                DisableAllPagers(void);
 void                PagerHideHi(Pager * p);
-void                PagerShowHi(Pager * p, EWin * ewin, int x, int y, int w,
-                               int h);
 void                PagerSetHiQ(char onoff);
 void                PagerSetSnap(char onoff);
 void                PagerHideAllHi(void);
@@ -2868,6 +2868,8 @@
 void                EnableSinglePagerForDesktop(int desk);
 int                 PagerForDesktop(int desk);
 void                DisablePagersForDesktop(int desk);
+Window              PagerGetWin(Pager * p);
+Window              PagerGetHiWin(Pager * p);
 
 int                 CompareNetVersion(int major, int minor, int patchlevel,
                                      char *date);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/actions.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -3 -r1.112 -r1.113
--- actions.c   8 Nov 2003 23:39:20 -0000       1.112
+++ actions.c   8 Nov 2003 23:57:48 -0000       1.113
@@ -70,12 +70,14 @@
    ActionClass        *ac;
    int                 j;
    Action             *a;
+   Window              pager_hi_win;
 
    ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0, LIST_FINDBY_NAME,
                                 LIST_TYPE_ACLASS);
 
    if (ac)
      {
+       pager_hi_win = PagerGetHiWin(ewin->pager);
        ac->ref_count++;
        for (j = 0; j < ac->num; j++)
          {
@@ -85,7 +87,6 @@
                     || (a->event == EVENT_MOUSE_UP)))
               {
                  unsigned int        mod, button, mask;
-                 int                 i;
 
                  mod = 0;
                  button = 0;
@@ -100,8 +101,8 @@
                  mask = ButtonPressMask | ButtonReleaseMask;
                  if (mod == AnyModifier)
                    {
-                      if ((ewin->pager) && (ewin->pager->hi_win))
-                         XGrabButton(disp, button, mod, ewin->pager->hi_win,
+                      if (pager_hi_win)
+                         XGrabButton(disp, button, mod, pager_hi_win,
                                      False, mask, GrabModeSync, GrabModeAsync,
                                      None, None);
                       XGrabButton(disp, button, mod, ewin->win, False, mask,
@@ -109,12 +110,14 @@
                    }
                  else
                    {
+                      int                 i;
+
                       for (i = 0; i < 8; i++)
                         {
-                           if ((ewin->pager) && (ewin->pager->hi_win))
+                           if (pager_hi_win)
                               XGrabButton(disp, button,
                                           mod | mask_mod_combos[i],
-                                          ewin->pager->hi_win, False, mask,
+                                          pager_hi_win, False, mask,
                                           GrabModeSync, GrabModeAsync, None,
                                           None);
                            XGrabButton(disp, button, mod | mask_mod_combos[i],
@@ -133,12 +136,14 @@
    ActionClass        *ac;
    int                 j;
    Action             *a;
+   Window              pager_hi_win;
 
    ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0, LIST_FINDBY_NAME,
                                 LIST_TYPE_ACLASS);
 
    if (ac)
      {
+       pager_hi_win = PagerGetHiWin(ewin->pager);
        ac->ref_count--;
        for (j = 0; j < ac->num; j++)
          {
@@ -161,8 +166,8 @@
                     button = a->button;
                  if (mod == AnyModifier)
                    {
-                      if ((ewin->pager) && (ewin->pager->hi_win))
-                         XUngrabButton(disp, button, mod, ewin->pager->hi_win);
+                      if (pager_hi_win)
+                         XUngrabButton(disp, button, mod, pager_hi_win);
                       XUngrabButton(disp, button, mod, ewin->win);
                    }
                  else
@@ -171,10 +176,10 @@
 
                       for (i = 0; i < 8; i++)
                         {
-                           if ((ewin->pager) && (ewin->pager->hi_win))
+                           if (pager_hi_win)
                               XUngrabButton(disp, button,
                                             mod | mask_mod_combos[i],
-                                            ewin->pager->hi_win);
+                                            pager_hi_win);
                            XUngrabButton(disp, button,
                                          mod | mask_mod_combos[i], ewin->win);
                         }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- desktops.c  5 Nov 2003 17:24:43 -0000       1.44
+++ desktops.c  8 Nov 2003 23:57:48 -0000       1.45
@@ -145,39 +145,13 @@
      }
    if (mode.numdesktops > pnum)
      {
-       Pager              *p;
-       char                s[1024];
-
        for (i = pnum; i < mode.numdesktops; i++)
-         {
-            p = CreatePager();
-            if (p)
-              {
-                 p->desktop = i;
-                 Esnprintf(s, sizeof(s), "%i", i);
-                 PagerTitle(p, s);
-                 PagerShow(p);
-              }
-         }
+          NewPagerForDesktop(i);
      }
    else if (mode.numdesktops < pnum)
      {
-       Pager             **pl;
-       int                 j, num;
-
-       for (j = mode.numdesktops; j < pnum; j++)
-         {
-            pl = PagersForDesktop(j, &num);
-            if (pl)
-              {
-                 for (i = 0; i < num; i++)
-                   {
-                      if (pl[i]->ewin)
-                         ICCCM_Delete(pl[i]->ewin);
-                   }
-                 Efree(pl);
-              }
-         }
+       for (i = mode.numdesktops; i < pnum; i++)
+          DisablePagersForDesktop(i);
      }
    if (desks.current >= mode.numdesktops)
       GotoDesktop(mode.numdesktops - 1);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/evhandlers.c,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -3 -r1.120 -r1.121
--- evhandlers.c        8 Nov 2003 10:54:04 -0000       1.120
+++ evhandlers.c        8 Nov 2003 23:57:48 -0000       1.121
@@ -20,6 +20,7 @@
  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
+#define DECLARE_STRUCT_PAGER
 #include "E.h"
 
 static ToolTip     *ttip = NULL;
@@ -37,7 +38,6 @@
 static Window       click_was_in = 0;
 static Time         last_time = 0;
 static int          last_button = 0;
-static int          pgd_x = 0, pgd_y = 0;
 
 static void
 ToolTipTimeout(int val, void *data)
@@ -902,6 +902,7 @@
                  MoveEwin(p->hi_ewin, (x * root.w * ax) / p->w,
                           (y * root.h * ay) / p->h);
               }
+
             gwins =
                ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE,
                                           mode.nogroup, &num);
@@ -1547,7 +1548,6 @@
    EDBUG_RETURN_;
 }
 
-static int          pwin_px, pwin_py;
 static int         *gwin_px, *gwin_py;
 
 void
@@ -1561,7 +1561,7 @@
    ActionClass        *ac;
    Menu               *m;
    MenuItem           *mi;
-   int                 desk_click = -1;
+   int                 desk_click;
    char                double_click = 0;
    float               mode_double_click_time = 0.25;
 
@@ -1570,6 +1570,7 @@
    /* DON'T handle clicks whilst moving/resizing things unless doing manual placement 
*/
    if (mode.mode != MODE_NONE)
       EDBUG_RETURN_;
+
    if ((mode.cur_menu_mode) && (!clickmenu))
      {
        unsigned int        bmask = 0, evmask;
@@ -1594,6 +1595,7 @@
             EDBUG_RETURN_;
          }
      }
+
    if (ttip)
       HideToolTip(ttip);
    RemoveTimerEvent("TOOLTIP_TIMEOUT");
@@ -1613,6 +1615,8 @@
    mode.y = ev->xbutton.y_root;
 
    mode.context_win = win;
+
+   desk_click = -1;
    for (i = 0; i < mode.numdesktops; i++)
      {
        if (win == desks.desk[i].win)
@@ -1635,6 +1639,7 @@
          }
        EDBUG_RETURN_;
      }
+
    m = FindMenuItem(click_was_in, &mi);
    if ((!m) && ((mode.clickalways) || (mode.focusmode == FOCUS_CLICK)))
      {
@@ -1692,6 +1697,7 @@
          }
        EDBUG_RETURN_;
      }
+
    if (double_click)
       ev->xbutton.time = 0;
 
@@ -1725,6 +1731,7 @@
          }
        Efree(ewins);
      }
+
    if (win)
      {
        buttons = (Button **) ListItemType(&num, LIST_TYPE_BUTTON);
@@ -1760,6 +1767,7 @@
        if (buttons)
           Efree(buttons);
      }
+
    {
       Dialog             *d;
       int                 bnum;
@@ -1826,6 +1834,7 @@
             }
        }
    }
+
    ewin = FindEwinByBase(ev->xbutton.window);
    if (ewin)
      {
@@ -1846,6 +1855,7 @@
             mode.borderpartpress = 0;
          }
      }
+
    {
       Pager              *p;
 
@@ -1890,6 +1900,8 @@
                ewin = EwinInPagerAt(p, ev->xbutton.x, ev->xbutton.y);
                if ((ewin) && (!ewin->pager))
                  {
+                    static int          pgd_x = 0, pgd_y = 0;
+                    static int          pwin_px, pwin_py;
                     Window              dw;
                     int                 wx, wy, ww, wh, ax, ay, cx, cy, px, py;
 
@@ -1920,6 +1932,7 @@
             }
        }
    }
+
    EDBUG_RETURN_;
 }
 
@@ -2664,9 +2677,6 @@
    EWin              **ewins;
    int                 i, j, num;
    Button            **buttons;
-   Menu               *m;
-   MenuItem           *mi;
-   static struct _mdata mdata;
 
    EDBUG(5, "HandleMouseIn");
 
@@ -2678,16 +2688,21 @@
 
    EdgeHandleEnter(ev);
    win = ev->xcrossing.window;
-
    mode.context_win = win;
 
+   {
+      Menu               *m;
+      MenuItem           *mi;
+      static struct _mdata mdata;
+
    m = FindMenuItem(win, &mi);
    if (m)
      {
        int                 j;
 
        PagerHideAllHi();
-       if ((win == mi->icon_win) && (ev->xcrossing.detail == NotifyAncestor))
+          if ((win == mi->icon_win) &&
+              (ev->xcrossing.detail == NotifyAncestor))
           EDBUG_RETURN_;
        if ((win == mi->win) && (ev->xcrossing.detail == NotifyInferior))
           EDBUG_RETURN_;
@@ -2699,8 +2714,8 @@
          {
             if (mode.cur_menu[i] == m)
               {
-                 if ((!mi->child)
-                     || ((mi->child) && (mode.cur_menu[i + 1] != mi->child)))
+                    if ((!mi->child) ||
+                        ((mi->child) && (mode.cur_menu[i + 1] != mi->child)))
                    {
                       for (j = i + 1; j < mode.cur_menu_depth; j++)
                          HideMenu(mode.cur_menu[j]);
@@ -2723,6 +2738,8 @@
          }
        EDBUG_RETURN_;
      }
+   }
+
    ewins = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
    for (i = 0; i < num; i++)
      {
@@ -2755,6 +2772,7 @@
      }
    if (ewins)
       Efree(ewins);
+
    if (win)
      {
        buttons = (Button **) ListItemType(&num, LIST_TYPE_BUTTON);
@@ -2780,6 +2798,7 @@
        if (buttons)
           Efree(buttons);
      }
+
    {
       Dialog             *d;
       int                 bnum;
@@ -2825,9 +2844,6 @@
    Window              win;
    EWin              **ewins;
    int                 i, j, num;
-   Button            **buttons;
-   Menu               *m;
-   MenuItem           *mi;
 
    EDBUG(5, "HandleMouseOut");
 
@@ -2840,13 +2856,17 @@
    EdgeHandleLeave(ev);
 
    win = ev->xcrossing.window;
-
    mode.context_win = win;
 
+   {
+      Menu               *m;
+      MenuItem           *mi;
+
    m = FindMenuItem(win, &mi);
    if (m)
      {
-       if ((win == mi->icon_win) && (ev->xcrossing.detail == NotifyAncestor))
+          if ((win == mi->icon_win) &&
+              (ev->xcrossing.detail == NotifyAncestor))
           EDBUG_RETURN_;
        if ((win == mi->win) && (ev->xcrossing.detail == NotifyInferior))
           EDBUG_RETURN_;
@@ -2854,6 +2874,8 @@
        DrawMenuItem(m, mi, 1);
        EDBUG_RETURN_;
      }
+   }
+
    ewins = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
    ICCCM_Cmap(NULL);
    for (i = 0; i < num; i++)
@@ -2888,8 +2910,11 @@
      }
    if (ewins)
       Efree(ewins);
+
    if (win)
      {
+       Button            **buttons;
+
        buttons = (Button **) ListItemType(&num, LIST_TYPE_BUTTON);
        for (i = 0; i < num; i++)
          {
@@ -2912,6 +2937,7 @@
        if (buttons)
           Efree(buttons);
      }
+
    {
       Dialog             *d;
       int                 bnum;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/finders.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- finders.c   5 Nov 2003 17:24:43 -0000       1.16
+++ finders.c   8 Nov 2003 23:57:49 -0000       1.17
@@ -587,26 +587,3 @@
       Efree(ewins);
    EDBUG_RETURN(NULL);
 }
-
-Pager              *
-FindPager(Window win)
-{
-   Pager              *p;
-   Pager             **ps;
-   int                 i, num;
-
-   EDBUG(6, "FindDialog");
-   ps = (Pager **) ListItemType(&num, LIST_TYPE_PAGER);
-   for (i = 0; i < num; i++)
-     {
-       if ((ps[i]->win == win) || (ps[i]->hi_win == win))
-         {
-            p = ps[i];
-            Efree(ps);
-            EDBUG_RETURN(p);
-         }
-     }
-   if (ps)
-      Efree(ps);
-   EDBUG_RETURN(NULL);
-}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- icccm.c     5 Nov 2003 17:24:44 -0000       1.40
+++ icccm.c     8 Nov 2003 23:57:49 -0000       1.41
@@ -167,7 +167,7 @@
        if (ewin->pager)
          {
             HideEwin(ewin);
-            ev.xunmap.window = ewin->pager->win;
+            ev.xunmap.window = PagerGetWin(ewin->pager);
             HandleUnmap(&ev);
          }
        if (ewin->ibox)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/pager.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- pager.c     5 Nov 2003 17:24:45 -0000       1.44
+++ pager.c     8 Nov 2003 23:57:49 -0000       1.45
@@ -20,6 +20,7 @@
  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
+#define DECLARE_STRUCT_PAGER
 #include "E.h"
 
 static void         PagerUpdateTimeout(int val, void *data);
@@ -232,12 +233,14 @@
       return;
    if (dh > root.h * 2)
       return;
+
    if (!gc)
      {
        gcv.subwindow_mode = IncludeInferiors;
        gc = XCreateGC(disp, src, GCSubwindowMode, &gcv);
        gc2 = XCreateGC(disp, src, 0, &gcv);
      }
+
    if (HIQ)
       p_grab = ECreatePixImg(src, sw, dh * 2);
    else
@@ -516,6 +519,7 @@
 
    if (!mode.show_pagers)
       return NULL;
+
    if ((!did_dialog) && (SNAP))
      {
        if (pImlibData->x.shm)
@@ -616,6 +620,7 @@
       return;
    if ((w == p->w) && (h == p->h))
       return;
+
    GetAreaSize(&ax, &ay);
    EFreePixmap(disp, p->pmap);
    EFreePixmap(disp, p->bgpmap);
@@ -667,11 +672,13 @@
 
    if (!mode.show_pagers)
       return;
+
    if (p->ewin)
      {
        ShowEwin(p->ewin);
        return;
      }
+
    Esnprintf(s, sizeof(s), "%i", p->desktop);
    xch = XAllocClassHint();
    xch->res_name = s;
@@ -774,6 +781,7 @@
 
    if (!mode.show_pagers)
       return NULL;
+
    *num = 0;
    pl = (Pager **) ListItemType(&pnum, LIST_TYPE_PAGER);
    if (pl)
@@ -800,6 +808,7 @@
 
    if (!mode.show_pagers)
       return;
+
    pl = PagersForDesktop(d, &num);
    if (pl)
      {
@@ -817,6 +826,7 @@
 
    if (!mode.show_pagers)
       return;
+
    pl = PagersForDesktop(d, &num);
    if (pl)
      {
@@ -833,6 +843,7 @@
 
    if (!mode.show_pagers)
       return;
+
    GetAreaSize(&ax, &ay);
    cx = desks.desk[p->desktop].current_area_x;
    cy = desks.desk[p->desktop].current_area_y;
@@ -899,6 +910,7 @@
      }
    if (!mode.show_pagers)
       return;
+
    GetAreaSize(&ax, &ay);
    cx = desks.desk[p->desktop].current_area_x;
    cy = desks.desk[p->desktop].current_area_y;
@@ -1161,6 +1173,7 @@
 
    if (!mode.show_pagers)
       return;
+
    pl = (Pager **) ListItemType(&pnum, LIST_TYPE_PAGER);
    GetAreaSize(&ax, &ay);
    if (pl)
@@ -1193,6 +1206,7 @@
 {
    if (!mode.show_pagers)
       return;
+
    if (ewin->sticky)
      {
        int                 i;
@@ -1221,6 +1235,7 @@
 
    if (!mode.show_pagers)
       return NULL;
+
    GetAreaSize(&ax, &ay);
    cx = desks.desk[p->desktop].current_area_x;
    cy = desks.desk[p->desktop].current_area_y;
@@ -1249,6 +1264,7 @@
 
    if (!mode.show_pagers)
       return;
+
    GetAreaSize(&asx, &asy);
    *ax = x / (p->w / asx);
    *ay = y / (p->h / asy);
@@ -1265,6 +1281,7 @@
 
    if (!mode.show_pagers)
       return;
+
    ewin = EwinInPagerAt(p, x, y);
    if (ewin)
      {
@@ -1344,6 +1361,7 @@
 
    if (!mode.show_pagers)
       return;
+
    xtp.encoding = XA_STRING;
    xtp.format = 8;
    xtp.value = (unsigned char *)(title);
@@ -1361,6 +1379,7 @@
 
    if (!mode.show_pagers)
       return;
+
    pl = (Pager **) ListItemType(&pnum, LIST_TYPE_PAGER);
    if (pl)
      {
@@ -1394,6 +1413,7 @@
 
    if (!mode.show_pagers)
       return;
+
    pl = (Pager **) ListItemType(&pnum, LIST_TYPE_PAGER);
    if (pl)
      {
@@ -1673,6 +1693,7 @@
 
    if (!mode.show_pagers)
       return;
+
    if (!p)
      {
        PagerHideAllHi();
@@ -1727,23 +1748,12 @@
 void
 EnableSinglePagerForDesktop(int desk)
 {
-   Pager              *p;
    Pager             **pl;
-   char                s[1024];
    int                 num;
 
    pl = PagersForDesktop(desk, &num);
    if (!pl)
-     {
-       p = CreatePager();
-       if (p)
-         {
-            p->desktop = desk;
-            Esnprintf(s, sizeof(s), "%i", desk);
-            PagerTitle(p, s);
-            PagerShow(p);
-         }
-     }
+      NewPagerForDesktop(desk);
    else
       Efree(pl);
 }
@@ -1878,4 +1888,41 @@
          }
        Efree(pl);
      }
+}
+
+Window
+PagerGetWin(Pager * p)
+{
+   return (p) ? p->win : 0;
+}
+
+Window
+PagerGetHiWin(Pager * p)
+{
+   return (p) ? p->hi_win : 0;
+}
+
+Pager              *
+FindPager(Window win)
+{
+   Pager              *p, *pr = NULL;
+   Pager             **ps;
+   int                 i, num;
+
+   EDBUG(6, "FindDialog");
+
+   ps = (Pager **) ListItemType(&num, LIST_TYPE_PAGER);
+   for (i = 0; i < num; i++)
+     {
+       p = ps[i];
+       if ((p->win == win) || (p->hi_win == win))
+         {
+            pr = p;
+            break;
+         }
+     }
+   if (ps)
+      Efree(ps);
+
+   EDBUG_RETURN(pr);
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/snaps.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- snaps.c     5 Nov 2003 17:24:46 -0000       1.49
+++ snaps.c     8 Nov 2003 23:57:49 -0000       1.50
@@ -1235,7 +1235,7 @@
    char                buf[1024];
    Snapshot           *sn = NULL;
 
-   if ((!XGetClassHint(disp, p->win, &hint)))
+   if ((!XGetClassHint(disp, PagerGetWin(p), &hint)))
       return;
    if ((hint.res_name) && (hint.res_class))
      {
@@ -1249,7 +1249,7 @@
    if (!sn)
       return;
    if (sn->use_xy)
-      EMoveWindow(disp, p->win, sn->x, sn->y);
+      EMoveWindow(disp, PagerGetWin(p), sn->x, sn->y);
    if (sn->use_wh)
       PagerResize(p, sn->w, sn->h);
 }




-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to