Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h draw.c mod-misc.c moveresize.c 


Log Message:
Use shaped window in stead of server grab/line draws for boxed move/resize mode.

===================================================================
RCS file: /cvs/e/e16/e/src/E.h,v
retrieving revision 1.584
retrieving revision 1.585
diff -u -3 -r1.584 -r1.585
--- E.h 18 May 2007 08:25:01 -0000      1.584
+++ E.h 15 Jun 2007 19:42:41 -0000      1.585
@@ -320,6 +320,7 @@
       int                 mode_move;
       int                 mode_resize;
       int                 mode_info;
+      char                old_mode;
       char                update_while_moving;
       char                enable_sync_request;
    } movres;
===================================================================
RCS file: /cvs/e/e16/e/src/draw.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -3 -r1.99 -r1.100
--- draw.c      11 Jun 2007 22:28:35 -0000      1.99
+++ draw.c      15 Jun 2007 19:42:41 -0000      1.100
@@ -22,6 +22,7 @@
  */
 #include "E.h"
 #include "desktops.h"
+#include "eobj.h"
 #include "ewins.h"
 #include "hints.h"
 #include "xwin.h"
@@ -655,6 +656,51 @@
       XSetStipple(disp, _gc, b2); \
       XFillRectangle(disp, _dr, _gc, _a, _b, _c + bl + br, _d + bt + bb);
 
+#define _SHAPE_SET_RECT(rl, _x, _y, _w, _h) \
+do { \
+    rl[0].x = _x;          rl[0].y = _y;          rl[0].width = _w; 
rl[0].height = 1; \
+    rl[1].x = _x;          rl[1].y = _y + _h - 1; rl[1].width = _w; 
rl[1].height = 1; \
+    rl[2].x = _x;          rl[2].y = _y + 1;      rl[2].width = 1;  
rl[2].height = _h - 2; \
+    rl[3].x = _x + _w - 1; rl[3].y = _y + 1;      rl[3].width = 1;  
rl[3].height = _h - 2; \
+} while(0)
+
+static EObj        *
+_ShapeCreateWin(void)
+{
+   EObj               *eo;
+
+   eo = EobjWindowCreate(EOBJ_TYPE_MISC, 0, 0, VRoot.w, VRoot.h, 0, "Wires");
+   if (!eo)
+      return NULL;
+   eo->shadow = 0;
+   eo->fade = 0;
+   ESetWindowBackground(EobjGetWin(eo), 0xff0000);     /* FIXME - Allocate 
color */
+#ifdef xxShapeInput            /* Should really check server too */
+   XShapeCombineRectangles(disp, EobjGetXwin(eo),
+                          ShapeInput, 0, 0, NULL, 0, ShapeSet, Unsorted);
+#endif
+   return eo;
+}
+
+static void
+_ShapeSetBox(EObj * eo, int x, int y, int w, int h,
+            int bl, int br, int bt, int bb, int seqno)
+{
+   int                 w2, h2;
+
+   w2 = w + bl + br;
+   h2 = h + bt + bb;
+
+   XRectangle          rl[8];
+
+   _SHAPE_SET_RECT((&rl[0]), x, y, w2, h2);
+   _SHAPE_SET_RECT((&rl[4]), x + bl + 1, y + bt + 1, w - 2, h - 2);
+
+   EShapeCombineRectangles(EobjGetWin(eo), ShapeBounding, 0, 0, rl,
+                          8, (seqno == 0) ? ShapeSet : ShapeUnion, Unsorted);
+   EobjShapeUpdate(eo, 0);
+}
+
 void
 DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h,
              int firstlast, int seqno)
@@ -747,6 +793,27 @@
             if (firstlast < 2)
               {
                  DO_DRAW_MODE_1(root, gc, x, y, w, h);
+              }
+         }
+       else if (md == 2 && !Conf.movres.old_mode)
+         {
+            static EObj        *shape_win = NULL;
+
+            if (!shape_win)
+              {
+                 shape_win = _ShapeCreateWin();
+                 if (!shape_win)
+                    return;
+              }
+
+            _ShapeSetBox(shape_win, x, y, w, h, bl, br, bt, bb, seqno);
+            EobjMap(shape_win, 0);
+
+            CoordsShow(ewin);
+            if (firstlast == 2)
+              {
+                 EobjDestroy(shape_win);
+                 shape_win = NULL;
               }
          }
        else if (md == 2)
===================================================================
RCS file: /cvs/e/e16/e/src/mod-misc.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -3 -r1.54 -r1.55
--- mod-misc.c  18 May 2007 08:25:05 -0000      1.54
+++ mod-misc.c  15 Jun 2007 19:42:41 -0000      1.55
@@ -142,6 +142,7 @@
    CFG_ITEM_INT(Conf, movres.mode_move, 0),
    CFG_ITEM_INT(Conf, movres.mode_resize, 2),
    CFG_ITEM_INT(Conf, movres.mode_info, 1),
+   CFG_ITEM_INT(Conf, movres.old_mode, 0),
    CFG_ITEM_BOOL(Conf, movres.update_while_moving, 0),
    CFG_ITEM_BOOL(Conf, movres.enable_sync_request, 0),
 
===================================================================
RCS file: /cvs/e/e16/e/src/moveresize.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -3 -r1.76 -r1.77
--- moveresize.c        11 Jun 2007 22:28:35 -0000      1.76
+++ moveresize.c        15 Jun 2007 19:42:41 -0000      1.77
@@ -50,6 +50,8 @@
 {
    if (mode == 0)
       return 0;
+   if (mode == 2)
+      return Conf.movres.old_mode;
    return 1;
 }
 



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