Changeset 3057

Show
Ignore:
Timestamp:
03/11/03 00:17:50 (6 years ago)
Author:
miyoshi
Message:

(mw32_draw_glyphs): Change the condition to correct
the row position. Sync up with Emacs-21.3.50.
(mw32_draw_glyphs): Call notice_overwritten_cursor().
(mw32i_write_glyphs): Invalidate old phys cursor if the glyph at
its hpos is redrawn. Sync up with Emacs-21.3.50.
(mw32i_insert_glyphs): Don't call notice_overwritten_cursor().
(notice_overwritten_cursor): Sync up with Emacs-21.3.50.
(mw32_erase_phys_cursor): If row is completely invisible, don't

attempt to delete a cursor which isn't there. Sync up with
Emacs-21.3.50.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • work/cvs2svn/src/ChangeLog.Meadow

    r3055 r3057  
     12003-03-11  MIYOSHI Masanori  <miyoshi@boreas.dti.ne.jp> 
     2 
     3        * mw32term.c (mw32_draw_glyphs): Change the condition to correct 
     4        the row position. Sync up with Emacs-21.3.50. 
     5        (mw32_draw_glyphs): Call notice_overwritten_cursor(). 
     6        (mw32i_write_glyphs): Invalidate old phys cursor if the glyph at 
     7        its hpos is redrawn. Sync up with Emacs-21.3.50. 
     8        (mw32i_insert_glyphs): Don't call notice_overwritten_cursor(). 
     9        (notice_overwritten_cursor): Sync up with Emacs-21.3.50. 
     10        (mw32_erase_phys_cursor): If row is completely invisible, don't 
     11         attempt to delete a cursor which isn't there. Sync up with 
     12         Emacs-21.3.50. 
     13 
    1142003-03-09  MIYOSHI Masanori  <miyoshi@boreas.dti.ne.jp> 
    215 
  • work/cvs2svn/src/mw32term.c

    r3048 r3057  
    419419static void note_mouse_highlight P_ ((struct frame *, int, int)); 
    420420static void note_tool_bar_highlight P_ ((struct frame *f, int, int)); 
    421 static void notice_overwritten_cursor P_ ((struct window *, int, int)); 
     421static void notice_overwritten_cursor P_ ((struct window *, 
     422                                           enum glyph_row_area, 
     423                                           int, int, int, int)); 
    422424static void show_mouse_face P_ ((struct mw32_display_info *, 
    423425                                 enum draw_glyphs_face)); 
     
    49834985      x1 = FRAME_TO_WINDOW_PIXEL_X (w, x1); 
    49844986       
    4985       if (XFASTINT (w->left_margin_width) != 0) 
     4987      if (!row->full_width_p && XFASTINT (w->left_margin_width) != 0) 
    49864988        { 
    49874989          int left_area_width = window_box_width (w, LEFT_MARGIN_AREA); 
     
    49894991          x1 -= left_area_width; 
    49904992        } 
    4991       if (updated_area == TEXT_AREA 
    4992           && w->phys_cursor_on_p 
    4993           && output_cursor.vpos == w->phys_cursor.vpos 
    4994           && x0 <= w->phys_cursor.x 
    4995           && (x1 < 0 || x1 > w->phys_cursor.x)) 
    4996         w->phys_cursor_on_p = 0; 
     4993 
     4994      notice_overwritten_cursor (w, area, x0, x1, 
     4995                                 row->y, MATRIX_ROW_BOTTOM_Y (row)); 
    49974996    } 
    49984997   
     
    50855084                        &real_start, &real_end, 0); 
    50865085 
    5087   /* If we drew over the cursor, note that it is not visible any more.  */ 
    5088   notice_overwritten_cursor (updated_window, real_start, 
    5089                                 real_end - real_start); 
     5086  /* Invalidate old phys cursor if the glyph at its hpos is redrawn.  */ 
     5087  if (updated_area == TEXT_AREA 
     5088      && updated_window->phys_cursor_on_p 
     5089      && updated_window->phys_cursor.vpos == output_cursor.vpos 
     5090      && updated_window->phys_cursor.hpos >= hpos 
     5091      && updated_window->phys_cursor.hpos < hpos + len) 
     5092    updated_window->phys_cursor_on_p = 0; 
     5093 
    50905094  /* If we should require GdiFlush(), 
    50915095     insert here.  */ 
     
    51435147  mw32_draw_glyphs (w, output_cursor.x, row, updated_area, hpos, hpos + len, 
    51445148                    DRAW_NORMAL_TEXT, &real_start, &real_end, 0); 
    5145   notice_overwritten_cursor (w, real_start, real_end - real_start); 
    51465149   
    51475150  /* Advance the output cursor.  */ 
     
    52065209  /* Notice if the cursor will be cleared by this operation.  */ 
    52075210  if (!updated_row->full_width_p) 
    5208     notice_overwritten_cursor (w, output_cursor.hpos, -1); 
     5211    notice_overwritten_cursor (w, updated_area, 
     5212                               output_cursor.x, -1, 
     5213                               updated_row->y, 
     5214                               MATRIX_ROW_BOTTOM_Y (updated_row)); 
    52095215 
    52105216  from_x = output_cursor.x; 
     
    89938999 ***********************************************************************/ 
    89949000 
    8995 /* Notice if the text cursor of window W has been overwritten by a 
    8996    drawing operation that outputs N glyphs starting at HPOS in the 
    8997    line given by output_cursor.vpos. 
    8998  
    8999    N < 0 means all the rest of the line after HPOS has been 
    9000    written.  */ 
     9001/* Notice when the text cursor of window W has been completely 
     9002   overwritten by a drawing operation that outputs glyphs in AREA 
     9003   starting at X0 and ending at X1 in the line starting at Y0 and 
     9004   ending at Y1.  X coordinates are area-relative.  X1 < 0 means all 
     9005   the rest of the line after X0 has been written.  Y coordinates 
     9006   are window-relative.  */ 
    90019007 
    90029008static void 
    9003 notice_overwritten_cursor (struct window *w, 
    9004                            int hpos, int n) 
    9005 
    9006   if (updated_area == TEXT_AREA 
    9007       && output_cursor.vpos == w->phys_cursor.vpos 
    9008       && output_cursor.x <= w->phys_cursor.x 
    9009       && w->phys_cursor_on_p) 
    9010     { 
    9011       if (n < 0) 
    9012         w->phys_cursor_on_p = 0; 
    9013       else 
    9014         { 
    9015           /* It depends on the width of the N glyphs written at HPOS 
    9016              if the cursor has been overwritten or not.  */ 
    9017           struct glyph *glyph = &updated_row->glyphs[TEXT_AREA][hpos]; 
    9018           struct glyph *end = glyph + n; 
    9019           int width = 0; 
    9020  
    9021           for (; glyph < end; ++glyph) 
    9022             width += glyph->pixel_width; 
    9023  
    9024           if (output_cursor.x + width > w->phys_cursor.x) 
     9009notice_overwritten_cursor (w, area, x0, x1, y0, y1) 
     9010     struct window *w; 
     9011     enum glyph_row_area area; 
     9012     int x0, x1, y0, y1; 
     9013
     9014  if (area == TEXT_AREA && w->phys_cursor_on_p) 
     9015    { 
     9016      struct frame *f = XFRAME (WINDOW_FRAME (w)); 
     9017      int cx0 = w->phys_cursor.x; 
     9018      int cx1 = cx0 + f->output_data.mw32->cursor_width; 
     9019      int cy0 = w->phys_cursor.y; 
     9020      int cy1 = cy0 + w->phys_cursor_height; 
     9021 
     9022      if (x0 <= cx0 && (x1 < 0 || x1 >= cx1)) 
     9023        { 
     9024          /* The cursor image will be completely removed from the 
     9025             screen if the output area intersects the cursor area in 
     9026             y-direction.  When we draw in [y0 y1[, and some part of 
     9027             the cursor is at y < y0, that part must have been drawn 
     9028             before.  When scrolling, the cursor is erased before 
     9029             actually scrolling, so we don't come here.  When not 
     9030             scrolling, the rows above the old cursor row must have 
     9031             changed, and in this case these rows must have written 
     9032             over the cursor image. 
     9033 
     9034             Likewise if part of the cursor is below y1, with the 
     9035             exception of the cursor being in the first blank row at 
     9036             the buffer and window end because update_text_area 
     9037             doesn't draw that row.  (Except when it does, but 
     9038             that's handled in update_text_area.)  */ 
     9039 
     9040          if (((y0 >= cy0 && y0 < cy1) || (y1 > cy0 && y1 < cy1)) 
     9041              && w->current_matrix->rows[w->phys_cursor.vpos].displays_text_p) 
    90259042            w->phys_cursor_on_p = 0; 
    90269043        } 
     
    92209237    { 
    92219238      int on_p = w->phys_cursor_on_p; 
    9222        
     9239 
    92239240      mw32_draw_glyphs (w, w->phys_cursor.x, row, TEXT_AREA, 
    92249241                        w->phys_cursor.hpos, w->phys_cursor.hpos + 1, 
    92259242                        hl, 0, 0, 0); 
    92269243      w->phys_cursor_on_p = on_p; 
    9227        
     9244 
    92289245      /* When we erase the cursor, and ROW is overlapped by other 
    92299246         rows, make sure that these overlapping parts of other rows 
     
    92749291    goto mark_cursor_off; 
    92759292   
     9293  /* If row is completely invisible, don't attempt to delete a cursor which 
     9294     isn't there.  This may happen if cursor is at top of window, and 
     9295     we switch to a buffer with a header line in that window.  */ 
     9296  if (cursor_row->visible_height <= 0) 
     9297    goto mark_cursor_off; 
     9298 
    92769299  /* This can happen when the new row is shorter than the old one. 
    92779300     In this case, either x_draw_glyphs or clear_end_of_line