Mercurial > hg > xemacs-beta
comparison src/redisplay-output.c @ 422:95016f13131a r21-2-19
Import from CVS: tag r21-2-19
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:25:01 +0200 |
parents | 697ef44129c6 |
children | 11054d720c21 |
comparison
equal
deleted
inserted
replaced
421:fff06e11db74 | 422:95016f13131a |
---|---|
590 cdl->ascent != ddl->ascent || | 590 cdl->ascent != ddl->ascent || |
591 cdl->descent != ddl->descent || | 591 cdl->descent != ddl->descent || |
592 cdl->clip != ddl->clip))) | 592 cdl->clip != ddl->clip))) |
593 { | 593 { |
594 int x, y, width, height; | 594 int x, y, width, height; |
595 Lisp_Object face; | 595 face_index findex; |
596 | 596 |
597 must_sync = 1; | 597 must_sync = 1; |
598 x = start_pixpos; | 598 x = start_pixpos; |
599 y = ddl->ypos - ddl->ascent; | 599 y = ddl->ypos - ddl->ascent; |
600 width = min (next_start_pixpos, block_end) - x; | 600 width = min (next_start_pixpos, block_end) - x; |
601 height = ddl->ascent + ddl->descent - ddl->clip; | 601 height = ddl->ascent + ddl->descent - ddl->clip; |
602 | 602 |
603 if (x < ddl->bounds.left_in) | 603 if (x < ddl->bounds.left_in) |
604 face = Vleft_margin_face; | 604 { |
605 findex = ddl->left_margin_findex ? | |
606 ddl->left_margin_findex | |
607 : get_builtin_face_cache_index (w, Vleft_margin_face); | |
608 } | |
605 else if (x < ddl->bounds.right_in) | 609 else if (x < ddl->bounds.right_in) |
606 face = Vdefault_face; | 610 { |
611 /* no check here because DEFAULT_INDEX == 0 anyway */ | |
612 findex = ddl->default_findex; | |
613 } | |
607 else if (x < ddl->bounds.right_out) | 614 else if (x < ddl->bounds.right_out) |
608 face = Vright_margin_face; | 615 { |
616 findex = ddl->right_margin_findex ? | |
617 ddl->right_margin_findex | |
618 : get_builtin_face_cache_index (w, Vright_margin_face); | |
619 } | |
609 else | 620 else |
610 face = Qnil; | 621 findex = (face_index) -1; |
611 | 622 |
612 if (!NILP (face)) | 623 if (findex != (face_index) -1) |
613 { | 624 { |
614 Lisp_Object window; | 625 Lisp_Object window; |
615 | 626 |
616 XSETWINDOW (window, w); | 627 XSETWINDOW (window, w); |
617 | 628 |
618 /* Clear the empty area. */ | 629 /* Clear the empty area. */ |
619 redisplay_clear_region (window, get_builtin_face_cache_index (w, face), | 630 redisplay_clear_region (window, findex, x, y, width, height); |
620 x, y, width, height); | |
621 | 631 |
622 /* Mark that we should clear the border. This is | 632 /* Mark that we should clear the border. This is |
623 necessary because italic fonts may leave | 633 necessary because italic fonts may leave |
624 droppings in the border. */ | 634 droppings in the border. */ |
625 clear_border = 1; | 635 clear_border = 1; |
1251 redisplay_clear_region (window, DEFAULT_INDEX, x, y, width, height); | 1261 redisplay_clear_region (window, DEFAULT_INDEX, x, y, width, height); |
1252 } | 1262 } |
1253 } | 1263 } |
1254 | 1264 |
1255 /***************************************************************************** | 1265 /***************************************************************************** |
1266 redisplay_clear_to_window_end | |
1267 | |
1268 Clear the area between ypos1 and ypos2. Each margin area and the | |
1269 text area is handled separately since they may each have their own | |
1270 background color. | |
1271 ****************************************************************************/ | |
1272 void | |
1273 redisplay_clear_to_window_end (struct window *w, int ypos1, int ypos2) | |
1274 { | |
1275 struct frame *f = XFRAME (w->frame); | |
1276 struct device *d = XDEVICE (f->device); | |
1277 | |
1278 if (HAS_DEVMETH_P (d, clear_to_window_end)) | |
1279 DEVMETH (d, clear_to_window_end, (w, ypos1, ypos2)); | |
1280 else | |
1281 { | |
1282 int height = ypos2 - ypos1; | |
1283 | |
1284 if (height) | |
1285 { | |
1286 struct frame *f = XFRAME (w->frame); | |
1287 Lisp_Object window; | |
1288 int bflag = 0 ; /* (window_needs_vertical_divider (w) ? 0 : 1);*/ | |
1289 layout_bounds bounds; | |
1290 | |
1291 bounds = calculate_display_line_boundaries (w, bflag); | |
1292 XSETWINDOW (window, w); | |
1293 | |
1294 if (window_is_leftmost (w)) | |
1295 redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f), | |
1296 ypos1, FRAME_BORDER_WIDTH (f), height); | |
1297 | |
1298 if (bounds.left_in - bounds.left_out > 0) | |
1299 redisplay_clear_region (window, | |
1300 get_builtin_face_cache_index (w, Vleft_margin_face), | |
1301 bounds.left_out, ypos1, | |
1302 bounds.left_in - bounds.left_out, height); | |
1303 | |
1304 if (bounds.right_in - bounds.left_in > 0) | |
1305 redisplay_clear_region (window, | |
1306 DEFAULT_INDEX, | |
1307 bounds.left_in, ypos1, | |
1308 bounds.right_in - bounds.left_in, height); | |
1309 | |
1310 if (bounds.right_out - bounds.right_in > 0) | |
1311 redisplay_clear_region (window, | |
1312 get_builtin_face_cache_index (w, Vright_margin_face), | |
1313 bounds.right_in, ypos1, | |
1314 bounds.right_out - bounds.right_in, height); | |
1315 | |
1316 if (window_is_rightmost (w)) | |
1317 redisplay_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f), | |
1318 ypos1, FRAME_BORDER_WIDTH (f), height); | |
1319 } | |
1320 } | |
1321 } | |
1322 | |
1323 /***************************************************************************** | |
1256 redisplay_clear_bottom_of_window | 1324 redisplay_clear_bottom_of_window |
1257 | 1325 |
1258 Clear window from right below the last display line to right above | 1326 Clear window from right below the last display line to right above |
1259 the modeline. The calling function can limit the area actually | 1327 the modeline. The calling function can limit the area actually |
1260 erased by setting min_start and/or max_end to positive values. | 1328 erased by setting min_start and/or max_end to positive values. |
1306 ypos2 = max_end; | 1374 ypos2 = max_end; |
1307 | 1375 |
1308 if (ypos2 <= ypos1) | 1376 if (ypos2 <= ypos1) |
1309 return; | 1377 return; |
1310 | 1378 |
1311 DEVMETH (d, clear_to_window_end, (w, ypos1, ypos2)); | 1379 redisplay_clear_to_window_end (w, ypos1, ypos2); |
1312 } | 1380 } |
1313 | 1381 |
1314 /***************************************************************************** | 1382 /***************************************************************************** |
1315 redisplay_update_line | 1383 redisplay_update_line |
1316 | 1384 |
1601 | 1669 |
1602 #ifdef HAVE_SCROLLBARS | 1670 #ifdef HAVE_SCROLLBARS |
1603 update_window_scrollbars (w, NULL, !MINI_WINDOW_P (w), 0); | 1671 update_window_scrollbars (w, NULL, !MINI_WINDOW_P (w), 0); |
1604 #endif | 1672 #endif |
1605 } | 1673 } |
1674 | |
1675 /***************************************************************************** | |
1676 bevel_modeline | |
1677 | |
1678 Draw a 3d border around the modeline on window W. | |
1679 ****************************************************************************/ | |
1680 void | |
1681 bevel_modeline (struct window *w, struct display_line *dl) | |
1682 { | |
1683 struct frame *f = XFRAME (w->frame); | |
1684 struct device *d = XDEVICE (f->device); | |
1685 int x, y, width, height; | |
1686 int shadow_thickness = MODELINE_SHADOW_THICKNESS (w); | |
1687 | |
1688 x = WINDOW_MODELINE_LEFT (w); | |
1689 width = WINDOW_MODELINE_RIGHT (w) - x; | |
1690 y = dl->ypos - dl->ascent - shadow_thickness; | |
1691 height = dl->ascent + dl->descent + 2 * shadow_thickness; | |
1692 | |
1693 if (XINT (w->modeline_shadow_thickness) < 0) | |
1694 shadow_thickness = - shadow_thickness; | |
1695 | |
1696 MAYBE_DEVMETH (d, bevel_area, | |
1697 (w, MODELINE_INDEX, x, y, width, height, shadow_thickness)); | |
1698 } |