Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h Makefile.am ecompmgr.c eobj.c eobj.h ewins.h mod-misc.c
Added Files:
magwin.c
Log Message:
Add magnifier window (eesh mag show).
===================================================================
RCS file: /cvs/e/e16/e/src/E.h,v
retrieving revision 1.580
retrieving revision 1.581
diff -u -3 -r1.580 -r1.581
--- E.h 23 Mar 2007 22:04:38 -0000 1.580
+++ E.h 7 Apr 2007 13:19:30 -0000 1.581
@@ -249,6 +249,7 @@
Colormap cmap;
int scr;
int w, h;
+ Pixmap pmap; /* Compositing buffer */
}
VirtRoot;
===================================================================
RCS file: /cvs/e/e16/e/src/Makefile.am,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -3 -r1.84 -r1.85
--- Makefile.am 29 Mar 2007 20:54:55 -0000 1.84
+++ Makefile.am 7 Apr 2007 13:19:30 -0000 1.85
@@ -1,6 +1,6 @@
SUBDIRS =
-EXTRA_DIST = gnome.c eglx.c eglx.h ecompmgr.c ecompmgr.h snprintf.c
+EXTRA_DIST = gnome.c eglx.c eglx.h ecompmgr.c ecompmgr.h magwin.c snprintf.c
bin_PROGRAMS = e16
@@ -11,7 +11,7 @@
SRCS_GLX = eglx.c eglx.h
endif
if HAVE_COMPOSITE
-SRCS_ECOMPMGR = ecompmgr.c ecompmgr.h
+SRCS_ECOMPMGR = ecompmgr.c ecompmgr.h magwin.c
endif
if USE_ESNPRINTF
SRCS_SNPRINTF = snprintf.c
===================================================================
RCS file: /cvs/e/e16/e/src/ecompmgr.c,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -3 -r1.141 -r1.142
--- ecompmgr.c 25 Mar 2007 08:34:34 -0000 1.141
+++ ecompmgr.c 7 Apr 2007 13:19:30 -0000 1.142
@@ -190,6 +190,7 @@
char active;
char use_pixmap;
char reorder;
+ char ghosts;
EObj *eo_first;
EObj *eo_last;
XserverRegion rgn_screen;
@@ -438,7 +439,8 @@
}
static Picture
-EPictureCreateBuffer(Window win, int w, int h, int depth, Visual * vis)
+EPictureCreateBuffer(Window win, int w, int h, int depth, Visual * vis,
+ Pixmap * ppmap)
{
Picture pict;
Pixmap pmap;
@@ -447,7 +449,10 @@
pmap = XCreatePixmap(disp, win, w, h, depth);
pictfmt = XRenderFindVisualFormat(disp, vis);
pict = XRenderCreatePicture(disp, pmap, pictfmt, 0, 0);
- XFreePixmap(disp, pmap);
+ if (ppmap)
+ *ppmap = pmap;
+ else
+ XFreePixmap(disp, pmap);
return pict;
}
@@ -490,7 +495,7 @@
/* Resizing - grab old contents */
pict = EPictureCreateBuffer(EobjGetXwin(eo), wo, ho, WinGetDepth(eo->win),
- WinGetVisual(eo->win));
+ WinGetVisual(eo->win), NULL);
XRenderComposite(disp, PictOpSrc, cw->picture, None, pict, 0, 0, 0, 0, 0, 0,
wo, ho);
@@ -1831,6 +1836,7 @@
/* Determine overall paint order, top to bottom */
stop = 0;
eo_first = eo_prev = NULL;
+ Mode_compmgr.ghosts = 0;
for (i = 0; i < num; i++)
{
@@ -1905,6 +1911,12 @@
if (cw->picture == None && !eo->noredir)
continue;
+ if (eo->ghost)
+ {
+ Mode_compmgr.ghosts = 1;
+ continue;
+ }
+
D3printf
("ECompMgrDetermineOrder hook in %d - %#lx desk=%d shown=%d\n",
dsk->num, EobjGetXwin(eo), eo->desk->num, eo->shown);
@@ -2100,6 +2112,36 @@
}
}
+static void
+ECompMgrPaintGhosts(Picture pict, XserverRegion damage)
+{
+ EObj *eo, *const *lst;
+ int i, num;
+
+ lst = EobjListStackGet(&num);
+ for (i = 0; i < num; i++)
+ {
+ eo = lst[i];
+ if (!eo->shown || !eo->ghost)
+ continue;
+
+ switch (eo->cmhook->mode)
+ {
+ case WINDOW_UNREDIR:
+ case WINDOW_SOLID:
+ ECompMgrRepaintObj(pict, Mode_compmgr.rgn_screen, eo, 0);
+ break;
+ case WINDOW_TRANS:
+ case WINDOW_ARGB:
+ ECompMgrRepaintObj(pict, Mode_compmgr.rgn_screen, eo, 1);
+ break;
+ }
+
+ /* Subtract window region from damage region */
+ ERegionSubtractOffset(damage, 0, 0, eo->cmhook->shape);
+ }
+}
+
void
ECompMgrRepaint(void)
{
@@ -2120,7 +2162,7 @@
if (!rootBuffer)
rootBuffer = EPictureCreateBuffer(VRoot.xwin, VRoot.w, VRoot.h,
- VRoot.depth, VRoot.vis);
+ VRoot.depth, VRoot.vis, &VRoot.pmap);
pbuf = rootBuffer;
if (!dsk)
@@ -2154,6 +2196,10 @@
for (eo = Mode_compmgr.eo_last; eo; eo = ((ECmWinInfo *)
(eo->cmhook))->prev)
ECompMgrRepaintObj(pbuf, allDamage, eo, 1);
+ /* Paint any ghost windows (adjusting damage region) */
+ if (Mode_compmgr.ghosts)
+ ECompMgrPaintGhosts(rootPicture, allDamage);
+
if (pbuf != rootPicture)
{
XFixesSetPictureClipRegion(dpy, pbuf, 0, 0, allDamage);
@@ -2172,30 +2218,31 @@
if (!allDamage /* || Conf_compmgr.mode == ECM_MODE_AUTO */ )
return;
ECompMgrRepaint();
-#if 0 /* FIXME - Was here - Why? */
- XSync(disp, False);
-#endif
}
static void
-ECompMgrRootConfigure(void *prm __UNUSED__, XEvent * ev)
+ECompMgrRootBufferDestroy(void)
{
- Display *dpy = disp;
+ /* Root buffer picture and pixmap */
+ if (rootBuffer != None)
+ XRenderFreePicture(disp, rootBuffer);
+ rootBuffer = None;
+ if (VRoot.pmap != None)
+ XFreePixmap(disp, VRoot.pmap);
+ VRoot.pmap = None;
+ /* Screen region */
+ if (Mode_compmgr.rgn_screen != None)
+ ERegionDestroy(Mode_compmgr.rgn_screen);
+ Mode_compmgr.rgn_screen = None;
+}
+
+static void
+ECompMgrRootConfigure(void *prm __UNUSED__, XEvent * ev)
+{
D1printf("ECompMgrRootConfigure root\n");
if (ev->xconfigure.window == VRoot.xwin)
- {
- if (rootBuffer != None)
- {
- XRenderFreePicture(dpy, rootBuffer);
- rootBuffer = None;
- }
-
- if (Mode_compmgr.rgn_screen != None)
- ERegionDestroy(Mode_compmgr.rgn_screen);
- Mode_compmgr.rgn_screen = None;
- }
- return;
+ ECompMgrRootBufferDestroy();
}
#if USE_DESK_EXPOSE /* FIXME - Remove? */
@@ -2396,9 +2443,7 @@
XRenderFreePicture(disp, rootPicture);
rootPicture = None;
- if (rootBuffer)
- XRenderFreePicture(disp, rootBuffer);
- rootBuffer = None;
+ ECompMgrRootBufferDestroy();
ECompMgrShadowsInit(ECM_SHADOWS_OFF, 0);
@@ -2423,10 +2468,6 @@
if (allDamage != None)
ERegionDestroy(allDamage);
allDamage = None;
-
- if (Mode_compmgr.rgn_screen != None)
- ERegionDestroy(Mode_compmgr.rgn_screen);
- Mode_compmgr.rgn_screen = None;
if (Conf_compmgr.mode == ECM_MODE_ROOT)
XCompositeUnredirectSubwindows(disp, VRoot.xwin,
CompositeRedirectManual);
===================================================================
RCS file: /cvs/e/e16/e/src/eobj.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -3 -r1.91 -r1.92
--- eobj.c 7 Feb 2007 01:51:18 -0000 1.91
+++ eobj.c 7 Apr 2007 13:19:30 -0000 1.92
@@ -115,6 +115,8 @@
eo->ilayer |= 512;
else
eo->ilayer &= ~512;
+ if (eo->ghost)
+ eo->ilayer |= 1024;
if (eo->ilayer != ilayer)
EobjRaise(eo);
===================================================================
RCS file: /cvs/e/e16/e/src/eobj.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- eobj.h 19 Mar 2007 05:37:57 -0000 1.41
+++ eobj.h 7 Apr 2007 13:19:30 -0000 1.42
@@ -47,6 +47,7 @@
unsigned noredir:1; /* Do not redirect */
unsigned shadow:1; /* Enable shadows */
unsigned fade:1; /* Enable fading */
+ unsigned ghost:1; /* Ghost window */
struct
{
char *wm_name;
===================================================================
RCS file: /cvs/e/e16/e/src/ewins.h,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -3 -r1.70 -r1.71
--- ewins.h 6 Apr 2007 21:44:22 -0000 1.70
+++ ewins.h 7 Apr 2007 13:19:30 -0000 1.71
@@ -285,6 +285,7 @@
#define EWIN_TYPE_MENU 0x02
#define EWIN_TYPE_ICONBOX 0x04
#define EWIN_TYPE_PAGER 0x08
+#define EWIN_TYPE_MISC 0x10
#define EWIN_GRAVITY_NW 0
#define EWIN_GRAVITY_NE 1
===================================================================
RCS file: /cvs/e/e16/e/src/mod-misc.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -3 -r1.51 -r1.52
--- mod-misc.c 28 Jan 2007 04:59:45 -0000 1.51
+++ mod-misc.c 7 Apr 2007 13:19:30 -0000 1.52
@@ -37,6 +37,7 @@
#if USE_COMPOSITE
extern const EModule ModCompMgr;
+extern const EModule ModMagwin;
#endif
extern const EModule ModCursors;
extern const EModule ModDesktops;
@@ -68,6 +69,7 @@
&ModButtons,
#if USE_COMPOSITE
&ModCompMgr,
+ &ModMagwin,
#endif
&ModCursors,
&ModDesktops,
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs