comparison src/dispnew.c @ 83112:30dd490f06f2

Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-230 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-231 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-232 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-233 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-234 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-235 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-236 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-237 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-238 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-239 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-240 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-152
author Karoly Lorentey <lorentey@elte.hu>
date Fri, 23 Apr 2004 14:44:11 +0000
parents 4970ad4995f5 78fbab658433
children 3708519cf113
comparison
equal deleted inserted replaced
83111:fd147ed0d1b8 83112:30dd490f06f2
5738 struct it it; 5738 struct it it;
5739 struct buffer *old_current_buffer = current_buffer; 5739 struct buffer *old_current_buffer = current_buffer;
5740 struct text_pos startp; 5740 struct text_pos startp;
5741 Lisp_Object string; 5741 Lisp_Object string;
5742 struct glyph_row *row; 5742 struct glyph_row *row;
5743 #ifdef HAVE_WINDOW_SYSTEM
5744 struct image *img = 0;
5745 #endif
5743 int x0, x1; 5746 int x0, x1;
5744 5747
5745 current_buffer = XBUFFER (w->buffer); 5748 current_buffer = XBUFFER (w->buffer);
5746 SET_TEXT_POS_FROM_MARKER (startp, w->start); 5749 SET_TEXT_POS_FROM_MARKER (startp, w->start);
5747 CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); 5750 CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp)));
5763 *pos = it.current; 5766 *pos = it.current;
5764 5767
5765 #ifdef HAVE_WINDOW_SYSTEM 5768 #ifdef HAVE_WINDOW_SYSTEM
5766 if (it.what == IT_IMAGE) 5769 if (it.what == IT_IMAGE)
5767 { 5770 {
5768 struct image *img;
5769 if ((img = IMAGE_FROM_ID (it.f, it.image_id)) != NULL 5771 if ((img = IMAGE_FROM_ID (it.f, it.image_id)) != NULL
5770 && !NILP (img->spec)) 5772 && !NILP (img->spec))
5771 *object = img->spec; 5773 *object = img->spec;
5772 } 5774 }
5773 #endif 5775 #endif
5776 if (row->enabled_p) 5778 if (row->enabled_p)
5777 { 5779 {
5778 if (it.hpos < row->used[TEXT_AREA]) 5780 if (it.hpos < row->used[TEXT_AREA])
5779 { 5781 {
5780 struct glyph *glyph = row->glyphs[TEXT_AREA] + it.hpos; 5782 struct glyph *glyph = row->glyphs[TEXT_AREA] + it.hpos;
5781 *width = glyph->pixel_width;
5782 *height = glyph->ascent + glyph->descent;
5783 #ifdef HAVE_WINDOW_SYSTEM 5783 #ifdef HAVE_WINDOW_SYSTEM
5784 if (glyph->type == IMAGE_GLYPH) 5784 if (img)
5785 *dy -= row->ascent - glyph->ascent; 5785 {
5786 *dy -= row->ascent - glyph->ascent;
5787 *dx += glyph->slice.x;
5788 *dy += glyph->slice.y;
5789 /* Image slices positions are still relative to the entire image */
5790 *width = img->width;
5791 *height = img->height;
5792 }
5793 else
5786 #endif 5794 #endif
5795 {
5796 *width = glyph->pixel_width;
5797 *height = glyph->ascent + glyph->descent;
5798 }
5787 } 5799 }
5788 else 5800 else
5789 { 5801 {
5790 *width = 0; 5802 *width = 0;
5791 *height = row->height; 5803 *height = row->height;
5947 struct image *img; 5959 struct image *img;
5948 img = IMAGE_FROM_ID (WINDOW_XFRAME (w), glyph->u.img_id); 5960 img = IMAGE_FROM_ID (WINDOW_XFRAME (w), glyph->u.img_id);
5949 if (img != NULL) 5961 if (img != NULL)
5950 *object = img->spec; 5962 *object = img->spec;
5951 y0 -= row->ascent - glyph->ascent; 5963 y0 -= row->ascent - glyph->ascent;
5964 x0 += glyph->slice.x;
5965 y0 += glyph->slice.y;
5952 } 5966 }
5953 #endif 5967 #endif
5954 } 5968 }
5955 else 5969 else
5956 { 5970 {