/* * MATE panel x stuff * * Copyright (C) 2000, 2001 Eazel, Inc. * 2002 Sun Microsystems Inc. * * Authors: George Lebl * Mark McLoughlin * * Contains code from the Window Maker window manager * * Copyright (c) 1997-2002 Alfredo K. Kojima */ #include #include #include #include #include #include "xstuff.h" /* Zoom animation */ #define MINIATURIZE_ANIMATION_FRAMES_Z 1 #define MINIATURIZE_ANIMATION_STEPS_Z 6 /* the delay per draw */ #define MINIATURIZE_ANIMATION_DELAY_Z 10 static void draw_zoom_animation (GdkScreen *gscreen, int x, int y, int w, int h, int fx, int fy, int fw, int fh, int steps) { #define FRAMES (MINIATURIZE_ANIMATION_FRAMES_Z) float cx[FRAMES], cy[FRAMES], cw[FRAMES], ch[FRAMES]; int cxi[FRAMES], cyi[FRAMES], cwi[FRAMES], chi[FRAMES]; float xstep, ystep, wstep, hstep; int i, j; GC frame_gc; XGCValues gcv; GdkColor color = { 65535, 65535, 65535 }; Display *dpy; Window root_win; int screen; int depth; dpy = gdk_x11_display_get_xdisplay (gdk_screen_get_display (gscreen)); root_win = GDK_WINDOW_XID (gdk_screen_get_root_window (gscreen)); screen = gdk_x11_screen_get_screen_number (gscreen); depth = DefaultDepth(dpy,screen); /* frame GC */ gcv.function = GXxor; /* this will raise the probability of the XORed color being different * of the original color in PseudoColor when not all color cells are * initialized */ if (DefaultVisual(dpy, screen)->class==PseudoColor) gcv.plane_mask = (1<<(depth-1))|1; else gcv.plane_mask = AllPlanes; gcv.foreground = color.pixel; if (gcv.foreground == 0) gcv.foreground = 1; gcv.line_width = 1; gcv.subwindow_mode = IncludeInferiors; gcv.graphics_exposures = False; frame_gc = XCreateGC(dpy, root_win, GCForeground|GCGraphicsExposures |GCFunction|GCSubwindowMode|GCLineWidth |GCPlaneMask, &gcv); xstep = (float)(fx-x)/steps; ystep = (float)(fy-y)/steps; wstep = (float)(fw-w)/steps; hstep = (float)(fh-h)/steps; for (j=0; j 0) usleep(MINIATURIZE_ANIMATION_DELAY_Z); #else usleep(10); #endif for (j=0; j 0) usleep(MINIATURIZE_ANIMATION_DELAY_Z); #else usleep(10); #endif for (j=0; j