/[emacs]/emacs/src/w32term.c
ViewVC logotype

Diff of /emacs/src/w32term.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.125 by kfstorm, Fri Nov 16 13:06:02 2001 UTC revision 1.126 by jasonr, Sun Nov 18 21:53:11 2001 UTC
# Line 407  static void w32_clip_to_row P_ ((struct Line 407  static void w32_clip_to_row P_ ((struct
407                                   HDC, int));                                   HDC, int));
408  static int x_phys_cursor_in_rect_p P_ ((struct window *, RECT *));  static int x_phys_cursor_in_rect_p P_ ((struct window *, RECT *));
409  static void x_draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *));  static void x_draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *));
410  static void note_overwritten_text_cursor P_ ((struct window *, int, int));  static void notice_overwritten_cursor P_ ((struct window *, int, int));
411    
412  static Lisp_Object Qvendor_specific_keysyms;  static Lisp_Object Qvendor_specific_keysyms;
413    
# Line 761  x_after_update_window_line (desired_row) Line 761  x_after_update_window_line (desired_row)
761       struct glyph_row *desired_row;       struct glyph_row *desired_row;
762  {  {
763    struct window *w = updated_window;    struct window *w = updated_window;
764        struct frame *f;
765      int width, height;
766    
767    xassert (w);    xassert (w);
768        
769    if (!desired_row->mode_line_p && !w->pseudo_window_p)    if (!desired_row->mode_line_p && !w->pseudo_window_p)
770      {      {
       struct frame *f;  
       int width;  
   
771        BLOCK_INPUT;        BLOCK_INPUT;
772        x_draw_row_fringe_bitmaps (w, desired_row);        x_draw_row_fringe_bitmaps (w, desired_row);
773          UNBLOCK_INPUT;
774        }
775    
776        /* When a window has disappeared, make sure that no rest of    /* When a window has disappeared, make sure that no rest of
777           full-width rows stays visible in the internal border.  */       full-width rows stays visible in the internal border.  Could
778        if (windows_or_buffers_changed       check here if updated_window is the leftmost/rightmost window,
779            && (f = XFRAME (w->frame),       but I guess it's not worth doing since vertically split windows
780                width = FRAME_INTERNAL_BORDER_WIDTH (f),       are almost never used, internal border is rarely set, and the
781                width != 0))       overhead is very small.  */
782          {    if (windows_or_buffers_changed
783            int height = desired_row->visible_height;        && desired_row->full_width_p
784            int x = (window_box_right (w, -1)        && (f = XFRAME (w->frame),
785                     + FRAME_X_RIGHT_FRINGE_WIDTH (f));            width = FRAME_INTERNAL_BORDER_WIDTH (f),
786            int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y));            width != 0)
787            HDC hdc = get_frame_dc (f);        && (height = desired_row->visible_height,
788              height > 0))
789        {
790          int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y));
791          /* Internal border is drawn below the tool bar.  */
792          if (WINDOWP (f->tool_bar_window)
793              && w == XWINDOW (f->tool_bar_window))
794            y -= width;
795    
796            w32_clear_area (f, hdc, x, y, width, height);        BLOCK_INPUT;
797            release_frame_dc (f, hdc);        {
798          }          HDC hdc = get_frame_dc (f);
799                  w32_clear_area (f, hdc, 0, y, width, height);
800            w32_clear_area (f, hdc, f->output_data.w32->pixel_width - width,
801                            y, width, height);
802            release_frame_dc (f, hdc);
803          }
804        UNBLOCK_INPUT;        UNBLOCK_INPUT;
805      }      }
806  }  }
# Line 2742  static void w32_init_glyph_string P_ ((s Line 2754  static void w32_init_glyph_string P_ ((s
2754                                         enum draw_glyphs_face));                                         enum draw_glyphs_face));
2755  static int x_draw_glyphs P_ ((struct window *, int , struct glyph_row *,  static int x_draw_glyphs P_ ((struct window *, int , struct glyph_row *,
2756                                enum glyph_row_area, int, int,                                enum glyph_row_area, int, int,
2757                                enum draw_glyphs_face, int *, int *, int));                                enum draw_glyphs_face, int));
2758  static void x_set_glyph_string_clipping P_ ((struct glyph_string *));  static void x_set_glyph_string_clipping P_ ((struct glyph_string *));
2759  static void x_set_glyph_string_gc P_ ((struct glyph_string *));  static void x_set_glyph_string_gc P_ ((struct glyph_string *));
2760  static void x_draw_glyph_string_background P_ ((struct glyph_string *,  static void x_draw_glyph_string_background P_ ((struct glyph_string *,
# Line 3619  x_setup_relief_colors (s) Line 3631  x_setup_relief_colors (s)
3631    
3632    if (s->face->use_box_color_for_shadows_p)    if (s->face->use_box_color_for_shadows_p)
3633      color = s->face->box_color;      color = s->face->box_color;
3634      else if (s->first_glyph->type == IMAGE_GLYPH
3635               && !IMAGE_BACKGROUND_TRANSPARENT (s->img, s->f, 0))
3636        color = IMAGE_BACKGROUND  (s->img, s->f, 0);
3637    else    else
3638      color = s->gc->background;      color = s->gc->background;
3639    
# Line 3664  w32_draw_relief_rect (f, left_x, top_y, Line 3679  w32_draw_relief_rect (f, left_x, top_y,
3679    for (i = 0; i < width; ++i)    for (i = 0; i < width; ++i)
3680      w32_fill_area (f, hdc, gc.foreground,      w32_fill_area (f, hdc, gc.foreground,
3681                     left_x + i * left_p, top_y + i,                     left_x + i * left_p, top_y + i,
3682                     (right_x + 1 - i * right_p) - (left_x + i * left_p), 1);                     (right_x + 1 - i * right_p) - (left_x + i * left_p) + 1, 1);
3683    
3684    /* Left.  */    /* Left.  */
3685    if (left_p)    if (left_p)
3686      for (i = 0; i < width; ++i)      for (i = 0; i < width; ++i)
3687        w32_fill_area (f, hdc, gc.foreground,        w32_fill_area (f, hdc, gc.foreground,
3688                       left_x + i, top_y + i, 1,                       left_x + i, top_y + i, 1,
3689                       (bottom_y - i + 1) - (top_y + i));                       (bottom_y - i) - (top_y + i) + 2);
3690    
3691    if (raised_p)    if (raised_p)
3692      gc.foreground = f->output_data.w32->black_relief.gc->foreground;      gc.foreground = f->output_data.w32->black_relief.gc->foreground;
# Line 3682  w32_draw_relief_rect (f, left_x, top_y, Line 3697  w32_draw_relief_rect (f, left_x, top_y,
3697    for (i = 0; i < width; ++i)    for (i = 0; i < width; ++i)
3698      w32_fill_area (f, hdc, gc.foreground,      w32_fill_area (f, hdc, gc.foreground,
3699                     left_x + i * left_p, bottom_y - i,                     left_x + i * left_p, bottom_y - i,
3700                     (right_x + 2 - i * right_p) - (left_x + i * left_p), 1);                     (right_x - i * right_p) - (left_x + i * left_p) + 2, 1);
3701    
3702    /* Right.  */    /* Right.  */
3703    if (right_p)    if (right_p)
3704      for (i = 0; i < width; ++i)      for (i = 0; i < width; ++i)
3705        w32_fill_area (f, hdc, gc.foreground,        w32_fill_area (f, hdc, gc.foreground,
3706                       right_x - i, top_y + i + 1, 1,                       right_x - i, top_y + i + 1, 1,
3707                       (bottom_y - i) - (top_y + i + 1));                       (bottom_y - i) - (top_y + i));
3708    
3709    w32_set_clip_rectangle (hdc, NULL);    w32_set_clip_rectangle (hdc, NULL);
3710        
# Line 3923  x_draw_image_relief (s) Line 3938  x_draw_image_relief (s)
3938    if (s->hl == DRAW_IMAGE_SUNKEN    if (s->hl == DRAW_IMAGE_SUNKEN
3939        || s->hl == DRAW_IMAGE_RAISED)        || s->hl == DRAW_IMAGE_RAISED)
3940      {      {
3941        thick = tool_bar_button_relief > 0 ? tool_bar_button_relief : 3;        thick = tool_bar_button_relief >= 0 ? tool_bar_button_relief : 3;
3942        raised_p = s->hl == DRAW_IMAGE_RAISED;        raised_p = s->hl == DRAW_IMAGE_RAISED;
3943      }      }
3944    else    else
# Line 4647  x_set_glyph_string_background_width (s, Line 4662  x_set_glyph_string_background_width (s,
4662                 || s->face->background != default_face->background                 || s->face->background != default_face->background
4663                 || s->face->stipple != default_face->stipple                 || s->face->stipple != default_face->stipple
4664                 || s->row->mouse_face_p))                 || s->row->mouse_face_p))
4665            || s->hl == DRAW_MOUSE_FACE))            || s->hl == DRAW_MOUSE_FACE
4666              || ((s->hl == DRAW_IMAGE_RAISED || s->hl == DRAW_IMAGE_SUNKEN)
4667                  && s->row->fill_line_p)))
4668      s->extends_to_end_of_line_p = 1;      s->extends_to_end_of_line_p = 1;
4669        
4670    /* If S extends its face to the end of the line, set its    /* If S extends its face to the end of the line, set its
# Line 4849  x_set_glyph_string_background_width (s, Line 4866  x_set_glyph_string_background_width (s,
4866     DRAW_IMAGE_SUNKEN    draw an image with a sunken relief around it     DRAW_IMAGE_SUNKEN    draw an image with a sunken relief around it
4867     DRAW_IMAGE_RAISED    draw an image with a raised relief around it     DRAW_IMAGE_RAISED    draw an image with a raised relief around it
4868    
    If REAL_START is non-null, return in *REAL_START the real starting  
    position for display.  This can be different from START in case  
    overlapping glyphs must be displayed.  If REAL_END is non-null,  
    return in *REAL_END the real end position for display.  This can be  
    different from END in case overlapping glyphs must be displayed.  
   
4869     If OVERLAPS_P is non-zero, draw only the foreground of characters     If OVERLAPS_P is non-zero, draw only the foreground of characters
4870     and clip to the physical height of ROW.     and clip to the physical height of ROW.
4871    
4872     Value is the x-position reached, relative to AREA of W.  */     Value is the x-position reached, relative to AREA of W.  */
4873            
4874  static int  static int
4875  x_draw_glyphs (w, x, row, area, start, end, hl, real_start, real_end,  x_draw_glyphs (w, x, row, area, start, end, hl, overlaps_p)
                overlaps_p)  
4876       struct window *w;       struct window *w;
4877       int x;       int x;
4878       struct glyph_row *row;       struct glyph_row *row;
4879       enum glyph_row_area area;       enum glyph_row_area area;
4880       int start, end;       int start, end;
4881       enum draw_glyphs_face hl;       enum draw_glyphs_face hl;
      int *real_start, *real_end;  
4882       int overlaps_p;       int overlaps_p;
4883  {  {
4884    struct glyph_string *head, *tail;    struct glyph_string *head, *tail;
# Line 4883  x_draw_glyphs (w, x, row, area, start, e Line 4892  x_draw_glyphs (w, x, row, area, start, e
4892    end = min (end, row->used[area]);    end = min (end, row->used[area]);
4893    start = max (0, start);    start = max (0, start);
4894    start = min (end, start);    start = min (end, start);
   if (real_start)  
     *real_start = start;  
   if (real_end)  
     *real_end = end;  
4895    
4896    /* Translate X to frame coordinates.  Set last_x to the right    /* Translate X to frame coordinates.  Set last_x to the right
4897       end of the drawing area.  */       end of the drawing area.  */
# Line 4958  x_draw_glyphs (w, x, row, area, start, e Line 4963  x_draw_glyphs (w, x, row, area, start, e
4963                                 DRAW_NORMAL_TEXT, dummy_x, last_x,                                 DRAW_NORMAL_TEXT, dummy_x, last_x,
4964                                 overlaps_p);                                 overlaps_p);
4965            start = i;            start = i;
           if (real_start)  
             *real_start = start;  
4966            x_compute_overhangs_and_x (t, head->x, 1);            x_compute_overhangs_and_x (t, head->x, 1);
4967            x_prepend_glyph_string_lists (&head, &tail, h, t);            x_prepend_glyph_string_lists (&head, &tail, h, t);
4968          }          }
# Line 4979  x_draw_glyphs (w, x, row, area, start, e Line 4982  x_draw_glyphs (w, x, row, area, start, e
4982                                 overlaps_p);                                 overlaps_p);
4983            for (s = h; s; s = s->next)            for (s = h; s; s = s->next)
4984              s->background_filled_p = 1;              s->background_filled_p = 1;
           if (real_start)  
             *real_start = i;  
4985            x_compute_overhangs_and_x (t, head->x, 1);            x_compute_overhangs_and_x (t, head->x, 1);
4986            x_prepend_glyph_string_lists (&head, &tail, h, t);            x_prepend_glyph_string_lists (&head, &tail, h, t);
4987          }          }
# Line 4997  x_draw_glyphs (w, x, row, area, start, e Line 4998  x_draw_glyphs (w, x, row, area, start, e
4998                                 overlaps_p);                                 overlaps_p);
4999            x_compute_overhangs_and_x (h, tail->x + tail->width, 0);            x_compute_overhangs_and_x (h, tail->x + tail->width, 0);
5000            x_append_glyph_string_lists (&head, &tail, h, t);            x_append_glyph_string_lists (&head, &tail, h, t);
           if (real_end)  
             *real_end = i;  
5001          }          }
5002    
5003        /* Append glyph strings for glyphs following the last glyph        /* Append glyph strings for glyphs following the last glyph
# Line 5016  x_draw_glyphs (w, x, row, area, start, e Line 5015  x_draw_glyphs (w, x, row, area, start, e
5015              s->background_filled_p = 1;              s->background_filled_p = 1;
5016            x_compute_overhangs_and_x (h, tail->x + tail->width, 0);            x_compute_overhangs_and_x (h, tail->x + tail->width, 0);
5017            x_append_glyph_string_lists (&head, &tail, h, t);            x_append_glyph_string_lists (&head, &tail, h, t);
           if (real_end)  
             *real_end = i;  
5018          }          }
5019      }      }
5020    
# Line 5025  x_draw_glyphs (w, x, row, area, start, e Line 5022  x_draw_glyphs (w, x, row, area, start, e
5022    for (s = head; s; s = s->next)    for (s = head; s; s = s->next)
5023      x_draw_glyph_string (s);      x_draw_glyph_string (s);
5024    
5025      if (area == TEXT_AREA && !row->full_width_p)
5026        {
5027          int x0 = head ? head->x : x;
5028          int x1 = tail ? tail->x + tail->background_width : x;
5029          
5030          x0 = FRAME_TO_WINDOW_PIXEL_X (w, x0);
5031          x1 = FRAME_TO_WINDOW_PIXEL_X (w, x1);
5032          
5033          if (!row->full_width_p && XFASTINT (w->left_margin_width) != 0)
5034            {
5035              int left_area_width = window_box_width (w, LEFT_MARGIN_AREA);
5036              x0 -= left_area_width;
5037              x1 -= left_area_width;
5038            }
5039    
5040          notice_overwritten_cursor (w, x0, x1);
5041        }
5042    
5043    /* Value is the x-position up to which drawn, relative to AREA of W.    /* Value is the x-position up to which drawn, relative to AREA of W.
5044       This doesn't include parts drawn because of overhangs.  */       This doesn't include parts drawn because of overhangs.  */
5045    x_reached = FRAME_TO_WINDOW_PIXEL_X (w, x_reached);    x_reached = FRAME_TO_WINDOW_PIXEL_X (w, x_reached);
# Line 5077  x_fix_overlapping_area (w, row, area) Line 5092  x_fix_overlapping_area (w, row, area)
5092                   && row->glyphs[area][i].overlaps_vertically_p);                   && row->glyphs[area][i].overlaps_vertically_p);
5093    
5094            x_draw_glyphs (w, start_x, row, area, start, i,            x_draw_glyphs (w, start_x, row, area, start, i,
5095                           DRAW_NORMAL_TEXT,                           DRAW_NORMAL_TEXT, 1);
                          NULL, NULL, 1);  
5096          }          }
5097        else        else
5098          {          {
# Line 5102  x_write_glyphs (start, len) Line 5116  x_write_glyphs (start, len)
5116       struct glyph *start;       struct glyph *start;
5117       int len;       int len;
5118  {  {
5119    int x, hpos, real_start, real_end;    int x, hpos;
5120    
5121    xassert (updated_window && updated_row);    xassert (updated_window && updated_row);
5122    BLOCK_INPUT;    BLOCK_INPUT;
# Line 5113  x_write_glyphs (start, len) Line 5127  x_write_glyphs (start, len)
5127    x = x_draw_glyphs (updated_window, output_cursor.x,    x = x_draw_glyphs (updated_window, output_cursor.x,
5128                       updated_row, updated_area,                       updated_row, updated_area,
5129                       hpos, hpos + len,                       hpos, hpos + len,
5130                       DRAW_NORMAL_TEXT,                       DRAW_NORMAL_TEXT, 0);
                      &real_start, &real_end, 0);  
   
   /* If we drew over the cursor, note that it is not visible any more.  */  
   note_overwritten_text_cursor (updated_window, real_start,  
                                 real_end - real_start);  
5131    
5132    UNBLOCK_INPUT;    UNBLOCK_INPUT;
5133        
# Line 5140  x_insert_glyphs (start, len) Line 5149  x_insert_glyphs (start, len)
5149    int line_height, shift_by_width, shifted_region_width;    int line_height, shift_by_width, shifted_region_width;
5150    struct glyph_row *row;    struct glyph_row *row;
5151    struct glyph *glyph;    struct glyph *glyph;
5152    int frame_x, frame_y, hpos, real_start, real_end;    int frame_x, frame_y, hpos;
5153    HDC hdc;    HDC hdc;
5154    
5155    xassert (updated_window && updated_row);    xassert (updated_window && updated_row);
# Line 5173  x_insert_glyphs (start, len) Line 5182  x_insert_glyphs (start, len)
5182    /* Write the glyphs.  */    /* Write the glyphs.  */
5183    hpos = start - row->glyphs[updated_area];    hpos = start - row->glyphs[updated_area];
5184    x_draw_glyphs (w, output_cursor.x, row, updated_area, hpos, hpos + len,    x_draw_glyphs (w, output_cursor.x, row, updated_area, hpos, hpos + len,
5185                   DRAW_NORMAL_TEXT, &real_start, &real_end, 0);                   DRAW_NORMAL_TEXT, 0);
5186    note_overwritten_text_cursor (w, real_start, real_end - real_start);  
     
5187    /* Advance the output cursor.  */    /* Advance the output cursor.  */
5188    output_cursor.hpos += len;    output_cursor.hpos += len;
5189    output_cursor.x += shift_by_width;    output_cursor.x += shift_by_width;
# Line 5249  x_clear_end_of_line (to_x) Line 5257  x_clear_end_of_line (to_x)
5257        
5258    /* Notice if the cursor will be cleared by this operation.  */    /* Notice if the cursor will be cleared by this operation.  */
5259    if (!updated_row->full_width_p)    if (!updated_row->full_width_p)
5260      note_overwritten_text_cursor (w, output_cursor.hpos, -1);      notice_overwritten_cursor (w, output_cursor.x, -1);
5261    
5262    from_x = output_cursor.x;    from_x = output_cursor.x;
5263            
# Line 5575  expose_area (w, row, r, area) Line 5583  expose_area (w, row, r, area)
5583      /* If row extends face to end of line write the whole line.  */      /* If row extends face to end of line write the whole line.  */
5584      x_draw_glyphs (w, 0, row, area,      x_draw_glyphs (w, 0, row, area,
5585                     0, row->used[area],                     0, row->used[area],
5586                     DRAW_NORMAL_TEXT,                     DRAW_NORMAL_TEXT, 0);
                    NULL, NULL, 0);  
5587    else    else
5588      {      {
5589        /* Set START_X to the window-relative start position for drawing glyphs of        /* Set START_X to the window-relative start position for drawing glyphs of
# Line 5614  expose_area (w, row, r, area) Line 5621  expose_area (w, row, r, area)
5621          x_draw_glyphs (w, first_x - start_x, row, area,          x_draw_glyphs (w, first_x - start_x, row, area,
5622                         first - row->glyphs[area],                         first - row->glyphs[area],
5623                         last - row->glyphs[area],                         last - row->glyphs[area],
5624                         DRAW_NORMAL_TEXT,                         DRAW_NORMAL_TEXT, 0);
                        NULL, NULL, 0);  
5625      }      }
5626  }  }
5627    
# Line 5634  expose_line (w, row, r) Line 5640  expose_line (w, row, r)
5640        
5641    if (row->mode_line_p || w->pseudo_window_p)    if (row->mode_line_p || w->pseudo_window_p)
5642      x_draw_glyphs (w, 0, row, TEXT_AREA, 0, row->used[TEXT_AREA],      x_draw_glyphs (w, 0, row, TEXT_AREA, 0, row->used[TEXT_AREA],
5643                     DRAW_NORMAL_TEXT, NULL, NULL, 0);                     DRAW_NORMAL_TEXT, 0);
5644    else    else
5645      {      {
5646        if (row->used[LEFT_MARGIN_AREA])        if (row->used[LEFT_MARGIN_AREA])
# Line 6738  note_mouse_highlight (f, x, y) Line 6744  note_mouse_highlight (f, x, y)
6744                  {                  {
6745                    Lisp_Object before = Foverlay_start (overlay);                    Lisp_Object before = Foverlay_start (overlay);
6746                    Lisp_Object after = Foverlay_end (overlay);                    Lisp_Object after = Foverlay_end (overlay);
6747                    Lisp_Object ignore;                    int ignore;
6748    
6749                    /* Note that we might not be able to find position                    /* Note that we might not be able to find position
6750                       BEFORE in the glyph matrix if the overlay is                       BEFORE in the glyph matrix if the overlay is
# Line 7344  show_mouse_face (dpyinfo, draw) Line 7350  show_mouse_face (dpyinfo, draw)
7350  {  {
7351    struct window *w = XWINDOW (dpyinfo->mouse_face_window);    struct window *w = XWINDOW (dpyinfo->mouse_face_window);
7352    struct frame *f = XFRAME (WINDOW_FRAME (w));    struct frame *f = XFRAME (WINDOW_FRAME (w));
   int i;  
   int cursor_off_p = 0;  
   struct cursor_pos saved_cursor;  
   
   saved_cursor = output_cursor;  
7353        
7354    /* If window is in the process of being destroyed, don't bother    if (/* If window is in the process of being destroyed, don't bother
7355       to do anything.  */           to do anything.  */
7356    if (w->current_matrix == NULL)        w->current_matrix != NULL
7357      goto set_x_cursor;        /* Recognize when we are called to operate on rows that don't exist
7358             anymore.  This can happen when a window is split.  */
7359    /* Recognize when we are called to operate on rows that don't exist        && dpyinfo->mouse_face_end_row < w->current_matrix->nrows)
      anymore.  This can happen when a window is split.  */  
   if (dpyinfo->mouse_face_end_row >= w->current_matrix->nrows)  
     goto set_x_cursor;  
   
   set_output_cursor (&w->phys_cursor);  
   
   /* Note that mouse_face_beg_row etc. are window relative.  */  
   for (i = dpyinfo->mouse_face_beg_row;  
        i <= dpyinfo->mouse_face_end_row;  
        i++)  
7360      {      {
7361        int start_hpos, end_hpos, start_x;        int phys_cursor_on_p = w->phys_cursor_on_p;
7362        struct glyph_row *row = MATRIX_ROW (w->current_matrix, i);        struct glyph_row *row, *first, *last;
7363    
7364        /* Don't do anything if row doesn't have valid contents.  */        first = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_beg_row);
7365        if (!row->enabled_p)        last = MATRIX_ROW (w->current_matrix, dpyinfo->mouse_face_end_row);
7366          continue;        
7367          for (row = first; row <= last && row->enabled_p; ++row)
       /* For all but the first row, the highlight starts at column 0.  */  
       if (i == dpyinfo->mouse_face_beg_row)  
         {  
           start_hpos = dpyinfo->mouse_face_beg_col;  
           start_x = dpyinfo->mouse_face_beg_x;  
         }  
       else  
7368          {          {
7369            start_hpos = 0;            int start_hpos, end_hpos, start_x;
           start_x = 0;  
         }  
7370    
7371        if (i == dpyinfo->mouse_face_end_row)            /* For all but the first row, the highlight starts at column 0.  */
7372          end_hpos = dpyinfo->mouse_face_end_col;            if (row == first)
7373        else              {
7374          end_hpos = row->used[TEXT_AREA];                start_hpos = dpyinfo->mouse_face_beg_col;
7375                  start_x = dpyinfo->mouse_face_beg_x;
7376                }
7377              else
7378                {
7379                  start_hpos = 0;
7380                  start_x = 0;
7381                }
7382    
7383        /* If the cursor's in the text we are about to rewrite, turn the            if (row == last)
7384           cursor off.  */              end_hpos = dpyinfo->mouse_face_end_col;
7385        if (!w->pseudo_window_p            else
7386            && i == output_cursor.vpos              end_hpos = row->used[TEXT_AREA];
           && output_cursor.hpos >= start_hpos - 1  
           && output_cursor.hpos <= end_hpos)  
         {  
           x_update_window_cursor (w, 0);  
           cursor_off_p = 1;  
         }  
7387    
7388        if (end_hpos > start_hpos)            if (end_hpos > start_hpos)
7389          {              {
7390            x_draw_glyphs (w, start_x, row, TEXT_AREA,                x_draw_glyphs (w, start_x, row, TEXT_AREA,
7391                           start_hpos, end_hpos, draw, NULL, NULL, 0);                               start_hpos, end_hpos, draw, 0);
           row->mouse_face_p = draw == DRAW_MOUSE_FACE || DRAW_IMAGE_RAISED;  
         }  
     }  
7392    
7393    /* If we turned the cursor off, turn it back on.  */                row->mouse_face_p = draw == DRAW_MOUSE_FACE || DRAW_IMAGE_RAISED;
7394    if (cursor_off_p)              }
7395      x_display_cursor (w, 1,          }
                       output_cursor.hpos, output_cursor.vpos,  
                       output_cursor.x, output_cursor.y);  
7396    
7397    output_cursor = saved_cursor;        /* When we've written over the cursor, arrange for it to
7398             be displayed again.  */
7399          if (phys_cursor_on_p && !w->phys_cursor_on_p)
7400            x_display_cursor (w, 1,
7401                              w->phys_cursor.hpos, w->phys_cursor.vpos,
7402                              w->phys_cursor.x, w->phys_cursor.y);
7403        }
7404    
  set_x_cursor:  
7405  #if 0 /* TODO: mouse cursor */  #if 0 /* TODO: mouse cursor */
7406    /* Change the mouse cursor.  */    /* Change the mouse cursor.  */
7407    if (draw == DRAW_NORMAL_TEXT)    if (draw == DRAW_NORMAL_TEXT)
# Line 7431  show_mouse_face (dpyinfo, draw) Line 7414  show_mouse_face (dpyinfo, draw)
7414      XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),      XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
7415                     f->output_data.x->nontext_cursor);                     f->output_data.x->nontext_cursor);
7416  #endif  #endif
   ;  
7417  }  }
7418    
7419  /* Clear out the mouse-highlighted active region.  /* Clear out the mouse-highlighted active region.
# Line 7521  glyph_rect (f, x, y, rect) Line 7503  glyph_rect (f, x, y, rect)
7503        struct window *w = XWINDOW (window);        struct window *w = XWINDOW (window);
7504        struct glyph_row *r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);        struct glyph_row *r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
7505        struct glyph_row *end = r + w->current_matrix->nrows - 1;        struct glyph_row *end = r + w->current_matrix->nrows - 1;
       int area;  
7506    
7507        frame_to_window_pixel_xy (w, &x, &y);        frame_to_window_pixel_xy (w, &x, &y);
7508                
# Line 8004  w32_set_vertical_scroll_bar (w, portion, Line 7985  w32_set_vertical_scroll_bar (w, portion,
7985      {      {
7986        HDC hdc;        HDC hdc;
7987        BLOCK_INPUT;        BLOCK_INPUT;
7988        if (width && height)        if (width > 0 && height > 0)
7989          {          {
7990            hdc = get_frame_dc (f);            hdc = get_frame_dc (f);
7991            w32_clear_area (f, hdc, left, top, width, height);            w32_clear_area (f, hdc, left, top, width, height);
# Line 9152  w32_read_socket (sd, bufp, numchars, exp Line 9133  w32_read_socket (sd, bufp, numchars, exp
9133                               Text Cursor                               Text Cursor
9134   ***********************************************************************/   ***********************************************************************/
9135    
9136  /* Note if the text cursor of window W has been overwritten by a  /* Notice if the text cursor of window W has been overwritten by a
9137     drawing operation that outputs N glyphs starting at HPOS in the     drawing operation that outputs glyphs starting at START_X and
9138     line given by output_cursor.vpos.  N < 0 means all the rest of the     ending at END_X in the line given by output_cursor.vpos.
9139     line after HPOS has been written.  */     Coordinates are area-relative.  END_X < 0 means all the rest
9140       of the line after START_X has been written.  */
9141    
9142  static void  static void
9143  note_overwritten_text_cursor (w, hpos, n)  notice_overwritten_cursor (w, start_x, end_x)
9144       struct window *w;       struct window *w;
9145       int hpos, n;       int start_x, end_x;
9146  {  {
9147    if (updated_area == TEXT_AREA    if (updated_area == TEXT_AREA
9148          && w->phys_cursor_on_p
9149        && output_cursor.vpos == w->phys_cursor.vpos        && output_cursor.vpos == w->phys_cursor.vpos
9150        && hpos <= w->phys_cursor.hpos        && start_x <= w->phys_cursor.x
9151        && (n < 0        && (end_x < 0 || end_x > w->phys_cursor.x))
           || hpos + n > w->phys_cursor.hpos))  
9152      w->phys_cursor_on_p = 0;      w->phys_cursor_on_p = 0;
9153  }  }
9154    
# Line 9292  x_draw_bar_cursor (w, row, width) Line 9274  x_draw_bar_cursor (w, row, width)
9274      }      }
9275    else    else
9276      {      {
9277          COLORREF cursor_color = f->output_data.w32->cursor_pixel;
9278          struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id);
9279    
9280        if (width < 0)        if (width < 0)
9281          width = f->output_data.w32->cursor_width;          width = f->output_data.w32->cursor_width;
9282    
9283          /* If the glyph's background equals the color we normally draw
9284             the bar cursor in, the bar cursor in its normal color is
9285             invisible.  Use the glyph's foreground color instead in this
9286             case, on the assumption that the glyph's colors are chosen so
9287             that the glyph is legible.  */
9288          if (face->background == cursor_color)
9289            cursor_color = face->foreground;
9290    
9291        x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);        x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
9292        hdc = get_frame_dc (f);        hdc = get_frame_dc (f);
9293        w32_clip_to_row (w, row, hdc, 0);        w32_clip_to_row (w, row, hdc, 0);
9294        w32_fill_area (f, hdc, f->output_data.w32->cursor_pixel,        w32_fill_area (f, hdc, cursor_color, x,
                      x,  
9295                       WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),                       WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
9296                       min (cursor_glyph->pixel_width, width),                       min (cursor_glyph->pixel_width, width),
9297                       row->height);                       row->height);
# Line 9335  x_draw_phys_cursor_glyph (w, row, hl) Line 9327  x_draw_phys_cursor_glyph (w, row, hl)
9327       glyphs and mini-buffer.  */       glyphs and mini-buffer.  */
9328    if (w->phys_cursor.hpos < row->used[TEXT_AREA])    if (w->phys_cursor.hpos < row->used[TEXT_AREA])
9329      {      {
9330          int on_p = w->phys_cursor_on_p;
9331        x_draw_glyphs (w, w->phys_cursor.x, row, TEXT_AREA,        x_draw_glyphs (w, w->phys_cursor.x, row, TEXT_AREA,
9332                       w->phys_cursor.hpos, w->phys_cursor.hpos + 1,                       w->phys_cursor.hpos, w->phys_cursor.hpos + 1,
9333                       hl, 0, 0, 0);                       hl, 0);
9334          w->phys_cursor_on_p = on_p;
9335    
9336        /* When we erase the cursor, and ROW is overlapped by other        /* When we erase the cursor, and ROW is overlapped by other
9337           rows, make sure that these overlapping parts of other rows           rows, make sure that these overlapping parts of other rows
# Line 9541  x_display_and_set_cursor (w, on, hpos, v Line 9535  x_display_and_set_cursor (w, on, hpos, v
9535          new_cursor_type = FRAME_DESIRED_CURSOR (f);          new_cursor_type = FRAME_DESIRED_CURSOR (f);
9536        else        else
9537          {          {
9538            new_cursor_type = HOLLOW_BOX_CURSOR;            if (cursor_non_selected)
9539                new_cursor_type = HOLLOW_BOX_CURSOR;
9540              else
9541                new_cursor_type = NO_CURSOR;
9542            active_cursor = 0;            active_cursor = 0;
9543          }          }
9544      }      }

Legend:
Removed from v.1.125  
changed lines
  Added in v.1.126

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26