Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h dialog.c eobj.c ewins.c iconify.c ipc.c menus.c mod-misc.c 
        pager.c x.c xwin.h 


Log Message:
ARGB window tweaks and testing stuff.

===================================================================
RCS file: /cvs/e/e16/e/src/E.h,v
retrieving revision 1.556
retrieving revision 1.557
diff -u -3 -r1.556 -r1.557
--- E.h 2 Jun 2006 22:53:22 -0000       1.556
+++ E.h 3 Jun 2006 14:11:33 -0000       1.557
@@ -383,6 +383,13 @@
       char                warp_on_select;
       int                 icon_mode;
    } warplist;
+   struct
+   {
+      char                argb_internal_objects;
+      char                argb_internal_clients;
+      char                argb_clients;
+      char                argb_clients_inherit_attr;
+   } testing;
    int                 deskmode;
    char                animate_shading;
    int                 shadespeed;
===================================================================
RCS file: /cvs/e/e16/e/src/dialog.c,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -3 -r1.159 -r1.160
--- dialog.c    13 May 2006 13:25:30 -0000      1.159
+++ dialog.c    3 Jun 2006 14:11:33 -0000       1.160
@@ -251,7 +251,7 @@
    ecore_list_append(dialog_list, d);
 
    d->name = Estrdup(name);
-   d->win = ECreateWindow(VRoot.win, -20, -20, 2, 2, 0);
+   d->win = ECreateClientWindow(VRoot.win, -20, -20, 2, 2);
    EventCallbackRegister(d->win, 0, DialogHandleEvents, d);
 
    d->tclass = TextclassFind("DIALOG", 1);
===================================================================
RCS file: /cvs/e/e16/e/src/eobj.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -3 -r1.77 -r1.78
--- eobj.c      21 May 2006 12:09:14 -0000      1.77
+++ eobj.c      3 Jun 2006 14:11:33 -0000       1.78
@@ -158,9 +158,12 @@
 EobjInit(EObj * eo, int type, Win win, int x, int y, int w, int h,
         int su, const char *name)
 {
+   char                argb;
+
    if (!eo->desk)
       eo->desk = DeskGet(0);
-   if (win == None)
+
+   if (!win)
      {
        if (type == EOBJ_TYPE_EVENT)
          {
@@ -169,7 +172,9 @@
          }
        else
          {
-            win = ECreateWindow(EoGetWin(eo->desk), x, y, w, h, su);
+            win = ECreateObjectWindow(EoGetWin(eo->desk), x, y, w, h, su, 0,
+                                      NULL, &argb);
+            eo->argb = argb;
          }
      }
    eo->type = type;
===================================================================
RCS file: /cvs/e/e16/e/src/ewins.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -3 -r1.167 -r1.168
--- ewins.c     2 Jun 2006 22:53:22 -0000       1.167
+++ ewins.c     3 Jun 2006 14:11:33 -0000       1.168
@@ -181,6 +181,7 @@
 {
    XSetWindowAttributes att;
    Win                 frame;
+   char                argb;
 
    if (ewin->client.w <= 0)
       ewin->client.w = 100;
@@ -190,30 +191,13 @@
    if (ewin->state.docked)
       ewin->inh_wm.b.border = 1;
 
-#if USE_COMPOSITE
-   if (EVisualIsARGB(WinGetVisual(_EwinGetClientWin(ewin))))
-     {
-       XWindowAttributes   win_attr;
-
-       ewin->o.argb = 1;
-
-       EGetWindowAttributes(_EwinGetClientWin(ewin), &win_attr);
-       frame =
-          ECreateVisualWindow(VRoot.win, ewin->client.x, ewin->client.y,
-                              ewin->client.w, ewin->client.h, 1, &win_attr);
-       ewin->win_container =
-          ECreateVisualWindow(frame, 0, 0, ewin->client.w, ewin->client.h,
-                              0, &win_attr);
-     }
-   else
-#endif
-     {
-       frame =
-          ECreateWindow(VRoot.win, ewin->client.x, ewin->client.y,
-                        ewin->client.w, ewin->client.h, 1);
-       ewin->win_container =
-          ECreateWindow(frame, 0, 0, ewin->client.w, ewin->client.h, 0);
-     }
+   frame =
+      ECreateObjectWindow(VRoot.win, ewin->client.x, ewin->client.y,
+                         ewin->client.w, ewin->client.h, 0, 1,
+                         _EwinGetClientWin(ewin), &argb);
+   ewin->o.argb = argb;
+   ewin->win_container =
+      ECreateWindow(frame, 0, 0, ewin->client.w, ewin->client.h, 0);
 
    EoInit(ewin, EOBJ_TYPE_EWIN, frame, ewin->client.x, ewin->client.y,
          ewin->client.w, ewin->client.h, 1, ewin->icccm.wm_name);
===================================================================
RCS file: /cvs/e/e16/e/src/iconify.c,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -3 -r1.211 -r1.212
--- iconify.c   1 Jun 2006 19:11:09 -0000       1.211
+++ iconify.c   3 Jun 2006 14:11:33 -0000       1.212
@@ -372,7 +372,7 @@
    ib->scrollbar_clicked = 0;
    ib->scrollbox_clicked = 0;
 
-   ib->win = ECreateWindow(VRoot.win, 0, 0, 1, 1, 0);
+   ib->win = ECreateClientWindow(VRoot.win, 0, 0, 1, 1);
    ib->icon_win = ECreateWindow(ib->win, 0, 0, 128, 26, 0);
    EventCallbackRegister(ib->icon_win, 0, IboxEventIconWin, ib);
    ib->cover_win = ECreateWindow(ib->win, 0, 0, 128, 26, 0);
===================================================================
RCS file: /cvs/e/e16/e/src/ipc.c,v
retrieving revision 1.269
retrieving revision 1.270
diff -u -3 -r1.269 -r1.270
--- ipc.c       28 May 2006 09:54:39 -0000      1.269
+++ ipc.c       3 Jun 2006 14:11:33 -0000       1.270
@@ -1218,14 +1218,15 @@
    lst = EobjListStackGet(&num);
 
    IpcPrintf
-      ("Num    window T V Sh  Dsk S  F   L     pos       size    C R Name\n");
+      ("Num    window De T V Sh  Dsk S  F   L     pos       size    C R 
Name\n");
    for (i = 0; i < num; i++)
      {
        eo = lst[i];
        IpcPrintf
-          (" %2d %#9lx %d %d %2d  %3d %d  %d %3d %5d,%5d %4dx%4d %d %d %s\n",
-           i, EobjGetXwin(eo), eo->type, eo->shown, eo->shaped, eo->desk->num,
-           eo->sticky, eo->floating, eo->ilayer, eo->x, eo->y, eo->w, eo->h,
+          (" %2d %#9lx %2d %d %d %2d  %3d %d  %d %3d %5d,%5d %4dx%4d %d %d 
%s\n",
+           i, WinGetXwin(eo->win), WinGetDepth(eo->win), eo->type, eo->shown,
+           eo->shaped, eo->desk->num, eo->sticky, eo->floating, eo->ilayer,
+           eo->x, eo->y, eo->w, eo->h,
 #if USE_COMPOSITE
            (eo->cmhook) ? 1 : 0, !eo->noredir
 #else
===================================================================
RCS file: /cvs/e/e16/e/src/menus.c,v
retrieving revision 1.247
retrieving revision 1.248
diff -u -3 -r1.247 -r1.248
--- menus.c     8 May 2006 16:26:22 -0000       1.247
+++ menus.c     3 Jun 2006 14:11:33 -0000       1.248
@@ -663,7 +663,7 @@
 
    if (!m->win)
      {
-       m->win = ECreateWindow(VRoot.win, 0, 0, 1, 1, 0);
+       m->win = ECreateClientWindow(VRoot.win, 0, 0, 1, 1);
        EventCallbackRegister(m->win, 0, MenuHandleEvents, m);
        if (m->title)
           HintsSetWindowName(m->win, _(m->title));
===================================================================
RCS file: /cvs/e/e16/e/src/mod-misc.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- mod-misc.c  21 May 2006 12:17:57 -0000      1.35
+++ mod-misc.c  3 Jun 2006 14:11:34 -0000       1.36
@@ -151,6 +151,11 @@
    CFG_ITEM_BOOL(Conf, startup.firsttime, 1),
    CFG_ITEM_BOOL(Conf, startup.animate, 1),
 
+   CFG_ITEM_BOOL(Conf, testing.argb_internal_objects, 0),
+   CFG_ITEM_BOOL(Conf, testing.argb_internal_clients, 0),
+   CFG_ITEM_BOOL(Conf, testing.argb_clients, 0),
+   CFG_ITEM_BOOL(Conf, testing.argb_clients_inherit_attr, 0),
+
    CFG_ITEM_INT(Conf, deskmode, MODE_NONE),
    CFG_ITEM_BOOL(Conf, animate_shading, 1),
    CFG_ITEM_INT(Conf, shadespeed, 8000),
===================================================================
RCS file: /cvs/e/e16/e/src/pager.c,v
retrieving revision 1.217
retrieving revision 1.218
diff -u -3 -r1.217 -r1.218
--- pager.c     28 May 2006 11:51:41 -0000      1.217
+++ pager.c     3 Jun 2006 14:11:34 -0000       1.218
@@ -120,7 +120,7 @@
    ecore_list_append(pager_list, p);
 
    p->name = NULL;
-   p->win = ECreateWindow(VRoot.win, 0, 0, 1, 1, 0);
+   p->win = ECreateClientWindow(VRoot.win, 0, 0, 1, 1);
    EventCallbackRegister(p->win, 0, PagerEvent, p);
    p->sel_win = ECreateWindow(p->win, 0, 0, 1, 1, 0);
 
===================================================================
RCS file: /cvs/e/e16/e/src/x.c,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -3 -r1.144 -r1.145
--- x.c 1 Jun 2006 20:18:40 -0000       1.144
+++ x.c 3 Jun 2006 14:11:34 -0000       1.145
@@ -35,6 +35,11 @@
 
 #define DEBUG_XWIN 0
 
+#if USE_COMPOSITE
+static Visual      *argb_visual = NULL;
+static Colormap     argb_cmap = None;
+#endif
+
 typedef struct
 {
    EventCallbackFunc  *func;
@@ -350,36 +355,99 @@
    return win;
 }
 
-/* Creates a window, but takes the visual, depth and the colormap from c_attr. 
*/
+#if USE_COMPOSITE
 Win
-ECreateVisualWindow(Win parent, int x, int y, int w, int h, int saveunder,
-                   XWindowAttributes * c_attr)
+ECreateArgbWindow(Win parent, int x, int y, int w, int h, Win cwin)
 {
    EXID               *win;
    Window              xwin;
    XSetWindowAttributes attr;
+   int                 depth;
+   Visual             *vis;
+   Colormap            cmap;
+
+   if (cwin && Conf.testing.argb_clients_inherit_attr)
+     {
+       depth = cwin->depth;
+       vis = cwin->visual;
+       cmap = cwin->cmap;
+     }
+   else
+     {
+       if (!argb_visual)
+         {
+            argb_visual = EVisualFindARGB();
+            argb_cmap =
+               XCreateColormap(disp, VRoot.xwin, argb_visual, AllocNone);
+         }
+       depth = 32;
+       vis = argb_visual;
+       cmap = argb_cmap;
+     }
 
+   attr.background_pixmap = None;
+   attr.border_pixel = 0;
    attr.backing_store = NotUseful;
+   attr.save_under = False;
    attr.override_redirect = False;
-   attr.border_pixel = 0;
-   attr.colormap = c_attr->colormap;
-/*   attr.background_pixel = 0; */
-   attr.background_pixmap = None;
-   if ((saveunder == 1) && (Conf.save_under))
-      attr.save_under = True;
-   else if (saveunder == 2)
-      attr.save_under = True;
-   else
-      attr.save_under = False;
+   attr.colormap = cmap;
 
    xwin = XCreateWindow(disp, parent->xwin, x, y, w, h, 0,
-                       c_attr->depth, InputOutput, c_attr->visual,
+                       depth, InputOutput, vis,
                        CWOverrideRedirect | CWSaveUnder | CWBackingStore |
                        CWColormap | CWBackPixmap | CWBorderPixel, &attr);
-   win = EXidSet(xwin, parent, x, y, w, h, c_attr->depth, c_attr->visual,
-                c_attr->colormap);
+   win = EXidSet(xwin, parent, x, y, w, h, depth, vis, cmap);
+
+   return win;
+}
+#endif
+
+Win
+ECreateObjectWindow(Win parent, int x, int y, int w, int h, int saveunder,
+                   int type, Win cwin, char *argb_ret)
+{
+   EXID               *win;
+   int                 argb = 0;
+
+#if USE_COMPOSITE
+   switch (type)
+     {
+     default:
+     case 0:                   /* Internal */
+       if (Conf.testing.argb_internal_objects)
+          argb = 1;
+       break;
+     case 1:                   /* Client window */
+       if (Conf.testing.argb_clients || EVisualIsARGB(cwin->visual))
+          argb = 1;
+       break;
+     }
+
+   if (argb)
+      win = ECreateArgbWindow(parent, x, y, w, h, cwin);
+   else
+      win = ECreateWindow(parent, x, y, w, h, saveunder);
+#else
+   win = ECreateWindow(parent, x, y, w, h, saveunder);
+   type = 0;
+   cwin = NULL;
+#endif
+
+   if (argb_ret)
+      *argb_ret = argb;
 
    return win;
+}
+
+Win
+ECreateClientWindow(Win parent, int x, int y, int w, int h)
+{
+#if USE_COMPOSITE
+   if (Conf.testing.argb_internal_clients)
+      return ECreateArgbWindow(parent, x, y, w, h, NULL);
+#endif
+
+   return ECreateWindow(parent, x, y, w, h, 0);
 }
 
 Win
===================================================================
RCS file: /cvs/e/e16/e/src/xwin.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- xwin.h      1 Jun 2006 20:18:40 -0000       1.22
+++ xwin.h      3 Jun 2006 14:11:34 -0000       1.23
@@ -70,9 +70,12 @@
 
 Win                 ECreateWindow(Win parent, int x, int y, int w, int h,
                                  int saveunder);
-Win                 ECreateVisualWindow(Win parent, int x, int y, int w,
-                                       int h, int saveunder,
-                                       XWindowAttributes * child_attr);
+Win                 ECreateArgbWindow(Win parent, int x, int y, int w, int h,
+                                     Win cwin);
+Win                 ECreateClientWindow(Win parent, int x, int y, int w, int 
h);
+Win                 ECreateObjectWindow(Win parent, int x, int y, int w,
+                                       int h, int saveunder, int type,
+                                       Win cwin, char *argb);
 Win                 ECreateEventWindow(Win parent, int x, int y, int w, int h);
 Win                 ECreateFocusWindow(Win parent, int x, int y, int w, int h);
 void                EWindowSync(Win win);




_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to