Mercurial > hg > xemacs-beta
comparison src/redisplay-output.c @ 4207:62d532188a28
[xemacs-hg @ 2007-10-03 10:06:39 by didierv]
Fix some other DEFAULT_INDEX == 0 assumptions
author | didierv |
---|---|
date | Wed, 03 Oct 2007 10:06:42 +0000 |
parents | 26dccfc8fa60 |
children | 91b3d00e717f |
comparison
equal
deleted
inserted
replaced
4206:a3e638b941b0 | 4207:62d532188a28 |
---|---|
112 { | 112 { |
113 struct display_line dl, *clp, *dlp; | 113 struct display_line dl, *clp, *dlp; |
114 int db_elt; | 114 int db_elt; |
115 int local = 0; | 115 int local = 0; |
116 | 116 |
117 /* #### NOTE: practically, this is not needed because of the memcpy below. | |
118 #### However, it's cleaner and bugs-in-the-future proof. -- dvl */ | |
119 DISPLAY_LINE_INIT (dl); | |
117 dlp = Dynarr_atp (ddla, line); | 120 dlp = Dynarr_atp (ddla, line); |
118 if (line >= Dynarr_largest (cdla)) | 121 if (line >= Dynarr_largest (cdla)) |
119 { | 122 { |
120 clp = &dl; | 123 clp = &dl; |
121 clp->display_blocks = Dynarr_new (display_block); | 124 clp->display_blocks = Dynarr_new (display_block); |
1516 cdga.height = glyph_height (child, image_instance); | 1519 cdga.height = glyph_height (child, image_instance); |
1517 | 1520 |
1518 IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) = | 1521 IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) = |
1519 IMAGE_INSTANCE_OPTIMIZE_OUTPUT (p); | 1522 IMAGE_INSTANCE_OPTIMIZE_OUTPUT (p); |
1520 | 1523 |
1521 /* Although normalization is done by the output routines | 1524 /* Although normalization is done by the output routines we have to |
1522 we have to do it here so that they don't try and | 1525 do it here so that they don't try and clear all of db. This is |
1523 clear all of db. This is true below also. */ | 1526 true below also. */ |
1524 if (redisplay_normalize_glyph_area (&cdb, &cdga)) | 1527 if (redisplay_normalize_glyph_area (&cdb, &cdga)) |
1525 { | 1528 { |
1526 redisplay_normalize_display_box (&cdb, &cdga); | 1529 redisplay_normalize_display_box (&cdb, &cdga); |
1527 /* Since the display boxes will now be totally in the | 1530 /* Since the display boxes will now be totally in the window if |
1528 window if they are visible at all we can now check this easily. */ | 1531 they are visible at all we can now check this easily. */ |
1529 if (cdb.xpos < db->xpos || cdb.ypos < db->ypos | 1532 if (cdb.xpos < db->xpos || cdb.ypos < db->ypos |
1530 || cdb.xpos + cdb.width > db->xpos + db->width | 1533 || cdb.xpos + cdb.width > db->xpos + db->width |
1531 || cdb.ypos + cdb.height > db->ypos + db->height) | 1534 || cdb.ypos + cdb.height > db->ypos + db->height) |
1532 continue; | 1535 continue; |
1533 /* We have to invert the offset here as normalization | 1536 /* We have to invert the offset here as normalization will have |
1534 will have made them positive which the output | 1537 made them positive which the output routines will treat as a |
1535 routines will treat as a truly +ve offset. */ | 1538 truly +ve offset. */ |
1536 cdga.xoffset = -cdga.xoffset; | 1539 cdga.xoffset = -cdga.xoffset; |
1537 cdga.yoffset = -cdga.yoffset; | 1540 cdga.yoffset = -cdga.yoffset; |
1538 | 1541 |
1539 switch (IMAGE_INSTANCE_TYPE (childii)) | 1542 switch (IMAGE_INSTANCE_TYPE (childii)) |
1540 { | 1543 { |
1549 { | 1552 { |
1550 struct display_line dl; /* this is fake */ | 1553 struct display_line dl; /* this is fake */ |
1551 Lisp_Object string = | 1554 Lisp_Object string = |
1552 IMAGE_INSTANCE_TEXT_STRING (childii); | 1555 IMAGE_INSTANCE_TEXT_STRING (childii); |
1553 unsigned char charsets[NUM_LEADING_BYTES]; | 1556 unsigned char charsets[NUM_LEADING_BYTES]; |
1554 struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, findex); | 1557 struct face_cachel *cachel |
1558 = WINDOW_FACE_CACHEL (w, findex); | |
1559 | |
1560 DISPLAY_LINE_INIT (dl); | |
1555 | 1561 |
1556 find_charsets_in_ibyte_string (charsets, | 1562 find_charsets_in_ibyte_string (charsets, |
1557 XSTRING_DATA (string), | 1563 XSTRING_DATA (string), |
1558 XSTRING_LENGTH (string)); | 1564 XSTRING_LENGTH (string)); |
1559 ensure_face_cachel_complete (cachel, window, charsets); | 1565 ensure_face_cachel_complete (cachel, window, charsets); |
1560 | 1566 |
1561 convert_ibyte_string_into_ichar_dynarr | 1567 convert_ibyte_string_into_ichar_dynarr |
1562 (XSTRING_DATA (string), XSTRING_LENGTH (string), buf); | 1568 (XSTRING_DATA (string), XSTRING_LENGTH (string), |
1569 buf); | |
1563 | 1570 |
1564 redisplay_normalize_display_box (&cdb, &cdga); | 1571 redisplay_normalize_display_box (&cdb, &cdga); |
1565 /* Offsets are now +ve again so be careful | 1572 /* Offsets are now +ve again so be careful |
1566 when fixing up the display line. */ | 1573 when fixing up the display line. */ |
1567 xzero (dl); | |
1568 /* Munge boxes into display lines. */ | 1574 /* Munge boxes into display lines. */ |
1569 dl.ypos = (cdb.ypos - cdga.yoffset) | 1575 dl.ypos = (cdb.ypos - cdga.yoffset) |
1570 + glyph_ascent (child, image_instance); | 1576 + glyph_ascent (child, image_instance); |
1571 dl.ascent = glyph_ascent (child, image_instance); | 1577 dl.ascent = glyph_ascent (child, image_instance); |
1572 dl.descent = glyph_descent (child, image_instance); | 1578 dl.descent = glyph_descent (child, image_instance); |
1573 dl.top_clip = cdga.yoffset; | 1579 dl.top_clip = cdga.yoffset; |
1574 dl.clip = (dl.ypos + dl.descent) - (cdb.ypos + cdb.height); | 1580 dl.clip = (dl.ypos + dl.descent) |
1581 - (cdb.ypos + cdb.height); | |
1575 /* output_string doesn't understand offsets in | 1582 /* output_string doesn't understand offsets in |
1576 the same way as other routines - we have to | 1583 the same way as other routines - we have to |
1577 add the offset to the width so that we | 1584 add the offset to the width so that we |
1578 output the full string. */ | 1585 output the full string. */ |
1579 MAYBE_DEVMETH (d, output_string, (w, &dl, buf, cdb.xpos, | 1586 MAYBE_DEVMETH (d, output_string, |
1580 cdga.xoffset, cdb.xpos, | 1587 (w, &dl, buf, cdb.xpos, |
1581 cdga.width + cdga.xoffset, | 1588 cdga.xoffset, cdb.xpos, |
1582 findex, 0, 0, 0, 0)); | 1589 cdga.width + cdga.xoffset, |
1590 findex, 0, 0, 0, 0)); | |
1583 Dynarr_reset (buf); | 1591 Dynarr_reset (buf); |
1584 } | 1592 } |
1585 } | 1593 } |
1586 break; | 1594 break; |
1587 | 1595 |