emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/xterm.c [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/xterm.c [emacs-unicode-2]
Date: Mon, 28 Jun 2004 03:55:08 -0400

Index: emacs/src/xterm.c
diff -c emacs/src/xterm.c:1.804.2.10 emacs/src/xterm.c:1.804.2.11
*** emacs/src/xterm.c:1.804.2.10        Fri Apr 16 12:51:04 2004
--- emacs/src/xterm.c   Mon Jun 28 07:29:26 2004
***************
*** 1,5 ****
  /* X Communication module for terminals which understand the X protocol.
!    Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 1999, 2000, 01, 02, 2003
     Free Software Foundation, Inc.
  
  This file is part of GNU Emacs.
--- 1,5 ----
  /* X Communication module for terminals which understand the X protocol.
!    Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 1999, 2000,01,02,03,04
     Free Software Foundation, Inc.
  
  This file is part of GNU Emacs.
***************
*** 983,989 ****
  static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int,
                                           int, int, int));
  static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int,
!                                   int, int, int, int, XRectangle *));
  static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int,
                                 int, int, int, XRectangle *));
  
--- 983,990 ----
  static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int,
                                           int, int, int));
  static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int,
!                                   int, int, int, int, int, int,
!                                   XRectangle *));
  static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int,
                                 int, int, int, XRectangle *));
  
***************
*** 2025,2033 ****
  
  static void
  x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
!                   raised_p, left_p, right_p, clip_rect)
       struct frame *f;
!      int left_x, top_y, right_x, bottom_y, width, left_p, right_p, raised_p;
       XRectangle *clip_rect;
  {
    Display *dpy = FRAME_X_DISPLAY (f);
--- 2026,2035 ----
  
  static void
  x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
!                   raised_p, top_p, bot_p, left_p, right_p, clip_rect)
       struct frame *f;
!      int left_x, top_y, right_x, bottom_y, width;
!      int top_p, bot_p, left_p, right_p, raised_p;
       XRectangle *clip_rect;
  {
    Display *dpy = FRAME_X_DISPLAY (f);
***************
*** 2042,2051 ****
    XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted);
  
    /* Top.  */
!   for (i = 0; i < width; ++i)
!     XDrawLine (dpy, window, gc,
!              left_x + i * left_p, top_y + i,
!              right_x + 1 - i * right_p, top_y + i);
  
    /* Left.  */
    if (left_p)
--- 2044,2054 ----
    XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted);
  
    /* Top.  */
!   if (top_p)
!     for (i = 0; i < width; ++i)
!       XDrawLine (dpy, window, gc,
!                left_x + i * left_p, top_y + i,
!                right_x + 1 - i * right_p, top_y + i);
  
    /* Left.  */
    if (left_p)
***************
*** 2061,2070 ****
    XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted);
  
    /* Bottom.  */
!   for (i = 0; i < width; ++i)
!     XDrawLine (dpy, window, gc,
!              left_x + i * left_p, bottom_y - i,
!              right_x + 1 - i * right_p, bottom_y - i);
  
    /* Right.  */
    if (right_p)
--- 2064,2074 ----
    XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted);
  
    /* Bottom.  */
!   if (bot_p)
!     for (i = 0; i < width; ++i)
!       XDrawLine (dpy, window, gc,
!                left_x + i * left_p, bottom_y - i,
!                right_x + 1 - i * right_p, bottom_y - i);
  
    /* Right.  */
    if (right_p)
***************
*** 2172,2178 ****
      {
        x_setup_relief_colors (s);
        x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y,
!                         width, raised_p, left_p, right_p, &clip_rect);
      }
  }
  
--- 2176,2182 ----
      {
        x_setup_relief_colors (s);
        x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y,
!                         width, raised_p, 1, 1, left_p, right_p, &clip_rect);
      }
  }
  
***************
*** 2183,2203 ****
  x_draw_image_foreground (s)
       struct glyph_string *s;
  {
!   int x;
!   int y = s->ybase - image_ascent (s->img, s->face);
  
    /* If first glyph of S has a left box line, start drawing it to the
       right of that line.  */
    if (s->face->box != FACE_NO_BOX
!       && s->first_glyph->left_box_line_p)
!     x = s->x + abs (s->face->box_line_width);
!   else
!     x = s->x;
  
    /* If there is a margin around the image, adjust x- and y-position
       by that margin.  */
!   x += s->img->hmargin;
!   y += s->img->vmargin;
  
    if (s->img->pixmap)
      {
--- 2187,2208 ----
  x_draw_image_foreground (s)
       struct glyph_string *s;
  {
!   int x = s->x;
!   int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
  
    /* If first glyph of S has a left box line, start drawing it to the
       right of that line.  */
    if (s->face->box != FACE_NO_BOX
!       && s->first_glyph->left_box_line_p
!       && s->slice.x == 0)
!     x += abs (s->face->box_line_width);
  
    /* If there is a margin around the image, adjust x- and y-position
       by that margin.  */
!   if (s->slice.x == 0)
!     x += s->img->hmargin;
!   if (s->slice.y == 0)
!     y += s->img->vmargin;
  
    if (s->img->pixmap)
      {
***************
*** 2222,2232 ****
          get_glyph_string_clip_rect (s, &clip_rect);
          image_rect.x = x;
          image_rect.y = y;
!         image_rect.width = s->img->width;
!         image_rect.height = s->img->height;
          if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
            XCopyArea (s->display, s->img->pixmap, s->window, s->gc,
!                      r.x - x, r.y - y, r.width, r.height, r.x, r.y);
        }
        else
        {
--- 2227,2238 ----
          get_glyph_string_clip_rect (s, &clip_rect);
          image_rect.x = x;
          image_rect.y = y;
!         image_rect.width = s->slice.width;
!         image_rect.height = s->slice.height;
          if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
            XCopyArea (s->display, s->img->pixmap, s->window, s->gc,
!                      s->slice.x + r.x - x, s->slice.y + r.y - y,
!                      r.width, r.height, r.x, r.y);
        }
        else
        {
***************
*** 2235,2245 ****
          get_glyph_string_clip_rect (s, &clip_rect);
          image_rect.x = x;
          image_rect.y = y;
!         image_rect.width = s->img->width;
!         image_rect.height = s->img->height;
          if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
            XCopyArea (s->display, s->img->pixmap, s->window, s->gc,
!                      r.x - x, r.y - y, r.width, r.height, r.x, r.y);
  
          /* When the image has a mask, we can expect that at
             least part of a mouse highlight or a block cursor will
--- 2241,2252 ----
          get_glyph_string_clip_rect (s, &clip_rect);
          image_rect.x = x;
          image_rect.y = y;
!         image_rect.width = s->slice.width;
!         image_rect.height = s->slice.height;
          if (x_intersect_rectangles (&clip_rect, &image_rect, &r))
            XCopyArea (s->display, s->img->pixmap, s->window, s->gc,
!                      s->slice.x + r.x - x, s->slice.y + r.y - y,
!                      r.width, r.height, r.x, r.y);
  
          /* When the image has a mask, we can expect that at
             least part of a mouse highlight or a block cursor will
***************
*** 2251,2265 ****
            {
              int r = s->img->relief;
              if (r < 0) r = -r;
!             XDrawRectangle (s->display, s->window, s->gc, x - r, y - r,
!                             s->img->width + r*2 - 1, s->img->height + r*2 - 
1);
            }
        }
      }
    else
      /* Draw a rectangle if image could not be loaded.  */
      XDrawRectangle (s->display, s->window, s->gc, x, y,
!                   s->img->width - 1, s->img->height - 1);
  }
  
  
--- 2258,2274 ----
            {
              int r = s->img->relief;
              if (r < 0) r = -r;
!             XDrawRectangle (s->display, s->window, s->gc,
!                             x - r, y - r,
!                             s->slice.width + r*2 - 1,
!                             s->slice.height + r*2 - 1);
            }
        }
      }
    else
      /* Draw a rectangle if image could not be loaded.  */
      XDrawRectangle (s->display, s->window, s->gc, x, y,
!                   s->slice.width - 1, s->slice.height - 1);
  }
  
  
***************
*** 2271,2291 ****
  {
    int x0, y0, x1, y1, thick, raised_p;
    XRectangle r;
!   int x;
!   int y = s->ybase - image_ascent (s->img, s->face);
  
    /* If first glyph of S has a left box line, start drawing it to the
       right of that line.  */
    if (s->face->box != FACE_NO_BOX
!       && s->first_glyph->left_box_line_p)
!     x = s->x + abs (s->face->box_line_width);
!   else
!     x = s->x;
  
    /* If there is a margin around the image, adjust x- and y-position
       by that margin.  */
!   x += s->img->hmargin;
!   y += s->img->vmargin;
  
    if (s->hl == DRAW_IMAGE_SUNKEN
        || s->hl == DRAW_IMAGE_RAISED)
--- 2280,2301 ----
  {
    int x0, y0, x1, y1, thick, raised_p;
    XRectangle r;
!   int x = s->x;
!   int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
  
    /* If first glyph of S has a left box line, start drawing it to the
       right of that line.  */
    if (s->face->box != FACE_NO_BOX
!       && s->first_glyph->left_box_line_p
!       && s->slice.x == 0)
!     x += abs (s->face->box_line_width);
  
    /* If there is a margin around the image, adjust x- and y-position
       by that margin.  */
!   if (s->slice.x == 0)
!     x += s->img->hmargin;
!   if (s->slice.y == 0)
!     y += s->img->vmargin;
  
    if (s->hl == DRAW_IMAGE_SUNKEN
        || s->hl == DRAW_IMAGE_RAISED)
***************
*** 2301,2312 ****
  
    x0 = x - thick;
    y0 = y - thick;
!   x1 = x + s->img->width + thick - 1;
!   y1 = y + s->img->height + thick - 1;
  
    x_setup_relief_colors (s);
    get_glyph_string_clip_rect (s, &r);
!   x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r);
  }
  
  
--- 2311,2327 ----
  
    x0 = x - thick;
    y0 = y - thick;
!   x1 = x + s->slice.width + thick - 1;
!   y1 = y + s->slice.height + thick - 1;
  
    x_setup_relief_colors (s);
    get_glyph_string_clip_rect (s, &r);
!   x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p,
!                     s->slice.y == 0,
!                     s->slice.y + s->slice.height == s->img->height,
!                     s->slice.x == 0,
!                     s->slice.x + s->slice.width == s->img->width,
!                     &r);
  }
  
  
***************
*** 2317,2337 ****
       struct glyph_string *s;
       Pixmap pixmap;
  {
!   int x;
!   int y = s->ybase - s->y - image_ascent (s->img, s->face);
  
    /* If first glyph of S has a left box line, start drawing it to the
       right of that line.  */
    if (s->face->box != FACE_NO_BOX
!       && s->first_glyph->left_box_line_p)
!     x = abs (s->face->box_line_width);
!   else
!     x = 0;
  
    /* If there is a margin around the image, adjust x- and y-position
       by that margin.  */
!   x += s->img->hmargin;
!   y += s->img->vmargin;
  
    if (s->img->pixmap)
      {
--- 2332,2353 ----
       struct glyph_string *s;
       Pixmap pixmap;
  {
!   int x = 0;
!   int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice);
  
    /* If first glyph of S has a left box line, start drawing it to the
       right of that line.  */
    if (s->face->box != FACE_NO_BOX
!       && s->first_glyph->left_box_line_p
!       && s->slice.x == 0)
!     x += abs (s->face->box_line_width);
  
    /* If there is a margin around the image, adjust x- and y-position
       by that margin.  */
!   if (s->slice.x == 0)
!     x += s->img->hmargin;
!   if (s->slice.y == 0)
!     y += s->img->vmargin;
  
    if (s->img->pixmap)
      {
***************
*** 2347,2365 ****
          XGCValues xgcv;
  
          xgcv.clip_mask = s->img->mask;
!         xgcv.clip_x_origin = x;
!         xgcv.clip_y_origin = y;
          xgcv.function = GXcopy;
          XChangeGC (s->display, s->gc, mask, &xgcv);
  
          XCopyArea (s->display, s->img->pixmap, pixmap, s->gc,
!                    0, 0, s->img->width, s->img->height, x, y);
          XSetClipMask (s->display, s->gc, None);
        }
        else
        {
          XCopyArea (s->display, s->img->pixmap, pixmap, s->gc,
!                    0, 0, s->img->width, s->img->height, x, y);
  
          /* When the image has a mask, we can expect that at
             least part of a mouse highlight or a block cursor will
--- 2363,2383 ----
          XGCValues xgcv;
  
          xgcv.clip_mask = s->img->mask;
!         xgcv.clip_x_origin = x - s->slice.x;
!         xgcv.clip_y_origin = y - s->slice.y;
          xgcv.function = GXcopy;
          XChangeGC (s->display, s->gc, mask, &xgcv);
  
          XCopyArea (s->display, s->img->pixmap, pixmap, s->gc,
!                    s->slice.x, s->slice.y,
!                    s->slice.width, s->slice.height, x, y);
          XSetClipMask (s->display, s->gc, None);
        }
        else
        {
          XCopyArea (s->display, s->img->pixmap, pixmap, s->gc,
!                    s->slice.x, s->slice.y,
!                    s->slice.width, s->slice.height, x, y);
  
          /* When the image has a mask, we can expect that at
             least part of a mouse highlight or a block cursor will
***************
*** 2372,2385 ****
              int r = s->img->relief;
              if (r < 0) r = -r;
              XDrawRectangle (s->display, s->window, s->gc, x - r, y - r,
!                             s->img->width + r*2 - 1, s->img->height + r*2 - 
1);
            }
        }
      }
    else
      /* Draw a rectangle if image could not be loaded.  */
      XDrawRectangle (s->display, pixmap, s->gc, x, y,
!                   s->img->width - 1, s->img->height - 1);
  }
  
  
--- 2390,2404 ----
              int r = s->img->relief;
              if (r < 0) r = -r;
              XDrawRectangle (s->display, s->window, s->gc, x - r, y - r,
!                             s->slice.width + r*2 - 1,
!                             s->slice.height + r*2 - 1);
            }
        }
      }
    else
      /* Draw a rectangle if image could not be loaded.  */
      XDrawRectangle (s->display, pixmap, s->gc, x, y,
!                   s->slice.width - 1, s->slice.height - 1);
  }
  
  
***************
*** 2421,2453 ****
  x_draw_image_glyph_string (s)
       struct glyph_string *s;
  {
-   int x, y;
    int box_line_hwidth = abs (s->face->box_line_width);
    int box_line_vwidth = max (s->face->box_line_width, 0);
    int height;
    Pixmap pixmap = None;
  
!   height = s->height - 2 * box_line_vwidth;
! 
  
    /* Fill background with face under the image.  Do it only if row is
       taller than image or if image has a clip mask to reduce
       flickering.  */
    s->stippled_p = s->face->stipple != 0;
!   if (height > s->img->height
        || s->img->hmargin
        || s->img->vmargin
        || s->img->mask
        || s->img->pixmap == 0
        || s->width != s->background_width)
      {
-       if (box_line_hwidth && s->first_glyph->left_box_line_p)
-       x = s->x + box_line_hwidth;
-       else
-       x = s->x;
- 
-       y = s->y + box_line_vwidth;
- 
        if (s->img->mask)
        {
          /* Create a pixmap as large as the glyph string.  Fill it
--- 2440,2467 ----
  x_draw_image_glyph_string (s)
       struct glyph_string *s;
  {
    int box_line_hwidth = abs (s->face->box_line_width);
    int box_line_vwidth = max (s->face->box_line_width, 0);
    int height;
    Pixmap pixmap = None;
  
!   height = s->height;
!   if (s->slice.y == 0)
!     height -= box_line_vwidth;
!   if (s->slice.y + s->slice.height >= s->img->height)
!     height -= box_line_vwidth;
  
    /* Fill background with face under the image.  Do it only if row is
       taller than image or if image has a clip mask to reduce
       flickering.  */
    s->stippled_p = s->face->stipple != 0;
!   if (height > s->slice.height
        || s->img->hmargin
        || s->img->vmargin
        || s->img->mask
        || s->img->pixmap == 0
        || s->width != s->background_width)
      {
        if (s->img->mask)
        {
          /* Create a pixmap as large as the glyph string.  Fill it
***************
*** 2486,2492 ****
            }
        }
        else
!       x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height);
  
        s->background_filled_p = 1;
      }
--- 2500,2518 ----
            }
        }
        else
!       {
!         int x = s->x;
!         int y = s->y;
! 
!         if (s->first_glyph->left_box_line_p
!             && s->slice.x == 0)
!           x += box_line_hwidth;
! 
!         if (s->slice.y == 0)
!           y += box_line_vwidth;
! 
!         x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height);
!       }
  
        s->background_filled_p = 1;
      }
***************
*** 7239,7245 ****
    /* Compute the proper height and ascent of the rectangle, based
       on the actual glyph.  Using the full height of the row looks
       bad when there are tall images on that row.  */
!   h = max (FRAME_LINE_HEIGHT (f), cursor_glyph->ascent + 
cursor_glyph->descent);
    if (h < row->height)
      y += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - 
h;
    h--;
--- 7265,7272 ----
    /* Compute the proper height and ascent of the rectangle, based
       on the actual glyph.  Using the full height of the row looks
       bad when there are tall images on that row.  */
!   h = max (min (FRAME_LINE_HEIGHT (f), row->height),
!          cursor_glyph->ascent + cursor_glyph->descent);
    if (h < row->height)
      y += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - 
h;
    h--;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]