comparison src/redisplay-x.c @ 217:d44af0c54775 r20-4b7

Import from CVS: tag r20-4b7
author cvs
date Mon, 13 Aug 2007 10:08:34 +0200
parents 1f0dabaa0855
children 262b8bb4a523
comparison
equal deleted inserted replaced
216:43306a74e31c 217:d44af0c54775
2196 2196
2197 static int 2197 static int
2198 x_flash (struct device *d) 2198 x_flash (struct device *d)
2199 { 2199 {
2200 Display *dpy; 2200 Display *dpy;
2201 Window w; 2201 Window win;
2202 XGCValues gcv; 2202 XGCValues gcv;
2203 GC gc; 2203 GC gc;
2204 XColor tmp_fcolor, tmp_bcolor; 2204 XColor tmp_fcolor, tmp_bcolor;
2205 Lisp_Object tmp_pixel, frame; 2205 Lisp_Object tmp_pixel, frame;
2206 struct frame *f = device_selected_frame (d); 2206 struct frame *f = device_selected_frame (d);
2207 struct window *w = XWINDOW (FRAME_ROOT_WINDOW (f));
2207 Widget shell = FRAME_X_SHELL_WIDGET (f); 2208 Widget shell = FRAME_X_SHELL_WIDGET (f);
2208 Dimension width, height;
2209 Arg al [2];
2210
2211 XtSetArg (al [0], XtNwidth, &width);
2212 XtSetArg (al [1], XtNheight, &height);
2213 XtGetValues (shell, al, 2);
2214 2209
2215 XSETFRAME (frame, f); 2210 XSETFRAME (frame, f);
2216 2211
2217 tmp_pixel = FACE_FOREGROUND (Vdefault_face, frame); 2212 tmp_pixel = FACE_FOREGROUND (Vdefault_face, frame);
2218 tmp_fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); 2213 tmp_fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
2219 tmp_pixel = FACE_BACKGROUND (Vdefault_face, frame); 2214 tmp_pixel = FACE_BACKGROUND (Vdefault_face, frame);
2220 tmp_bcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); 2215 tmp_bcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
2221 2216
2222 dpy = XtDisplay (shell); 2217 dpy = XtDisplay (shell);
2223 w = XtWindow (FRAME_X_TEXT_WIDGET (f)); 2218 win = XtWindow (FRAME_X_TEXT_WIDGET (f));
2224 memset (&gcv, ~0, sizeof (XGCValues)); /* initialize all slots to ~0 */ 2219 memset (&gcv, ~0, sizeof (XGCValues)); /* initialize all slots to ~0 */
2225 gcv.foreground = (tmp_fcolor.pixel ^ tmp_bcolor.pixel); 2220 gcv.foreground = (tmp_fcolor.pixel ^ tmp_bcolor.pixel);
2226 gcv.function = GXxor; 2221 gcv.function = GXxor;
2227 gcv.graphics_exposures = False; 2222 gcv.graphics_exposures = False;
2228 gc = gc_cache_lookup (DEVICE_X_GC_CACHE (XDEVICE (f->device)), &gcv, 2223 gc = gc_cache_lookup (DEVICE_X_GC_CACHE (XDEVICE (f->device)), &gcv,
2229 (GCForeground | GCFunction | GCGraphicsExposures)); 2224 (GCForeground | GCFunction | GCGraphicsExposures));
2230 XFillRectangle (dpy, w, gc, 0, 0, width, height); 2225 XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
2226 w->pixel_width, w->pixel_height);
2231 XSync (dpy, False); 2227 XSync (dpy, False);
2232 2228
2233 #ifdef HAVE_SELECT 2229 #ifdef HAVE_SELECT
2234 { 2230 {
2235 int usecs = 100000; 2231 int usecs = 100000;
2245 #else /* !HAVE_POLL */ 2241 #else /* !HAVE_POLL */
2246 bite me 2242 bite me
2247 #endif /* HAVE_POLL */ 2243 #endif /* HAVE_POLL */
2248 #endif /* HAVE_SELECT */ 2244 #endif /* HAVE_SELECT */
2249 2245
2250 XFillRectangle (dpy, w, gc, 0, 0, width, height); 2246 XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
2247 w->pixel_width, w->pixel_height);
2251 XSync (dpy, False); 2248 XSync (dpy, False);
2252 2249
2253 return 1; 2250 return 1;
2254 } 2251 }
2255 2252