Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        ecompmgr.c 


Log Message:
Shadow- and other tweaks.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ecompmgr.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- ecompmgr.c  4 Sep 2005 21:17:31 -0000       1.55
+++ ecompmgr.c  6 Sep 2005 22:36:26 -0000       1.56
@@ -126,11 +126,22 @@
    char                resize_fix_enable;
    char                use_name_pixmap;
    int                 mode;
-   int                 shadow;
-   int                 shadow_radius;
    struct
    {
-      int                 enable;
+      int                 mode;
+      struct
+      {
+        int                 radius;
+        int                 offset_x, offset_y;
+      } blur;
+      struct
+      {
+        int                 offset_x, offset_y;
+      } sharp;
+   } shadows;
+   struct
+   {
+      char                enable;
       int                 dt_us;       /* us between updates */
       unsigned int        step;
    } fading;
@@ -662,11 +673,11 @@
     * Build the gaussian in sections
     */
 
-#if 0                          /* Never used */
+#if 1
+   /* FIXME - Handle properly - shaped/non-shaped/offset */
    /*
     * center (fill the complete data array)
     */
-
    d = sum_gaussian(gaussianMap, opacity, center, center, width, height);
    memset(data, d, sheight * swidth);
 #endif
@@ -790,23 +801,28 @@
    r.height = cw->rch;
 
 #if ENABLE_SHADOWS
-   if (eo->shadow && Conf_compmgr.shadow != ECM_SHADOWS_OFF &&
-       (Conf_compmgr.shadow == ECM_SHADOWS_SHARP || cw->mode != WINDOW_ARGB) &&
-       (Conf_compmgr.shadow != ECM_SHADOWS_BLURRED || !EobjIsShaped(eo)))
+   if (eo->shadow && Conf_compmgr.shadows.mode != ECM_SHADOWS_OFF &&
+       (Conf_compmgr.shadows.mode == ECM_SHADOWS_SHARP ||
+       cw->mode != WINDOW_ARGB) &&
+       (Conf_compmgr.shadows.mode != ECM_SHADOWS_BLURRED || !EobjIsShaped(eo)))
      {
        XRectangle          sr;
 
-       if (Conf_compmgr.shadow == ECM_SHADOWS_SHARP)
+       if (Conf_compmgr.shadows.mode == ECM_SHADOWS_SHARP)
          {
-            cw->shadow_dx = 2;
-            cw->shadow_dy = 7;
+            cw->shadow_dx = Conf_compmgr.shadows.sharp.offset_x;
+            cw->shadow_dy = Conf_compmgr.shadows.sharp.offset_y;
             cw->shadow_width = cw->rcw;
             cw->shadow_height = cw->rch;
          }
        else
          {
-            cw->shadow_dx = -Conf_compmgr.shadow_radius * 5 / 4;
-            cw->shadow_dy = -Conf_compmgr.shadow_radius * 5 / 4;
+            cw->shadow_dx =
+               Conf_compmgr.shadows.blur.offset_x -
+               Conf_compmgr.shadows.blur.radius * 5 / 4;
+            cw->shadow_dy =
+               Conf_compmgr.shadows.blur.offset_y -
+               Conf_compmgr.shadows.blur.radius * 5 / 4;
             if (!cw->shadow)
               {
                  double              opacity = SHADOW_OPACITY;
@@ -1318,7 +1334,7 @@
 {
    ECmWinInfo         *cw = eo->cmhook;
 
-   if (Conf_compmgr.shadow == ECM_SHADOWS_OFF)
+   if (Conf_compmgr.shadows.mode == ECM_SHADOWS_OFF)
       return;
 
    if (cw->extents != None)
@@ -1389,7 +1405,7 @@
                              eo->x + cw->a.border_width,
                              eo->y + cw->a.border_width);
 #if ENABLE_SHADOWS
-       if (Conf_compmgr.shadow == ECM_SHADOWS_SHARP)
+       if (Conf_compmgr.shadows.mode == ECM_SHADOWS_SHARP)
          {
             XserverRegion       o;
 
@@ -1509,11 +1525,8 @@
    Display            *dpy = disp;
    XserverRegion       reg;
 
-   if (dx == 0 && dy == 0)
-     {
-       reg = src;
-     }
-   else
+   reg = src;
+   if (dx != 0 || dy != 0)
      {
        reg = XFixesCreateRegion(dpy, 0, 0);
        XFixesCopyRegion(dpy, reg, src);
@@ -1597,7 +1610,7 @@
          }
 
 #if ENABLE_SHADOWS
-       switch (Conf_compmgr.shadow)
+       switch (Conf_compmgr.shadows.mode)
          {
          case ECM_SHADOWS_OFF:
             break;
@@ -1788,7 +1801,7 @@
 ECompMgrShadowsInit(int mode, int cleanup)
 {
    if (mode == ECM_SHADOWS_BLURRED)
-      gaussianMap = make_gaussian_map(disp, Conf_compmgr.shadow_radius);
+      gaussianMap = make_gaussian_map(disp, Conf_compmgr.shadows.blur.radius);
    else
      {
        if (gaussianMap)
@@ -1845,7 +1858,7 @@
    rootPicture =
       XRenderCreatePicture(disp, VRoot.win, pictfmt, CPSubwindowMode, &pa);
 
-   ECompMgrShadowsInit(Conf_compmgr.shadow, 0);
+   ECompMgrShadowsInit(Conf_compmgr.shadows.mode, 0);
 
    switch (Conf_compmgr.mode)
      {
@@ -1936,7 +1949,7 @@
 
    EventCallbackUnregister(VRoot.win, 0, ECompMgrHandleRootEvent, NULL);
 
-   if (Conf_compmgr.shadow != ECM_SHADOWS_OFF)
+   if (Conf_compmgr.shadows.mode != ECM_SHADOWS_OFF)
       DesksClear();
 }
 
@@ -1944,7 +1957,7 @@
 ECompMgrConfigGet(cfg_composite * cfg)
 {
    cfg->enable = Conf_compmgr.enable;
-   cfg->shadow = Conf_compmgr.shadow;
+   cfg->shadow = Conf_compmgr.shadows.mode;
 }
 
 void
@@ -1964,7 +1977,7 @@
    if (cfg->enable != Conf_compmgr.enable)
      {
        Conf_compmgr.enable = cfg->enable;
-       Conf_compmgr.shadow = cfg->shadow;
+       Conf_compmgr.shadows.mode = cfg->shadow;
        if (cfg->enable)
           ECompMgrStart();
        else
@@ -1972,12 +1985,12 @@
      }
    else
      {
-       if (cfg->shadow != Conf_compmgr.shadow)
+       if (cfg->shadow != Conf_compmgr.shadows.mode)
          {
-            Conf_compmgr.shadow = cfg->shadow;
+            Conf_compmgr.shadows.mode = cfg->shadow;
             if (Conf_compmgr.enable)
               {
-                 ECompMgrShadowsInit(Conf_compmgr.shadow, 1);
+                 ECompMgrShadowsInit(Conf_compmgr.shadows.mode, 1);
                  ECompMgrDamageAll();
               }
          }
@@ -2118,7 +2131,7 @@
 
      case Expose:
 #if 1                          /* FIXME - Need this? */
-       if (Conf_compmgr.shadow != ECM_SHADOWS_OFF)
+       if (Conf_compmgr.shadows.mode != ECM_SHADOWS_OFF)
           ECompMgrRootExpose(prm, ev);
 #endif
        break;
@@ -2249,11 +2262,15 @@
 static const CfgItem CompMgrCfgItems[] = {
    CFG_ITEM_BOOL(Conf_compmgr, enable, 0),
    CFG_ITEM_INT(Conf_compmgr, mode, 1),
-   CFG_ITEM_INT(Conf_compmgr, shadow, 0),
-   CFG_ITEM_INT(Conf_compmgr, shadow_radius, 12),
+   CFG_ITEM_INT(Conf_compmgr, shadows.mode, 0),
+   CFG_ITEM_INT(Conf_compmgr, shadows.blur.radius, 8),
+   CFG_ITEM_INT(Conf_compmgr, shadows.blur.offset_x, 2),
+   CFG_ITEM_INT(Conf_compmgr, shadows.blur.offset_y, 2),
+   CFG_ITEM_INT(Conf_compmgr, shadows.sharp.offset_x, 2),
+   CFG_ITEM_INT(Conf_compmgr, shadows.sharp.offset_y, 7),
    CFG_ITEM_BOOL(Conf_compmgr, resize_fix_enable, 0),
    CFG_ITEM_BOOL(Conf_compmgr, use_name_pixmap, 0),
-   CFG_ITEM_BOOL(Conf_compmgr, fading.enable, 0),
+   CFG_ITEM_BOOL(Conf_compmgr, fading.enable, 1),
    CFG_ITEM_INT(Conf_compmgr, fading.dt_us, 10000),
    CFG_ITEM_INT(Conf_compmgr, fading.step, 0x10000000),
    CFG_ITEM_INT(Conf_compmgr, override_redirect.mode, 1),




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to