Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h ecompmgr.c ecompmgr.h ewins.c mod-misc.c 


Log Message:
New ARGB client handling mode: off(default), borderless, or full.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.419
retrieving revision 1.420
diff -u -3 -r1.419 -r1.420
--- E.h 2 May 2005 22:10:39 -0000       1.419
+++ E.h 3 May 2005 18:21:36 -0000       1.420
@@ -974,7 +974,7 @@
    char                memory_paranoia;
    char                save_under;
    int                 edge_flip_resistance;
-   char                argb_clients_borderless;
+   char                argb_client_mode;
 
    /* Not used */
 #ifdef HAS_XINERAMA
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ecompmgr.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- ecompmgr.c  2 May 2005 22:10:58 -0000       1.26
+++ ecompmgr.c  3 May 2005 18:21:39 -0000       1.27
@@ -173,6 +173,26 @@
 static void         ECompMgrHandleWindowEvent(XEvent * ev, void *prm);
 
 /*
+ * Visuals
+ */
+
+int
+EVisualIsARGB(Visual * vis)
+{
+   XRenderPictFormat  *pictfmt;
+
+   pictfmt = XRenderFindVisualFormat(disp, vis);
+   if (!pictfmt)
+      return 0;
+
+#if 0
+   Eprintf("Visual ID=%#lx Type=%d, alphamask=%d\n", vis->visualid,
+          pictfmt->type, pictfmt->direct.alphaMask);
+#endif
+   return pictfmt->type == PictTypeDirect && pictfmt->direct.alphaMask;
+}
+
+/*
  * Regions
  */
 
@@ -894,9 +914,7 @@
 ECompMgrWinChangeOpacity(EObj * eo, unsigned int opacity)
 {
    ECmWinInfo         *cw = eo->cmhook;
-   Display            *dpy = disp;
    int                 mode;
-   XRenderPictFormat  *pictfmt;
 
    if (!cw || cw->opacity == opacity)
       return;
@@ -914,8 +932,7 @@
    /* Invalidate stuff changed by opacity */
    ECompMgrWinInvalidate(eo, INV_OPACITY);
 
-   pictfmt = XRenderFindVisualFormat(dpy, cw->a.visual);
-   if (pictfmt && pictfmt->type == PictTypeDirect && pictfmt->direct.alphaMask)
+   if (EVisualIsARGB(cw->a.visual))
       mode = WINDOW_ARGB;
    else if (cw->opacity != OPAQUE)
       mode = WINDOW_TRANS;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ecompmgr.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- ecompmgr.h  2 May 2005 22:10:58 -0000       1.10
+++ ecompmgr.h  3 May 2005 18:21:40 -0000       1.11
@@ -31,6 +31,8 @@
    int                 shadow;
 } cfg_composite;
 
+int                 EVisualIsARGB(Visual * vis);
+
 void                ECompMgrParseArgs(const char *args);
 
 void                ECompMgrWinNew(EObj * eo);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -3 -r1.54 -r1.55
--- ewins.c     2 May 2005 22:10:59 -0000       1.54
+++ ewins.c     3 May 2005 18:21:40 -0000       1.55
@@ -66,16 +66,15 @@
    EWin               *ewin;
    XSetWindowAttributes att;
    Window              frame;
-   int                 require_argb;
+   int                 use_argb;
    XWindowAttributes   win_attr;
 
-   require_argb = 0;
+   use_argb = 0;
    if (type == EWIN_TYPE_NORMAL)
      {
        if (!XGetWindowAttributes(disp, win, &win_attr))
           return NULL;
-       if (win_attr.depth == 32)
-          require_argb = 1;
+       use_argb = Conf.argb_client_mode > 0 && EVisualIsARGB(win_attr.visual);
      }
 
    ewin = Ecalloc(1, sizeof(EWin));
@@ -117,7 +116,7 @@
 
    ewin->ewmh.opacity = 0;     /* If 0, ignore */
 
-   if (require_argb)
+   if (use_argb)
       frame = ECreateVisualWindow(VRoot.win, -10, -10, 1, 1, 1, &win_attr);
    else
       frame = ECreateWindow(VRoot.win, -10, -10, 1, 1, 1);
@@ -129,7 +128,7 @@
    EoSetShadow(ewin, 1);
    EobjListFocusAdd(&ewin->o, 0);
 
-   if (require_argb)
+   if (use_argb)
       ewin->win_container =
         ECreateVisualWindow(EoGetWin(ewin), 0, 0, 1, 1, 0, &win_attr);
    else
@@ -168,7 +167,7 @@
        ewin->client.bw = 0;
      }
 
-   if (require_argb && Conf.argb_clients_borderless)
+   if (use_argb && Conf.argb_client_mode < 2)
       ewin->border =
         FindItem("BORDERLESS", 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER);
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/mod-misc.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- mod-misc.c  29 Apr 2005 18:24:52 -0000      1.16
+++ mod-misc.c  3 May 2005 18:21:41 -0000       1.17
@@ -146,7 +146,7 @@
    CFG_ITEM_BOOL(Conf, memory_paranoia, 1),
    CFG_ITEM_BOOL(Conf, save_under, 0),
    CFG_ITEM_INT(Conf, edge_flip_resistance, 25),
-   CFG_ITEM_BOOL(Conf, argb_clients_borderless, 1),
+   CFG_ITEM_INT(Conf, argb_client_mode, 0),
 };
 #define N_CFG_ITEMS ((int)(sizeof(MiscCfgItems)/sizeof(CfgItem)))
 




-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to