1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

Remove DEMATERIALIZE_ICON code

This animation is not as cool as the NORMAL_ICON_KABOON, so I don't
think having a choice here is justified. Let's remove this option
(it was not defined in wconfig.h.in by default) and keep using
the nicer NORMAL_ICON_KABOON.
This commit is contained in:
Carlos R. Mafra
2009-10-17 01:56:28 +02:00
parent f9792a042a
commit 4932433b95
3 changed files with 1 additions and 102 deletions

View File

@@ -45,78 +45,6 @@
extern WPreferences wPreferences;
#ifdef DEMATERIALIZE_ICON
void DoKaboom(WScreen * scr, Window win, int x, int y)
{
RImage *icon;
RImage *back;
RImage *image;
Pixmap pixmap;
XImage *ximage;
GC gc;
XGCValues gcv;
int i;
int w, h;
int run;
XEvent event;
h = w = wPreferences.icon_size;
if (x < 0 || x + w > scr->scr_width || y < 0 || y + h > scr->scr_height)
return;
icon = RCreateImageFromDrawable(scr->rcontext, win, None);
if (!icon)
return;
gcv.foreground = scr->white_pixel;
gcv.background = scr->black_pixel;
gcv.graphics_exposures = False;
gcv.subwindow_mode = IncludeInferiors;
gc = XCreateGC(dpy, scr->w_win, GCForeground | GCBackground | GCSubwindowMode | GCGraphicsExposures, &gcv);
XGrabServer(dpy);
RConvertImage(scr->rcontext, icon, &pixmap);
XUnmapWindow(dpy, win);
ximage = XGetImage(dpy, scr->root_win, x, y, w, h, AllPlanes, ZPixmap);
XCopyArea(dpy, pixmap, scr->root_win, gc, 0, 0, w, h, x, y);
XFreePixmap(dpy, pixmap);
back = RCreateImageFromXImage(scr->rcontext, ximage, NULL);
XDestroyImage(ximage);
if (!back) {
RReleaseImage(icon);
return;
}
for (i = 0, run = 0; i < DEMATERIALIZE_STEPS; i++) {
XEvent foo;
if (!run && XCheckTypedEvent(dpy, ButtonPress, &foo)) {
run = 1;
XPutBackEvent(dpy, &foo);
}
image = RCloneImage(back);
RCombineImagesWithOpaqueness(image, icon,
(DEMATERIALIZE_STEPS - 1 - i) * 256 / (DEMATERIALIZE_STEPS + 2));
RConvertImage(scr->rcontext, image, &pixmap);
XCopyArea(dpy, pixmap, scr->root_win, gc, 0, 0, w, h, x, y);
XFreePixmap(dpy, pixmap);
XFlush(dpy);
if (!run)
wusleep(1000);
}
while (XCheckTypedEvent(dpy, MotionNotify, &event)) {
}
XFlush(dpy);
XUngrabServer(dpy);
XFreeGC(dpy, gc);
RReleaseImage(icon);
RReleaseImage(back);
}
#endif /* DEMATERIALIZE_ICON */
#ifdef NORMAL_ICON_KABOOM
void DoKaboom(WScreen * scr, Window win, int x, int y)
{