Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        draw.c ecompmgr.c eimage.c events.c ewin-ops.c ewins.c 
        extinitwin.c hiwin.c icccm.c iclass.c menus.c piximg.c warp.c 
        x.c xwin.h 


Log Message:
Simplify shape functions.

===================================================================
RCS file: /cvs/e/e16/e/src/draw.c,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -3 -r1.119 -r1.120
--- draw.c      29 Mar 2008 17:18:58 -0000      1.119
+++ draw.c      5 Jun 2008 08:55:20 -0000       1.120
@@ -236,8 +236,10 @@
                       0, 0, WinGetW(VROOT), WinGetH(VROOT));
        XSetForeground(disp, sw->gc, 1);
        DO_DRAW_MODE_1(sw->mask, sw->gc, x, y, w, h);
-       EShapeCombineMask(EoGetWin(sw), ShapeBounding, 0, 0, sw->mask,
-                         (seqno == 0) ? ShapeSet : ShapeUnion);
+       if (seqno == 0)
+          EShapeSetMask(EoGetWin(sw), 0, 0, sw->mask);
+       else
+          EShapeUnionMask(EoGetWin(sw), 0, 0, sw->mask);
      }
    else
      {
@@ -248,9 +250,10 @@
        h = (h > 5) ? h - 2 : 3;
        _SHAPE_SET_RECT((&rl[4]), x + bl + 1, y + bt + 1, w, h);
 
-       EShapeCombineRectangles(EoGetWin(sw), ShapeBounding, 0, 0, rl,
-                               8, (seqno == 0) ? ShapeSet : ShapeUnion,
-                               Unsorted);
+       if (seqno == 0)
+          EShapeSetRects(EoGetWin(sw), 0, 0, rl, 8);
+       else
+          EShapeUnionRects(EoGetWin(sw), 0, 0, rl, 8);
      }
    EoShapeUpdate(sw, 0);
 }
===================================================================
RCS file: /cvs/e/e16/e/src/ecompmgr.c,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -3 -r1.177 -r1.178
--- ecompmgr.c  1 Jun 2008 20:53:12 -0000       1.177
+++ ecompmgr.c  5 Jun 2008 08:55:20 -0000       1.178
@@ -47,6 +47,7 @@
 #include <unistd.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
+#include <X11/extensions/shape.h>
 #include <X11/extensions/Xcomposite.h>
 #include <X11/extensions/Xdamage.h>
 #include <X11/extensions/Xfixes.h>
===================================================================
RCS file: /cvs/e/e16/e/src/eimage.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- eimage.c    10 May 2008 23:22:31 -0000      1.27
+++ eimage.c    5 Jun 2008 08:55:20 -0000       1.28
@@ -465,7 +465,7 @@
    EImageRenderPixmaps(im, win, flags, &pmap, &mask, w, h);
    ESetWindowBackgroundPixmap(win, pmap);
    if ((mask != None) || (mask == None && WinIsShaped(win)))
-      EShapeCombineMask(win, ShapeBounding, 0, 0, mask, ShapeSet);
+      EShapeSetMask(win, 0, 0, mask);
    EImagePixmapsFree(pmap, mask);
    EClearWindow(win);
 }
===================================================================
RCS file: /cvs/e/e16/e/src/events.c,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -3 -r1.149 -r1.150
--- events.c    30 Mar 2008 12:13:15 -0000      1.149
+++ events.c    5 Jun 2008 08:55:20 -0000       1.150
@@ -29,6 +29,7 @@
 #include "tooltips.h"
 #include "xwin.h"
 #include <sys/time.h>
+#include <X11/extensions/shape.h>
 #if USE_XSYNC
 #include <X11/extensions/sync.h>
 #endif
===================================================================
RCS file: /cvs/e/e16/e/src/ewin-ops.c,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -3 -r1.125 -r1.126
--- ewin-ops.c  24 Mar 2008 11:12:40 -0000      1.125
+++ ewin-ops.c  5 Jun 2008 08:55:20 -0000       1.126
@@ -850,8 +850,7 @@
 
 #define _EWIN_ADJUST_SHAPE(ewin, xo, yo) \
   do { \
-    EShapeCombineShape(ewin->win_container, ShapeBounding, xo, yo, \
-                       EwinGetClientWin(ewin), ShapeBounding, ShapeSet); \
+    EShapeSetShape(ewin->win_container, xo, yo, EwinGetClientWin(ewin)); \
     ewin->update.shape = 1; \
   } while (0)
 
===================================================================
RCS file: /cvs/e/e16/e/src/ewins.c,v
retrieving revision 1.228
retrieving revision 1.229
diff -u -3 -r1.228 -r1.229
--- ewins.c     24 May 2008 18:13:16 -0000      1.228
+++ ewins.c     5 Jun 2008 08:55:20 -0000       1.229
@@ -39,6 +39,7 @@
 #include "timers.h"
 #include "windowmatch.h"
 #include "xwin.h"
+#include <X11/extensions/shape.h>
 
 #define EWIN_TOP_EVENT_MASK \
   (/* ButtonPressMask | ButtonReleaseMask | */ \
@@ -600,7 +601,8 @@
 EwinUpdateShapeInfo(EWin * ewin)
 {
    EGrabServer();
-   ewin->state.shaped = EShapeCopy(ewin->win_container, 
EwinGetClientWin(ewin));
+   ewin->state.shaped =
+      EShapeSetShape(ewin->win_container, 0, 0, EwinGetClientWin(ewin));
    EUngrabServer();
 
    if (EDebug(EX_EVENT_SHAPE_NOTIFY))
===================================================================
RCS file: /cvs/e/e16/e/src/extinitwin.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- extinitwin.c        30 Mar 2008 12:13:15 -0000      1.29
+++ extinitwin.c        5 Jun 2008 08:55:20 -0000       1.30
@@ -26,6 +26,7 @@
 #include "eimage.h"
 #include "xwin.h"
 #include <sys/time.h>
+#include <X11/extensions/shape.h>
 
 static              Window
 ExtInitWinMain(void)
===================================================================
RCS file: /cvs/e/e16/e/src/hiwin.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- hiwin.c     29 Mar 2008 17:18:58 -0000      1.32
+++ hiwin.c     5 Jun 2008 08:55:20 -0000       1.33
@@ -99,7 +99,7 @@
    ESetWindowBackgroundPixmap(EoGetWin(phi), None);
 
    /* Reset shape */
-   EShapeCombineMask(EoGetWin(phi), ShapeBounding, 0, 0, None, ShapeSet);
+   EShapeSetMask(EoGetWin(phi), 0, 0, None);
    EoShapeUpdate(phi, 0);
 }
 
===================================================================
RCS file: /cvs/e/e16/e/src/icccm.c,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -3 -r1.146 -r1.147
--- icccm.c     30 Mar 2008 12:13:16 -0000      1.146
+++ icccm.c     5 Jun 2008 08:55:20 -0000       1.147
@@ -28,6 +28,7 @@
 #include "hints.h"
 #include "session.h"
 #include "xwin.h"
+#include <X11/Xutil.h>
 #if USE_XSYNC
 #include "timers.h"
 #include <X11/extensions/sync.h>
===================================================================
RCS file: /cvs/e/e16/e/src/iclass.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -3 -r1.136 -r1.137
--- iclass.c    25 Apr 2008 19:12:11 -0000      1.136
+++ iclass.c    5 Jun 2008 08:55:20 -0000       1.137
@@ -1179,10 +1179,9 @@
               }
 
             if (pmm.w == w && pmm.h == h)
-               EShapeCombineMask(win, ShapeBounding, 0, 0, pmm.mask, ShapeSet);
+               EShapeSetMask(win, 0, 0, pmm.mask);
             else if (pmm.mask)
-               EShapeCombineMaskTiled(win, ShapeBounding, 0, 0,
-                                      pmm.mask, ShapeSet, w, h);
+               EShapeSetMaskTiled(win, 0, 0, pmm.mask, w, h);
          }
 
        FreePmapMask(&pmm);
===================================================================
RCS file: /cvs/e/e16/e/src/menus.c,v
retrieving revision 1.301
retrieving revision 1.302
diff -u -3 -r1.301 -r1.302
--- menus.c     24 May 2008 18:13:17 -0000      1.301
+++ menus.c     5 Jun 2008 08:55:21 -0000       1.302
@@ -921,7 +921,7 @@
        EGetWindowBackgroundPixmap(m->win);
        EXCopyAreaTiled(m->pmm.pmap, None, WinGetPmap(m->win),
                        0, 0, m->w, m->h, 0, 0);
-       EShapeCombineMask(m->win, ShapeBounding, 0, 0, m->pmm.mask, ShapeSet);
+       EShapeSetMask(m->win, 0, 0, m->pmm.mask);
        EClearWindow(m->win);
        for (i = 0; i < m->num; i++)
           MenuDrawItem(m, m->items[i], 0, -1);
@@ -996,7 +996,7 @@
      }
 
    ESetWindowBackgroundPixmap(mi->win, mi_pmm->pmap);
-   EShapeCombineMask(mi->win, ShapeBounding, 0, 0, mi_pmm->mask, ShapeSet);
+   EShapeSetMask(mi->win, 0, 0, mi_pmm->mask);
    EClearWindow(mi->win);
 
    if ((shape) && (m->style->use_item_bg))
===================================================================
RCS file: /cvs/e/e16/e/src/piximg.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- piximg.c    29 Mar 2008 17:18:58 -0000      1.7
+++ piximg.c    5 Jun 2008 08:55:21 -0000       1.8
@@ -25,6 +25,7 @@
 #include "xwin.h"
 #include <sys/ipc.h>
 #include <sys/shm.h>
+#include <X11/Xutil.h>
 #include <X11/extensions/XShm.h>
 
 void
===================================================================
RCS file: /cvs/e/e16/e/src/warp.c,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -3 -r1.111 -r1.112
--- warp.c      23 Mar 2008 11:54:24 -0000      1.111
+++ warp.c      5 Jun 2008 08:55:21 -0000       1.112
@@ -160,7 +160,7 @@
    fw->mh = h;
 
    /* Reset shape */
-   EShapeCombineMask(EoGetWin(fw), ShapeBounding, 0, 0, None, ShapeSet);
+   EShapeSetMask(EoGetWin(fw), 0, 0, None);
 
    ScreenGetAvailableAreaByPointer(&x, &y, &ww, &hh);
    x += (ww - w) / 2;
===================================================================
RCS file: /cvs/e/e16/e/src/x.c,v
retrieving revision 1.175
retrieving revision 1.176
diff -u -3 -r1.175 -r1.176
--- x.c 10 May 2008 23:22:31 -0000      1.175
+++ x.c 5 Jun 2008 08:55:21 -0000       1.176
@@ -30,6 +30,7 @@
 #include <X11/Xatom.h>
 #include <X11/Xutil.h>
 #include <X11/Xresource.h>
+#include <X11/extensions/shape.h>
 #if USE_COMPOSITE
 #include <X11/extensions/Xrender.h>
 #endif
@@ -1290,7 +1291,7 @@
 #endif
 }
 
-void
+static void
 EShapeCombineMask(Win win, int dest, int x, int y, Pixmap pmap, int op)
 {
    char                wasshaped = 0;
@@ -1319,7 +1320,7 @@
       XShapeCombineMask(disp, win->xwin, dest, x, y, pmap, op);
 }
 
-void
+static void
 EShapeCombineMaskTiled(Win win, int dest, int x, int y,
                       Pixmap pmap, int op, int w, int h)
 {
@@ -1340,7 +1341,7 @@
    EFreePixmap(tm);
 }
 
-void
+static void
 EShapeCombineRectangles(Win win, int dest, int x, int y,
                        XRectangle * rect, int n_rects, int op, int ordering)
 {
@@ -1378,53 +1379,15 @@
    EShapeUpdate(win);
 }
 
-int
-EShapeCopy(Win dst, Win src)
+static void
+EShapeCombineShape(Win win, int dest, int x, int y,
+                  Win src_win, int src_kind, int op)
 {
-   XRectangle         *rl;
-   int                 rn;
-
-   if (!src || !dst)
-      return 0;
-
-   if (src->attached)
-      EShapeUpdate(src);
-
-   rn = src->num_rect;
-   rl = src->rects;
-
-   if (rn < 0)
-     {
-       /* Source has empty shape */
-       EShapeCombineShape(dst, ShapeBounding, 0, 0,
-                          src, ShapeBounding, ShapeSet);
-     }
-   else if (rn == 0)
-     {
-       /* Source has default shape (no shape) */
-       EShapeCombineMask(dst, ShapeBounding, 0, 0, None, ShapeSet);
-     }
-   else if (rn == 1)
-     {
-       if ((rl[0].x <= 0) && (rl[0].y <= 0) && (rl[0].width >= src->w)
-           && (rl[0].height >= src->h))
-         {
-            rn = 0;
-            EShapeCombineMask(dst, ShapeBounding, 0, 0, None, ShapeSet);
-         }
-       else
-         {
-            EShapeCombineShape(dst, ShapeBounding, 0, 0,
-                               src, ShapeBounding, ShapeSet);
-         }
-     }
-   else
-     {
-       EShapeCombineShape(dst, ShapeBounding, 0, 0,
-                          src, ShapeBounding, ShapeSet);
-     }
+   if (!win)
+      return;
 
-   return rn != 0;
+   XShapeCombineShape(disp, win->xwin, dest, x, y, src_win->xwin, src_kind, 
op);
+   EShapeUpdate(win);
 }
 
 int
@@ -1536,17 +1499,6 @@
    return 0;
 }
 
-void
-EShapeCombineShape(Win win, int dest, int x, int y,
-                  Win src_win, int src_kind, int op)
-{
-   if (!win)
-      return;
-
-   XShapeCombineShape(disp, win->xwin, dest, x, y, src_win->xwin, src_kind, 
op);
-   EShapeUpdate(win);
-}
-
 int
 EShapeCheck(Win win)
 {
@@ -1554,6 +1506,46 @@
       return 0;
 
    return win->num_rect;
+}
+
+void
+EShapeSetMask(Win win, int x, int y, Pixmap mask)
+{
+   EShapeCombineMask(win, ShapeBounding, x, y, mask, ShapeSet);
+}
+
+void
+EShapeUnionMask(Win win, int x, int y, Pixmap mask)
+{
+   EShapeCombineMask(win, ShapeBounding, x, y, mask, ShapeUnion);
+}
+
+void
+EShapeSetMaskTiled(Win win, int x, int y, Pixmap mask, int w, int h)
+{
+   EShapeCombineMaskTiled(win, ShapeBounding, x, y, mask, ShapeSet, w, h);
+}
+
+void
+EShapeSetRects(Win win, int x, int y, XRectangle * rect, int n_rects)
+{
+   EShapeCombineRectangles(win, ShapeBounding, x, y, rect, n_rects,
+                          ShapeSet, Unsorted);
+}
+
+void
+EShapeUnionRects(Win win, int x, int y, XRectangle * rect, int n_rects)
+{
+   EShapeCombineRectangles(win, ShapeBounding, x, y, rect, n_rects,
+                          ShapeUnion, Unsorted);
+}
+
+int
+EShapeSetShape(Win win, int x, int y, Win src_win)
+{
+   EShapeCombineShape(win, ShapeBounding, x, y,
+                     src_win, ShapeBounding, ShapeSet);
+   return win->num_rect != 0;
 }
 
 Pixmap
===================================================================
RCS file: /cvs/e/e16/e/src/xwin.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- xwin.h      24 May 2008 18:14:58 -0000      1.46
+++ xwin.h      5 Jun 2008 08:55:21 -0000       1.47
@@ -25,7 +25,6 @@
 #define _XWIN_H_
 
 #include <X11/Xlib.h>
-#include <X11/extensions/shape.h>
 #include "util.h"
 #include "xtypes.h"
 
@@ -216,16 +215,15 @@
                                  unsigned int height, unsigned int depth);
 void                EFreePixmap(Pixmap pixmap);
 
-void                EShapeCombineMask(Win win, int dest, int x, int y,
-                                     Pixmap pmap, int op);
-void                EShapeCombineMaskTiled(Win win, int dest, int x, int y,
-                                          Pixmap pmap, int op, int w, int h);
-void                EShapeCombineRectangles(Win win, int dest, int x, int y,
-                                           XRectangle * rect, int n_rects,
-                                           int op, int ordering);
-void                EShapeCombineShape(Win win, int dest, int x, int y,
-                                      Win src_win, int src_kind, int op);
-int                 EShapeCopy(Win dst, Win src);
+void                EShapeSetMask(Win win, int x, int y, Pixmap mask);
+void                EShapeUnionMask(Win win, int x, int y, Pixmap mask);
+void                EShapeSetMaskTiled(Win win, int x, int y, Pixmap mask,
+                                      int w, int h);
+void                EShapeSetRects(Win win, int x, int y,
+                                  XRectangle * rect, int n_rects);
+void                EShapeUnionRects(Win win, int x, int y,
+                                    XRectangle * rect, int n_rects);
+int                 EShapeSetShape(Win win, int x, int y, Win src_win);
 int                 EShapePropagate(Win win);
 int                 EShapeCheck(Win win);
 Pixmap              EWindowGetShapePixmap(Win win);



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to