Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        draw.c ewin-ops.c ewins.h moveresize.c 


Log Message:
Cleanups, paving the way for other changes.

===================================================================
RCS file: /cvs/e/e16/e/src/draw.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -3 -r1.98 -r1.99
--- draw.c      9 Jun 2007 14:17:38 -0000       1.98
+++ draw.c      11 Jun 2007 22:28:35 -0000      1.99
@@ -656,7 +656,8 @@
       XFillRectangle(disp, _dr, _gc, _a, _b, _c + bl + br, _d + bt + bb);
 
 void
-DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
+DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h,
+             int firstlast, int seqno)
 {
    static GC           gc = 0;
    static Pixmap       b2 = 0, b3 = 0;
@@ -811,7 +812,7 @@
                       Conf.movres.mode_move = 0;
                       EUngrabServer();
                       DrawEwinShape(ewin, Conf.movres.mode_move, x, y, w, h,
-                                    firstlast);
+                                    firstlast, seqno);
                       return;
                    }
                  EFillPixmap(root, root_pi->pmap, x1, y1, EoGetW(ewin),
===================================================================
RCS file: /cvs/e/e16/e/src/ewin-ops.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -3 -r1.118 -r1.119
--- ewin-ops.c  27 May 2007 21:23:55 -0000      1.118
+++ ewin-ops.c  11 Jun 2007 22:28:35 -0000      1.119
@@ -147,7 +147,7 @@
           EoMove(ewin, tmpx, tmpy);
        else
           DrawEwinShape(ewin, Conf.place.slidemode, tmpx, tmpy,
-                        ewin->client.w, ewin->client.h, firstlast);
+                        ewin->client.w, ewin->client.h, firstlast, 0);
        if (firstlast == 0)
           firstlast = 1;
 
@@ -159,7 +159,7 @@
 
    if (Conf.place.slidemode)
       DrawEwinShape(ewin, Conf.place.slidemode, tx, ty,
-                   ewin->client.w, ewin->client.h, 2);
+                   ewin->client.w, ewin->client.h, 2, 0);
    EwinOpMove(ewin, OPSRC_USER, tx, ty);
 
    FocusEnable(1);
@@ -211,7 +211,7 @@
             if (ewin[i]->type == EWIN_TYPE_MENU)
                EoMove(ewin[i], tmpx, tmpy);
             else
-               DrawEwinShape(ewin[i], 0, tmpx, tmpy, tmpw, tmph, firstlast);
+               DrawEwinShape(ewin[i], 0, tmpx, tmpy, tmpw, tmph, firstlast, i);
             if (firstlast == 0)
                firstlast = 1;
          }
@@ -224,7 +224,7 @@
        if (ewin[i])
          {
             DrawEwinShape(ewin[i], 0, x[i], y[i], ewin[i]->client.w,
-                          ewin[i]->client.h, 2);
+                          ewin[i]->client.h, 2, i);
             EwinMove(ewin[i], tx[i], ty[i]);
          }
      }
===================================================================
RCS file: /cvs/e/e16/e/src/ewins.h,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -3 -r1.74 -r1.75
--- ewins.h     18 May 2007 21:18:24 -0000      1.74
+++ ewins.h     11 Jun 2007 22:28:35 -0000      1.75
@@ -334,7 +334,7 @@
 
 /* draw.c */
 void                DrawEwinShape(EWin * ewin, int md, int x, int y, int w,
-                                 int h, char firstlast);
+                                 int h, int firstlast, int seqno);
 
 /* ewins.c */
 #define EWIN_CHANGE_NAME        (1<<0)
===================================================================
RCS file: /cvs/e/e16/e/src/moveresize.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -3 -r1.75 -r1.76
--- moveresize.c        13 Jan 2007 19:14:28 -0000      1.75
+++ moveresize.c        11 Jun 2007 22:28:35 -0000      1.76
@@ -42,8 +42,17 @@
    int                 swapcoord_x, swapcoord_y;
    int                 resize_detail;
    char                nogroup;
+   char                grab_server;
 } Mode_mr;
 
+static int
+_NeedServerGrab(int mode)
+{
+   if (mode == 0)
+      return 0;
+   return 1;
+}
+
 void
 EwinShapeSet(EWin * ewin)
 {
@@ -96,6 +105,7 @@
    Mode_mr.mode = Conf.movres.mode_move;
    if (num > 1 && Conf.movres.mode_move == 5)
       Mode_mr.mode = 0;
+   Mode_mr.grab_server = _NeedServerGrab(Mode_mr.mode);
 
    for (i = 0; i < num; i++)
      {
@@ -143,7 +153,7 @@
        for (i = 0; i < num; i++)
           DrawEwinShape(gwins[i], Mode_mr.mode,
                         gwins[i]->shape_x, gwins[i]->shape_y,
-                        gwins[i]->client.w, gwins[i]->client.h, 2);
+                        gwins[i]->client.w, gwins[i]->client.h, 2, i);
      }
    Mode.mode = MODE_NONE;
 
@@ -175,7 +185,7 @@
    Mode.move.swap = 0;
    Mode.place.doing_manual = 0;
 
-   if (Mode_mr.mode > 0)
+   if (Mode_mr.grab_server)
      {
        FocusEnable(1);
        EUngrabServer();
@@ -199,7 +209,7 @@
       return 0;
 
    /* If non opaque undraw our boxes */
-   if (Mode_mr.mode > 0)
+   if (Mode_mr.grab_server)
      {
        lst = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE,
                                         Mode_mr.nogroup, &num);
@@ -207,7 +217,7 @@
          {
             ewin = lst[i];
             DrawEwinShape(ewin, Mode_mr.mode, ewin->shape_x,
-                          ewin->shape_y, ewin->client.w, ewin->client.h, 3);
+                          ewin->shape_y, ewin->client.w, ewin->client.h, 3, i);
          }
        if (lst)
           Efree(lst);
@@ -238,7 +248,7 @@
        fl = 0;                 /* This is the first time we draw it */
      }
 
-   if (Mode_mr.mode > 0)
+   if (Mode_mr.grab_server)
       EGrabServer();
 
    dx = Mode.events.x - Mode_mr.win_x - EoGetX(EoGetDesk(ewin)) - 
ewin->shape_x;
@@ -257,7 +267,7 @@
        x = ewin->shape_x + dx;
        y = ewin->shape_y + dy;
        DrawEwinShape(ewin, Mode_mr.mode, x, y,
-                     ewin->client.w, ewin->client.h, fl);
+                     ewin->client.w, ewin->client.h, fl, i);
      }
    if (lst)
       Efree(lst);
@@ -280,14 +290,16 @@
 
    if (Conf.movres.mode_resize < 0 || Conf.movres.mode_resize > 4)
       Conf.movres.mode_resize = 0;
-   if (Conf.movres.mode_resize > 0)
+   Mode_mr.mode = Conf.movres.mode_resize;
+   Mode_mr.grab_server = _NeedServerGrab(Mode_mr.mode);
+   if (Mode_mr.grab_server)
      {
        EGrabServer();
        ModulesSignal(ESIGNAL_ANIMATION_SUSPEND, NULL);
        /* Run idlers (stacking, border updates, ...) before drawing lines */
        IdlersRun();
      }
-   else
+   if (Mode_mr.mode == 0)
      {
        ewin->state.resizing = 1;
        EwinUpdateOpacity(ewin);
@@ -391,7 +403,7 @@
    EwinShapeSet(ewin);
    ewin->state.show_coords = 1;
    DrawEwinShape(ewin, Conf.movres.mode_resize, EoGetX(ewin), EoGetY(ewin),
-                ewin->client.w, ewin->client.h, 0);
+                ewin->client.w, ewin->client.h, 0, 0);
 
    return 0;
 }
@@ -414,9 +426,9 @@
 
    ewin->state.show_coords = 0;
    DrawEwinShape(ewin, Conf.movres.mode_resize, ewin->shape_x, ewin->shape_y,
-                ewin->client.w, ewin->client.h, 2);
+                ewin->client.w, ewin->client.h, 2, 0);
 
-   if (Conf.movres.mode_resize == 0)
+   if (Mode_mr.mode == 0)
      {
        ewin->state.resizing = 0;
        EwinUpdateOpacity(ewin);
@@ -433,7 +445,7 @@
    ESync();
 
  done:
-   if (Conf.movres.mode_resize > 0)
+   if (Mode_mr.grab_server)
      {
        EUngrabServer();
        ModulesSignal(ESIGNAL_ANIMATION_RESUME, NULL);
@@ -464,7 +476,7 @@
 
    if (Mode.mode == MODE_MOVE_PENDING)
      {
-       if (Mode_mr.mode > 0)
+       if (Mode_mr.grab_server)
          {
             EGrabServer();
             FocusEnable(0);
@@ -478,7 +490,8 @@
          {
             ewin1 = gwins[i];
             DrawEwinShape(ewin1, Mode_mr.mode, EoGetX(ewin1),
-                          EoGetY(ewin1), ewin1->client.w, ewin1->client.h, 0);
+                          EoGetY(ewin1), ewin1->client.w, ewin1->client.h, 0,
+                          i);
          }
        Mode.mode = MODE_MOVE;
      }
@@ -603,7 +616,7 @@
        /* draw the new position of the window */
        DrawEwinShape(ewin1, Mode_mr.mode,
                      ewin1->shape_x + ndx, ewin1->shape_y + ndy,
-                     ewin1->client.w, ewin1->client.h, 1);
+                     ewin1->client.w, ewin1->client.h, 1, i);
 
        /* if we didnt jump the window after a resist at the edge */
        /* reset the requested x to be the prev. requested + delta */
@@ -675,9 +688,11 @@
 
    switch (Mode.mode)
      {
+     default:
      case MODE_RESIZE:
        switch (Mode_mr.resize_detail)
          {
+         default:
          case 0:
             pw = ewin->client.w;
             ph = ewin->client.h;
@@ -700,7 +715,6 @@
                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;
@@ -716,7 +730,6 @@
             else
                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;
@@ -732,16 +745,12 @@
             else
                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_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);
-            break;
-         default:
             break;
          }
        break;
@@ -749,6 +758,7 @@
      case MODE_RESIZE_H:
        switch (Mode_mr.resize_detail)
          {
+         default:
          case 0:
             pw = ewin->client.w;
             w = Mode_mr.win_w - (Mode.events.x - Mode_mr.start_x);
@@ -763,16 +773,12 @@
             else
                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_mr.win_w + (Mode.events.x - Mode_mr.start_x);
             h = ewin->client.h;
             x = ewin->shape_x;
             y = ewin->shape_y;
-            DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1);
-            break;
-         default:
             break;
          }
        break;
@@ -780,6 +786,7 @@
      case MODE_RESIZE_V:
        switch (Mode_mr.resize_detail)
          {
+         default:
          case 0:
             ph = ewin->client.h;
             w = ewin->client.w;
@@ -794,23 +801,17 @@
             else
                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_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);
-            break;
-         default:
             break;
          }
        break;
-
-     default:
-       break;
      }
+   DrawEwinShape(ewin, Conf.movres.mode_resize, x, y, w, h, 1, 0);
 }
 
 void



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to