emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/macterm.c


From: Kim F. Storm
Subject: [Emacs-diffs] Changes to emacs/src/macterm.c
Date: Sat, 24 May 2003 18:00:34 -0400

Index: emacs/src/macterm.c
diff -c emacs/src/macterm.c:1.44 emacs/src/macterm.c:1.45
*** emacs/src/macterm.c:1.44    Sat May 17 17:17:44 2003
--- emacs/src/macterm.c Sat May 24 18:00:34 2003
***************
*** 306,313 ****
  static void x_frame_rehighlight P_ ((struct x_display_info *));
  static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
  static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int));
! static void x_clip_to_row P_ ((struct window *, struct glyph_row *,
!                              GC, int));
  static void x_flush P_ ((struct frame *f));
  static void x_update_begin P_ ((struct frame *));
  static void x_update_window_begin P_ ((struct window *));
--- 306,312 ----
  static void x_frame_rehighlight P_ ((struct x_display_info *));
  static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
  static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int));
! static void x_clip_to_row P_ ((struct window *, struct glyph_row *, GC));
  static void x_flush P_ ((struct frame *f));
  static void x_update_begin P_ ((struct frame *));
  static void x_update_window_begin P_ ((struct window *));
***************
*** 1273,1279 ****
        XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
                  0, y, width, height, 0);
        XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
!                 f->output_data.mac->pixel_width - width, y,
                  width, height, 0);
  
        UNBLOCK_INPUT;
--- 1272,1278 ----
        XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
                  0, y, width, height, 0);
        XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
!                 FRAME_PIXEL_WIDTH (f) - width, y,
                  width, height, 0);
  
        UNBLOCK_INPUT;
***************
*** 1300,1306 ****
    struct face *face = p->face;
  
    /* Must clip because of partially visible lines.  */
!   x_clip_to_row (w, row, gc, 1);
  
    if (p->bx >= 0)
      {
--- 1299,1305 ----
    struct face *face = p->face;
  
    /* Must clip because of partially visible lines.  */
!   x_clip_to_row (w, row, gc);
  
    if (p->bx >= 0)
      {
***************
*** 2352,2360 ****
    if (s->row->full_width_p
        && !s->w->pseudo_window_p)
      {
!       last_x += FRAME_X_RIGHT_FRINGE_WIDTH (s->f);
!       if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (s->f))
!       last_x += FRAME_SCROLL_BAR_WIDTH (s->f) * CANON_X_UNIT (s->f);
      }
  
    /* The glyph that may have a right box line.  */
--- 2351,2360 ----
    if (s->row->full_width_p
        && !s->w->pseudo_window_p)
      {
!       last_x += WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w);
!       if (s->area != RIGHT_MARGIN_AREA
!         || WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (s->w))
!       last_x += WINDOW_RIGHT_FRINGE_WIDTH (s->w);
      }
  
    /* The glyph that may have a right box line.  */
***************
*** 2744,2750 ****
      {
        /* If `x-stretch-block-cursor' is nil, don't draw a block cursor
         as wide as the stretch glyph.  */
!       int width = min (CANON_X_UNIT (s->f), s->background_width);
  
        /* Draw cursor.  */
        x_draw_glyph_string_bg_rect (s, s->x, s->y, width, s->height);
--- 2744,2750 ----
      {
        /* If `x-stretch-block-cursor' is nil, don't draw a block cursor
         as wide as the stretch glyph.  */
!       int width = min (FRAME_COLUMN_WIDTH (s->f), s->background_width);
  
        /* Draw cursor.  */
        x_draw_glyph_string_bg_rect (s, s->x, s->y, width, s->height);
***************
*** 3147,3154 ****
       without mode lines.  Include in this box the left and right
       fringes of W.  */
    window_box (w, -1, &x, &y, &width, &height);
-   width += FRAME_X_FRINGE_WIDTH (f);
-   x -= FRAME_X_LEFT_FRINGE_WIDTH (f);
  
    from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y);
    to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y);
--- 3147,3152 ----
***************
*** 3591,3605 ****
  {
    Lisp_Object window;
  
!   window = window_from_coordinates (f, x, y, 0, 0);
    if (!NILP (window))
      {
        struct window *w = XWINDOW (window);
        struct glyph_row *r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
        struct glyph_row *end = r + w->current_matrix->nrows - 1;
  
-       frame_to_window_pixel_xy (w, &x, &y);
- 
        for (; r < end && r->enabled_p; ++r)
        if (r->y <= y && r->y + r->height > y)
          {
--- 3589,3602 ----
  {
    Lisp_Object window;
  
!   window = window_from_coordinates (f, x, y, 0, &x, &y, 0);
! 
    if (!NILP (window))
      {
        struct window *w = XWINDOW (window);
        struct glyph_row *r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
        struct glyph_row *end = r + w->current_matrix->nrows - 1;
  
        for (; r < end && r->enabled_p; ++r)
        if (r->y <= y && r->y + r->height > y)
          {
***************
*** 3614,3620 ****
            if (x < r->x)
              {
                /* x is to the left of the first glyph in the row.  */
!               rect->left = XINT (w->left);
                rect->right = WINDOW_TO_FRAME_PIXEL_X (w, r->x);
                return 1;
              }
--- 3611,3620 ----
            if (x < r->x)
              {
                /* x is to the left of the first glyph in the row.  */
!               /* Shouldn't this be a pixel value?
!                  WINDOW_LEFT_EDGE_X (w) seems to be the right value.
!                  ++KFS */
!               rect->left = WINDOW_LEFT_EDGE_COL (w);
                rect->right = WINDOW_TO_FRAME_PIXEL_X (w, r->x);
                return 1;
              }
***************
*** 3630,3636 ****
  
            /* x is to the right of the last glyph in the row.  */
            rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
!           rect->right = XINT (w->left) + XINT (w->width);
            return 1;
          }
      }
--- 3630,3639 ----
  
            /* x is to the right of the last glyph in the row.  */
            rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx);
!           /* Shouldn't this be a pixel value?  
!              WINDOW_RIGHT_EDGE_X (w) seems to be the right value.
!              ++KFS */
!           rect->right = WINDOW_RIGHT_EDGE_COL (w);
            return 1;
          }
      }
***************
*** 3652,3658 ****
        int width = FRAME_SMALLEST_CHAR_WIDTH (f1);
        int height = FRAME_SMALLEST_FONT_HEIGHT (f1);
  
!       /* Arrange for the division in PIXEL_TO_CHAR_COL etc. to
         round down even for negative values.  */
        if (gx < 0)
        gx -= width - 1;
--- 3655,3661 ----
        int width = FRAME_SMALLEST_CHAR_WIDTH (f1);
        int height = FRAME_SMALLEST_FONT_HEIGHT (f1);
  
!       /* Arrange for the division in FRAME_PIXEL_X_TO_COL etc. to
         round down even for negative values.  */
        if (gx < 0)
        gx -= width - 1;
***************
*** 3938,3972 ****
    struct frame *f = XFRAME (w->frame);
    struct scroll_bar *bar;
    int top, height, left, sb_left, width, sb_width, disp_top, disp_height;
!   int window_x, window_y, window_width, window_height;
  
    /* Get window dimensions.  */
!   window_box (w, -1, &window_x, &window_y, &window_width, &window_height);
    top = window_y;
  #ifdef MAC_OSX
    width = 16;
  #else
!   width = FRAME_SCROLL_BAR_COLS (f) * CANON_X_UNIT (f);
  #endif
    height = window_height;
  
    /* Compute the left edge of the scroll bar area.  */
!   if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))
!     left = XINT (w->left) + XINT (w->width) - FRAME_SCROLL_BAR_COLS (f);
!   else
!     left = XFASTINT (w->left);
!   left *= CANON_X_UNIT (f);
!   left += FRAME_INTERNAL_BORDER_WIDTH (f);
  
    /* Compute the width of the scroll bar which might be less than
       the width of the area reserved for the scroll bar.  */
!   if (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0)
!     sb_width = FRAME_SCROLL_BAR_PIXEL_WIDTH (f);
    else
      sb_width = width;
  
    /* Compute the left edge of the scroll bar.  */
!   if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))
      sb_left = left + width - sb_width - (width - sb_width) / 2;
    else
      sb_left = left + (width - sb_width) / 2;
--- 3941,3970 ----
    struct frame *f = XFRAME (w->frame);
    struct scroll_bar *bar;
    int top, height, left, sb_left, width, sb_width, disp_top, disp_height;
!   int window_y, window_height;
  
    /* Get window dimensions.  */
!   window_box (w, -1, 0, &window_y, 0, &window_height);
    top = window_y;
  #ifdef MAC_OSX
    width = 16;
  #else
!   width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f);
  #endif
    height = window_height;
  
    /* Compute the left edge of the scroll bar area.  */
!   left = WINDOW_SCROLL_BAR_AREA_X (w);
  
    /* Compute the width of the scroll bar which might be less than
       the width of the area reserved for the scroll bar.  */
!   if (WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) > 0)
!     sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
    else
      sb_width = width;
  
    /* Compute the left edge of the scroll bar.  */
!   if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
      sb_left = left + width - sb_width - (width - sb_width) / 2;
    else
      sb_left = left + (width - sb_width) / 2;
***************
*** 3979,3991 ****
        disp_top = -1;
        disp_height++;
      }
!   else if (disp_top == PIXEL_HEIGHT (f) - 16)
      {
        disp_top++;
        disp_height--;
      }
  
!   if (sb_left + sb_width == PIXEL_WIDTH (f))
      sb_left++;
  
    /* Does the scroll bar exist yet?  */
--- 3977,3989 ----
        disp_top = -1;
        disp_height++;
      }
!   else if (disp_top == FRAME_PIXEL_HEIGHT (f) - 16)
      {
        disp_top++;
        disp_height--;
      }
  
!   if (sb_left + sb_width == FRAME_PIXEL_WIDTH (f))
      sb_left++;
  
    /* Does the scroll bar exist yet?  */
***************
*** 4021,4032 ****
             wide as the area reserved for it .  This makes sure a
             previous mode line display is cleared after C-x 2 C-x 1, for
             example.  */
!         int area_width = FRAME_SCROLL_BAR_COLS (f) * CANON_X_UNIT (f);
          XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
                      left, top, area_width, height, 0);
  
  #if 0
!           if (sb_left + sb_width >= PIXEL_WIDTH (f))
              XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
                        sb_left - 1, top, 1, height, 0);
  #endif
--- 4019,4030 ----
             wide as the area reserved for it .  This makes sure a
             previous mode line display is cleared after C-x 2 C-x 1, for
             example.  */
!         int area_width = WINDOW_SCROLL_BAR_AREA_WIDTH (w);
          XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
                      left, top, area_width, height, 0);
  
  #if 0
!           if (sb_left + sb_width >= FRAME_PIXEL_WIDTH (f))
              XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
                        sb_left - 1, top, 1, height, 0);
  #endif
***************
*** 4369,4393 ****
  
  /* Set clipping for output in glyph row ROW.  W is the window in which
     we operate.  GC is the graphics context to set clipping in.
-    WHOLE_LINE_P non-zero means include the areas used for truncation
-    mark display and alike in the clipping rectangle.
  
     ROW may be a text row or, e.g., a mode line.  Text rows must be
     clipped to the interior of the window dedicated to text display,
     mode lines must be clipped to the whole window.  */
  
  static void
! x_clip_to_row (w, row, gc, whole_line_p)
       struct window *w;
       struct glyph_row *row;
       GC gc;
-      int whole_line_p;
  {
    struct frame *f = XFRAME (WINDOW_FRAME (w));
    Rect clip_rect;
!   int window_x, window_y, window_width, window_height;
  
!   window_box (w, -1, &window_x, &window_y, &window_width, &window_height);
  
    clip_rect.left = WINDOW_TO_FRAME_PIXEL_X (w, 0);
    clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
--- 4367,4388 ----
  
  /* Set clipping for output in glyph row ROW.  W is the window in which
     we operate.  GC is the graphics context to set clipping in.
  
     ROW may be a text row or, e.g., a mode line.  Text rows must be
     clipped to the interior of the window dedicated to text display,
     mode lines must be clipped to the whole window.  */
  
  static void
! x_clip_to_row (w, row, gc)
       struct window *w;
       struct glyph_row *row;
       GC gc;
  {
    struct frame *f = XFRAME (WINDOW_FRAME (w));
    Rect clip_rect;
!   int window_y, window_width;
  
!   window_box (w, -1, 0, &window_y, &window_width, 0);
  
    clip_rect.left = WINDOW_TO_FRAME_PIXEL_X (w, 0);
    clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
***************
*** 4395,4408 ****
    clip_rect.right = clip_rect.left + window_width;
    clip_rect.bottom = clip_rect.top + row->visible_height;
  
-   /* If clipping to the whole line, including trunc marks, extend
-      the rectangle to the left and increase its width.  */
-   if (whole_line_p)
-     {
-       clip_rect.left -= FRAME_X_LEFT_FRINGE_WIDTH (f);
-       clip_rect.right += FRAME_X_FRINGE_WIDTH (f);
-     }
- 
    mac_set_clip_rectangle (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), 
&clip_rect);
  }
  
--- 4390,4395 ----
***************
*** 4442,4448 ****
    wd = cursor_glyph->pixel_width - 1;
    if (cursor_glyph->type == STRETCH_GLYPH
        && !x_stretch_cursor_p)
!     wd = min (CANON_X_UNIT (f), wd);
  
    /* The foreground of cursor_gc is typically the same as the normal
       background color, which can cause the cursor box to be invisible.  */
--- 4429,4435 ----
    wd = cursor_glyph->pixel_width - 1;
    if (cursor_glyph->type == STRETCH_GLYPH
        && !x_stretch_cursor_p)
!     wd = min (FRAME_COLUMN_WIDTH (f), wd);
  
    /* The foreground of cursor_gc is typically the same as the normal
       background color, which can cause the cursor box to be invisible.  */
***************
*** 4455,4461 ****
    gc = dpyinfo->scratch_cursor_gc;
  
    /* Set clipping, draw the rectangle, and reset clipping again.  */
!   x_clip_to_row (w, row, gc, 0);
    mac_draw_rectangle (dpy, FRAME_MAC_WINDOW (f), gc, x, y, wd, h);
    mac_reset_clipping (dpy, FRAME_MAC_WINDOW (f));
  }
--- 4442,4448 ----
    gc = dpyinfo->scratch_cursor_gc;
  
    /* Set clipping, draw the rectangle, and reset clipping again.  */
!   x_clip_to_row (w, row, gc);
    mac_draw_rectangle (dpy, FRAME_MAC_WINDOW (f), gc, x, y, wd, h);
    mac_reset_clipping (dpy, FRAME_MAC_WINDOW (f));
  }
***************
*** 4511,4517 ****
        width = FRAME_CURSOR_WIDTH (f);
  
        x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
!       x_clip_to_row (w, row, gc, 0);
        XFillRectangle (dpy, window, gc,
                      x,
                      WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
--- 4498,4504 ----
        width = FRAME_CURSOR_WIDTH (f);
  
        x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
!       x_clip_to_row (w, row, gc);
        XFillRectangle (dpy, window, gc,
                      x,
                      WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
***************
*** 4685,4720 ****
    FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
    FRAME_FONTSET (f) = -1;
  
    /* Compute the scroll bar width in character columns.  */
!   if (f->scroll_bar_pixel_width > 0)
      {
!       int wid = FONT_WIDTH (FRAME_FONT (f));
!       f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid;
      }
    else
      {
!       int wid = FONT_WIDTH (FRAME_FONT (f));
!       f->scroll_bar_cols = (14 + wid - 1) / wid;
      }
  
    /* Now make the frame display the given font.  */
    if (FRAME_MAC_WINDOW (f) != 0)
      {
        XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->normal_gc,
!               f->output_data.mac->font);
        XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->reverse_gc,
!               f->output_data.mac->font);
        XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->cursor_gc,
!               f->output_data.mac->font);
  
-       frame_update_line_height (f);
        if (NILP (tip_frame) || XFRAME (tip_frame) != f)
!         x_set_window_size (f, 0, f->width, f->height);
      }
-   else
-     /* If we are setting a new frame's font for the first time,
-        there are no faces yet, so this font's height is the line height.  */
-     f->output_data.mac->line_height = FONT_HEIGHT (FRAME_FONT (f));
  
    return build_string (fontp->full_name);
  }
--- 4672,4708 ----
    FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
    FRAME_FONTSET (f) = -1;
  
+   FRAME_COLUMN_WIDTH (f) = FONT_WIDTH (FRAME_FONT (f));
+   FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (FRAME_FONT (f));
+ 
+   compute_fringe_widths (f, 1);
+ 
    /* Compute the scroll bar width in character columns.  */
!   if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
      {
!       int wid = FRAME_COLUMN_WIDTH (f);
!       FRAME_CONFIG_SCROLL_BAR_COLS (f) 
!       = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid;
      }
    else
      {
!       int wid = FRAME_COLUMN_WIDTH (f);
!       FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
      }
  
    /* Now make the frame display the given font.  */
    if (FRAME_MAC_WINDOW (f) != 0)
      {
        XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->normal_gc,
!               FRAME_FONT (f));
        XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->reverse_gc,
!               FRAME_FONT (f));
        XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->cursor_gc,
!               FRAME_FONT (f));
  
        if (NILP (tip_frame) || XFRAME (tip_frame) != f)
!         x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
      }
  
    return build_string (fontp->full_name);
  }
***************
*** 4776,4782 ****
       struct frame *f;
  {
    Point pt;
!   int flags = f->output_data.mac->size_hint_flags;
  
    pt.h = pt.v = 0;
  
--- 4764,4770 ----
       struct frame *f;
  {
    Point pt;
!   int flags = f->size_hint_flags;
  
    pt.h = pt.v = 0;
  
***************
*** 4810,4829 ****
    /* Treat negative positions as relative to the leftmost bottommost
       position that fits on the screen.  */
    if (flags & XNegative)
!     f->output_data.mac->left_pos = (FRAME_MAC_DISPLAY_INFO (f)->width
!                             - 2 * f->output_data.mac->border_width - pt.h
!                             - PIXEL_WIDTH (f)
!                             + f->output_data.mac->left_pos);
    /* NTEMACS_TODO: Subtract menubar height?  */
    if (flags & YNegative)
!     f->output_data.mac->top_pos = (FRAME_MAC_DISPLAY_INFO (f)->height
!                            - 2 * f->output_data.mac->border_width - pt.v
!                            - PIXEL_HEIGHT (f)
!                            + f->output_data.mac->top_pos);
    /* The left_pos and top_pos
       are now relative to the top and left screen edges,
       so the flags should correspond.  */
!   f->output_data.mac->size_hint_flags &= ~ (XNegative | YNegative);
  }
  
  /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position,
--- 4798,4817 ----
    /* Treat negative positions as relative to the leftmost bottommost
       position that fits on the screen.  */
    if (flags & XNegative)
!     f->left_pos = (FRAME_MAC_DISPLAY_INFO (f)->width
!                  - 2 * f->border_width - pt.h
!                  - FRAME_PIXEL_WIDTH (f)
!                  + f->left_pos);
    /* NTEMACS_TODO: Subtract menubar height?  */
    if (flags & YNegative)
!     f->top_pos = (FRAME_MAC_DISPLAY_INFO (f)->height
!                 - 2 * f->border_width - pt.v
!                 - FRAME_PIXEL_HEIGHT (f)
!                 + f->top_pos);
    /* The left_pos and top_pos
       are now relative to the top and left screen edges,
       so the flags should correspond.  */
!   f->size_hint_flags &= ~ (XNegative | YNegative);
  }
  
  /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position,
***************
*** 4842,4863 ****
  
    if (change_gravity > 0)
      {
!       f->output_data.mac->top_pos = yoff;
!       f->output_data.mac->left_pos = xoff;
!       f->output_data.mac->size_hint_flags &= ~ (XNegative | YNegative);
        if (xoff < 0)
!       f->output_data.mac->size_hint_flags |= XNegative;
        if (yoff < 0)
!       f->output_data.mac->size_hint_flags |= YNegative;
!       f->output_data.mac->win_gravity = NorthWestGravity;
      }
    x_calc_absolute_position (f);
  
    BLOCK_INPUT;
    x_wm_set_size_hint (f, (long) 0, 0);
  
!   modified_left = f->output_data.mac->left_pos;
!   modified_top = f->output_data.mac->top_pos;
  
    MoveWindow (f->output_data.mac->mWP, modified_left + 6,
              modified_top + 42, false);
--- 4830,4851 ----
  
    if (change_gravity > 0)
      {
!       f->top_pos = yoff;
!       f->left_pos = xoff;
!       f->size_hint_flags &= ~ (XNegative | YNegative);
        if (xoff < 0)
!       f->size_hint_flags |= XNegative;
        if (yoff < 0)
!       f->size_hint_flags |= YNegative;
!       f->win_gravity = NorthWestGravity;
      }
    x_calc_absolute_position (f);
  
    BLOCK_INPUT;
    x_wm_set_size_hint (f, (long) 0, 0);
  
!   modified_left = f->left_pos;
!   modified_top = f->top_pos;
  
    MoveWindow (f->output_data.mac->mWP, modified_left + 6,
              modified_top + 42, false);
***************
*** 4881,4897 ****
    BLOCK_INPUT;
  
    check_frame_size (f, &rows, &cols);
!   f->output_data.mac->vertical_scroll_bar_extra
!     = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
!        ? 0
!        : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.mac->font)));
  
    compute_fringe_widths (f, 0);
  
!   pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols);
!   pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows);
  
!   f->output_data.mac->win_gravity = NorthWestGravity;
    x_wm_set_size_hint (f, (long) 0, 0);
  
    SizeWindow (FRAME_MAC_WINDOW (f), pixelwidth, pixelheight, 0);
--- 4869,4883 ----
    BLOCK_INPUT;
  
    check_frame_size (f, &rows, &cols);
!   f->scroll_bar_actual_width
!     = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
  
    compute_fringe_widths (f, 0);
  
!   pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
!   pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
  
!   f->win_gravity = NorthWestGravity;
    x_wm_set_size_hint (f, (long) 0, 0);
  
    SizeWindow (FRAME_MAC_WINDOW (f), pixelwidth, pixelheight, 0);
***************
*** 4910,4917 ****
       We pass 1 for DELAY since we can't run Lisp code inside of
       a BLOCK_INPUT.  */
    change_frame_size (f, rows, cols, 0, 1, 0);
!   PIXEL_WIDTH (f) = pixelwidth;
!   PIXEL_HEIGHT (f) = pixelheight;
  
    /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to
       receive in the ConfigureNotify event; if we get what we asked
--- 4896,4903 ----
       We pass 1 for DELAY since we can't run Lisp code inside of
       a BLOCK_INPUT.  */
    change_frame_size (f, rows, cols, 0, 1, 0);
!   FRAME_PIXEL_WIDTH (f) = pixelwidth;
!   FRAME_PIXEL_HEIGHT (f) = pixelheight;
  
    /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to
       receive in the ConfigureNotify event; if we get what we asked
***************
*** 4944,4957 ****
  {
    int pix_x, pix_y;
  
!   pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH  (f->output_data.mac->font) / 
2;
!   pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->output_data.mac->line_height / 2;
  
    if (pix_x < 0) pix_x = 0;
!   if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f);
  
    if (pix_y < 0) pix_y = 0;
!   if (pix_y > PIXEL_HEIGHT (f)) pix_y = PIXEL_HEIGHT (f);
  
    x_set_mouse_pixel_position (f, pix_x, pix_y);
  }
--- 4930,4943 ----
  {
    int pix_x, pix_y;
  
!   pix_x = FRAME_COL_TO_PIXEL_X (f, x) + FRAME_COLUMN_WIDTH (f) / 2;
!   pix_y = FRAME_LINE_TO_PIXEL_Y (f, y) + FRAME_LINE_HEIGHT (f) / 2;
  
    if (pix_x < 0) pix_x = 0;
!   if (pix_x > FRAME_PIXEL_WIDTH (f)) pix_x = FRAME_PIXEL_WIDTH (f);
  
    if (pix_y < 0) pix_y = 0;
!   if (pix_y > FRAME_PIXEL_HEIGHT (f)) pix_y = FRAME_PIXEL_HEIGHT (f);
  
    x_set_mouse_pixel_position (f, pix_x, pix_y);
  }
***************
*** 5050,5057 ****
         before the window gets really visible.  */
        if (! FRAME_ICONIFIED_P (f)
          && ! f->output_data.mac->asked_for_visible)
!       x_set_offset (f, f->output_data.mac->left_pos,
!                     f->output_data.mac->top_pos, 0);
  
        f->output_data.mac->asked_for_visible = 1;
  
--- 5036,5042 ----
         before the window gets really visible.  */
        if (! FRAME_ICONIFIED_P (f)
          && ! f->output_data.mac->asked_for_visible)
!       x_set_offset (f, f->left_pos, f->top_pos, 0);
  
        f->output_data.mac->asked_for_visible = 1;
  
***************
*** 5228,5235 ****
    /* Setting PMaxSize caused various problems.  */
    size_hints.flags = PResizeInc | PMinSize /* | PMaxSize */;
  
!   size_hints.x = f->output_data.x->left_pos;
!   size_hints.y = f->output_data.x->top_pos;
  
  #ifdef USE_X_TOOLKIT
    XtSetArg (al[ac], XtNwidth, &widget_width); ac++;
--- 5213,5220 ----
    /* Setting PMaxSize caused various problems.  */
    size_hints.flags = PResizeInc | PMinSize /* | PMaxSize */;
  
!   size_hints.x = f->left_pos;
!   size_hints.y = f->top_pos;
  
  #ifdef USE_X_TOOLKIT
    XtSetArg (al[ac], XtNwidth, &widget_width); ac++;
***************
*** 5238,5253 ****
    size_hints.height = widget_height;
    size_hints.width = widget_width;
  #else /* not USE_X_TOOLKIT */
!   size_hints.height = PIXEL_HEIGHT (f);
!   size_hints.width = PIXEL_WIDTH (f);
  #endif /* not USE_X_TOOLKIT */
  
!   size_hints.width_inc = FONT_WIDTH (f->output_data.x->font);
!   size_hints.height_inc = f->output_data.x->line_height;
    size_hints.max_width
!     = FRAME_X_DISPLAY_INFO (f)->width - CHAR_TO_PIXEL_WIDTH (f, 0);
    size_hints.max_height
!     = FRAME_X_DISPLAY_INFO (f)->height - CHAR_TO_PIXEL_HEIGHT (f, 0);
  
    /* Calculate the base and minimum sizes.
  
--- 5223,5238 ----
    size_hints.height = widget_height;
    size_hints.width = widget_width;
  #else /* not USE_X_TOOLKIT */
!   size_hints.height = FRAME_PIXEL_HEIGHT (f);
!   size_hints.width = FRAME_PIXEL_WIDTH (f);
  #endif /* not USE_X_TOOLKIT */
  
!   size_hints.width_inc = FRAME_COLUMN_WIDTH (f);
!   size_hints.height_inc = FRAME_LINE_HEIGHT (f);
    size_hints.max_width
!     = FRAME_X_DISPLAY_INFO (f)->width - FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
    size_hints.max_height
!     = FRAME_X_DISPLAY_INFO (f)->height - FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 
0);
  
    /* Calculate the base and minimum sizes.
  
***************
*** 5258,5265 ****
      int base_width, base_height;
      int min_rows = 0, min_cols = 0;
  
!     base_width = CHAR_TO_PIXEL_WIDTH (f, 0);
!     base_height = CHAR_TO_PIXEL_HEIGHT (f, 0);
  
      check_frame_size (f, &min_rows, &min_cols);
  
--- 5243,5250 ----
      int base_width, base_height;
      int min_rows = 0, min_cols = 0;
  
!     base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
!     base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0);
  
      check_frame_size (f, &min_rows, &min_cols);
  
***************
*** 5334,5340 ****
  #endif
  
  #ifdef PWinGravity
!   size_hints.win_gravity = f->output_data.x->win_gravity;
    size_hints.flags |= PWinGravity;
  
    if (user_position)
--- 5319,5325 ----
  #endif
  
  #ifdef PWinGravity
!   size_hints.win_gravity = f->win_gravity;
    size_hints.flags |= PWinGravity;
  
    if (user_position)
***************
*** 7016,7023 ****
    /* see if it really changed size */
    if (grow_size != 0)
      {
!       rows = PIXEL_TO_CHAR_HEIGHT (f, HiWord (grow_size));
!       columns = PIXEL_TO_CHAR_WIDTH (f, LoWord (grow_size));
  
        x_set_window_size (f, 0, columns, rows);
      }
--- 7001,7008 ----
    /* see if it really changed size */
    if (grow_size != 0)
      {
!       rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, HiWord (grow_size));
!       columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, LoWord (grow_size));
  
        x_set_window_size (f, 0, columns, rows);
      }
***************
*** 7069,7075 ****
          InsetRect (&zoom_rect, 8, 4);  /* not too tight */
  
          zoom_rect.right = zoom_rect.left
!         + CHAR_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
  
          SetWindowStandardState (w, &zoom_rect);
        }
--- 7054,7060 ----
          InsetRect (&zoom_rect, 8, 4);  /* not too tight */
  
          zoom_rect.right = zoom_rect.left
!         + FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
  
          SetWindowStandardState (w, &zoom_rect);
        }
***************
*** 7091,7097 ****
        InsetRect (&zoom_rect, 8, 4);  /* not too tight */
  
        zoom_rect.right = zoom_rect.left
!       + CHAR_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
  
        (**((WStateDataHandle) ((WindowPeek) w)->dataHandle)).stdState
        = zoom_rect;
--- 7076,7082 ----
        InsetRect (&zoom_rect, 8, 4);  /* not too tight */
  
        zoom_rect.right = zoom_rect.left
!       + FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
  
        (**((WStateDataHandle) ((WindowPeek) w)->dataHandle)).stdState
        = zoom_rect;
***************
*** 7106,7113 ****
  #else
    port_rect = w->portRect;
  #endif
!   rows = PIXEL_TO_CHAR_HEIGHT (f, port_rect.bottom - port_rect.top);
!   columns = PIXEL_TO_CHAR_WIDTH (f, port_rect.right - port_rect.left);
    x_set_window_size (mwp->mFP, 0, columns, rows);
  
    SetPort (save_port);
--- 7091,7098 ----
  #else
    port_rect = w->portRect;
  #endif
!   rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, port_rect.bottom - 
port_rect.top);
!   columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, port_rect.right - 
port_rect.left);
    x_set_window_size (mwp->mFP, 0, columns, rows);
  
    SetPort (save_port);
***************
*** 8256,8262 ****
  
    mwp->fontset = -1;
  
!   SizeWindow (mwp->mWP, mwp->pixel_width, mwp->pixel_height, false);
    ShowWindow (mwp->mWP);
  
  }
--- 8241,8247 ----
  
    mwp->fontset = -1;
  
!   SizeWindow (mwp->mWP, FRAME_PIXEL_WIDTH (fp), FRAME_PIXEL_HEIGHT (fp), 
false);
    ShowWindow (mwp->mWP);
  
  }
***************
*** 8277,8299 ****
    f->output_data.mac->mouse_pixel = 0xff00ff;
    f->output_data.mac->cursor_foreground_pixel = 0x0000ff;
  
!   f->output_data.mac->fontset = -1;
    f->output_data.mac->scroll_bar_foreground_pixel = -1;
    f->output_data.mac->scroll_bar_background_pixel = -1;
-   f->output_data.mac->left_pos = 4;
-   f->output_data.mac->top_pos = 4;
-   f->output_data.mac->border_width = 0;
    f->output_data.mac->explicit_parent = 0;
  
!   f->output_data.mac->internal_border_width = 0;
  
    f->output_method = output_mac;
  
    f->auto_raise = 1;
    f->auto_lower = 1;
  
!   f->new_width = 0;
!   f->new_height = 0;
  }
  
  void
--- 8262,8284 ----
    f->output_data.mac->mouse_pixel = 0xff00ff;
    f->output_data.mac->cursor_foreground_pixel = 0x0000ff;
  
!   FRAME_FONTSET (f) = -1;
    f->output_data.mac->scroll_bar_foreground_pixel = -1;
    f->output_data.mac->scroll_bar_background_pixel = -1;
    f->output_data.mac->explicit_parent = 0;
+   f->left_pos = 4;
+   f->top_pos = 4;
+   f->border_width = 0;
  
!   f->internal_border_width = 0;
  
    f->output_method = output_mac;
  
    f->auto_raise = 1;
    f->auto_lower = 1;
  
!   f->new_text_cols = 0;
!   f->new_text_lines = 0;
  }
  
  void
***************
*** 8307,8320 ****
    f->output_data.mac = (struct mac_output *)
      xmalloc (sizeof (struct mac_output));
    bzero (f->output_data.mac, sizeof (struct mac_output));
!   f->output_data.mac->fontset = -1;
    f->output_data.mac->scroll_bar_foreground_pixel = -1;
    f->output_data.mac->scroll_bar_background_pixel = -1;
  
    XSETFRAME (FRAME_KBOARD (f)->Vdefault_minibuffer_frame, f);
  
!   f->width = 96;
!   f->height = 4;
  
    make_mac_frame (f);
  
--- 8292,8305 ----
    f->output_data.mac = (struct mac_output *)
      xmalloc (sizeof (struct mac_output));
    bzero (f->output_data.mac, sizeof (struct mac_output));
!   FRAME_FONTSET (f) = -1;
    f->output_data.mac->scroll_bar_foreground_pixel = -1;
    f->output_data.mac->scroll_bar_background_pixel = -1;
  
    XSETFRAME (FRAME_KBOARD (f)->Vdefault_minibuffer_frame, f);
  
!   FRAME_COLS (f) = 96;
!   FRAME_LINES (f) = 4;
  
    make_mac_frame (f);
  




reply via email to

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