comparison src/redisplay-x.c @ 440:8de8e3f6228a r21-2-28

Import from CVS: tag r21-2-28
author cvs
date Mon, 13 Aug 2007 11:33:38 +0200
parents 3ecd8885ac67
children abe6d1db359e
comparison
equal deleted inserted replaced
439:357dd071b03c 440:8de8e3f6228a
217 217
218 static int 218 static int
219 x_text_width_single_run (struct face_cachel *cachel, struct textual_run *run) 219 x_text_width_single_run (struct face_cachel *cachel, struct textual_run *run)
220 { 220 {
221 Lisp_Object font_inst = FACE_CACHEL_FONT (cachel, run->charset); 221 Lisp_Object font_inst = FACE_CACHEL_FONT (cachel, run->charset);
222 struct Lisp_Font_Instance *fi = XFONT_INSTANCE (font_inst); 222 Lisp_Font_Instance *fi = XFONT_INSTANCE (font_inst);
223 if (!fi->proportional_p) 223 if (!fi->proportional_p)
224 return fi->width * run->len; 224 return fi->width * run->len;
225 else 225 else
226 { 226 {
227 if (run->dimension == 2) 227 if (run->dimension == 2)
398 elt++; 398 elt++;
399 } 399 }
400 else if (rb->object.chr.ch == '\n') 400 else if (rb->object.chr.ch == '\n')
401 { 401 {
402 /* Clear in case a cursor was formerly here. */ 402 /* Clear in case a cursor was formerly here. */
403 redisplay_clear_region (window, findex, xpos, 403 redisplay_clear_region (window, findex, xpos,
404 DISPLAY_LINE_YPOS (dl), 404 DISPLAY_LINE_YPOS (dl),
405 rb->width, 405 rb->width,
406 DISPLAY_LINE_HEIGHT (dl)); 406 DISPLAY_LINE_HEIGHT (dl));
407 elt++; 407 elt++;
408 } 408 }
409 } 409 }
410 else if (rb->type == RUNE_BLANK || rb->type == RUNE_HLINE) 410 else if (rb->type == RUNE_BLANK || rb->type == RUNE_HLINE)
878 height); 878 height);
879 879
880 for (i = 0; i < nruns; i++) 880 for (i = 0; i < nruns; i++)
881 { 881 {
882 Lisp_Object font = FACE_CACHEL_FONT (cachel, runs[i].charset); 882 Lisp_Object font = FACE_CACHEL_FONT (cachel, runs[i].charset);
883 struct Lisp_Font_Instance *fi = XFONT_INSTANCE (font); 883 Lisp_Font_Instance *fi = XFONT_INSTANCE (font);
884 int this_width; 884 int this_width;
885 int need_clipping; 885 int need_clipping;
886 886
887 if (EQ (font, Vthe_null_font_instance)) 887 if (EQ (font, Vthe_null_font_instance))
888 continue; 888 continue;
1164 } 1164 }
1165 } 1165 }
1166 } 1166 }
1167 1167
1168 void 1168 void
1169 x_output_x_pixmap (struct frame *f, struct Lisp_Image_Instance *p, int x, 1169 x_output_x_pixmap (struct frame *f, Lisp_Image_Instance *p, int x,
1170 int y, int xoffset, int yoffset, 1170 int y, int xoffset, int yoffset,
1171 int width, int height, unsigned long fg, unsigned long bg, 1171 int width, int height, unsigned long fg, unsigned long bg,
1172 GC override_gc) 1172 GC override_gc)
1173 { 1173 {
1174 struct device *d = XDEVICE (f->device); 1174 struct device *d = XDEVICE (f->device);
1175 Display *dpy = DEVICE_X_DISPLAY (d); 1175 Display *dpy = DEVICE_X_DISPLAY (d);
1176 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); 1176 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
1217 XCopyPlane (1 = current foreground color, 0 = background) instead 1217 XCopyPlane (1 = current foreground color, 0 = background) instead
1218 of XCopyArea, which means that the bits in the pixmap are actual 1218 of XCopyArea, which means that the bits in the pixmap are actual
1219 pixel values, instead of symbolic of fg/bg. */ 1219 pixel values, instead of symbolic of fg/bg. */
1220 if (IMAGE_INSTANCE_PIXMAP_DEPTH (p) > 0) 1220 if (IMAGE_INSTANCE_PIXMAP_DEPTH (p) > 0)
1221 { 1221 {
1222 XCopyArea (dpy, 1222 XCopyArea (dpy,
1223 IMAGE_INSTANCE_X_PIXMAP_SLICE 1223 IMAGE_INSTANCE_X_PIXMAP_SLICE
1224 (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc, xoffset, 1224 (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc, xoffset,
1225 yoffset, width, 1225 yoffset, width,
1226 height, x, y); 1226 height, x, y);
1227 } 1227 }
1228 else 1228 else
1229 { 1229 {
1230 XCopyPlane (dpy, IMAGE_INSTANCE_X_PIXMAP_SLICE 1230 XCopyPlane (dpy, IMAGE_INSTANCE_X_PIXMAP_SLICE
1231 (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc, 1231 (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc,
1232 xoffset, yoffset, width, height, x, y, 1L); 1232 xoffset, yoffset, width, height, x, y, 1L);
1233 } 1233 }
1234 } 1234 }
1235 1235
1239 face_index findex, int cursor_start, int cursor_width, 1239 face_index findex, int cursor_start, int cursor_width,
1240 int cursor_height, int bg_pixmap) 1240 int cursor_height, int bg_pixmap)
1241 { 1241 {
1242 struct frame *f = XFRAME (w->frame); 1242 struct frame *f = XFRAME (w->frame);
1243 struct device *d = XDEVICE (f->device); 1243 struct device *d = XDEVICE (f->device);
1244 struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance); 1244 Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
1245 1245
1246 Display *dpy = DEVICE_X_DISPLAY (d); 1246 Display *dpy = DEVICE_X_DISPLAY (d);
1247 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); 1247 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
1248 1248
1249 /* Output the pixmap. */ 1249 /* Output the pixmap. */
1250 { 1250 {
1251 Lisp_Object tmp_pixel; 1251 Lisp_Object tmp_pixel;
1252 XColor tmp_bcolor, tmp_fcolor; 1252 XColor tmp_bcolor, tmp_fcolor;
1253 1253
1428 && (cursor_start + cursor_width > x) 1428 && (cursor_start + cursor_width > x)
1429 && cursor_start < (x + width)))) 1429 && cursor_start < (x + width))))
1430 { 1430 {
1431 int cursor_height, cursor_y; 1431 int cursor_height, cursor_y;
1432 int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d)); 1432 int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
1433 struct Lisp_Font_Instance *fi; 1433 Lisp_Font_Instance *fi;
1434 1434
1435 fi = XFONT_INSTANCE (FACE_CACHEL_FONT 1435 fi = XFONT_INSTANCE (FACE_CACHEL_FONT
1436 (WINDOW_FACE_CACHEL (w, rb->findex), 1436 (WINDOW_FACE_CACHEL (w, rb->findex),
1437 Vcharset_ascii)); 1437 Vcharset_ascii));
1438 1438
1918 { 1918 {
1919 x_clear_frame_windows (w->hchild); 1919 x_clear_frame_windows (w->hchild);
1920 return; 1920 return;
1921 } 1921 }
1922 1922
1923 redisplay_clear_to_window_end (w, WINDOW_TEXT_TOP (w), 1923 redisplay_clear_to_window_end (w, WINDOW_TEXT_TOP (w),
1924 WINDOW_TEXT_BOTTOM (w)); 1924 WINDOW_TEXT_BOTTOM (w));
1925 } 1925 }
1926 1926
1927 static void 1927 static void
1928 x_clear_frame_windows (Lisp_Object window) 1928 x_clear_frame_windows (Lisp_Object window)