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

Diff of /emacs/src/macterm.c

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

revision 1.17 by akochoi, Sun Aug 25 16:40:40 2002 UTC revision 1.18 by kfstorm, Fri Aug 30 12:02:10 2002 UTC
# Line 419  void x_wm_set_icon_pixmap P_ ((struct fr Line 419  void x_wm_set_icon_pixmap P_ ((struct fr
419  void mac_initialize P_ ((void));  void mac_initialize P_ ((void));
420  static void x_font_min_bounds P_ ((XFontStruct *, int *, int *));  static void x_font_min_bounds P_ ((XFontStruct *, int *, int *));
421  static int x_compute_min_glyph_bounds P_ ((struct frame *));  static int x_compute_min_glyph_bounds P_ ((struct frame *));
 enum text_cursor_kinds x_specified_cursor_type P_ ((Lisp_Object, int *));  
422  static void x_draw_phys_cursor_glyph P_ ((struct window *,  static void x_draw_phys_cursor_glyph P_ ((struct window *,
423                                            struct glyph_row *,                                            struct glyph_row *,
424                                            enum draw_glyphs_face));                                            enum draw_glyphs_face));
# Line 9049  x_draw_bar_cursor (w, row, width) Line 9048  x_draw_bar_cursor (w, row, width)
9048          }          }
9049    
9050        if (width < 0)        if (width < 0)
9051          width = f->output_data.mac->cursor_width;          width = FRAME_CURSOR_WIDTH (f);
9052    
9053        x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);        x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
9054        x_clip_to_row (w, row, gc, 0);        x_clip_to_row (w, row, gc, 0);
# Line 9254  x_display_and_set_cursor (w, on, hpos, v Line 9253  x_display_and_set_cursor (w, on, hpos, v
9253    struct glyph_matrix *current_glyphs;    struct glyph_matrix *current_glyphs;
9254    struct glyph_row *glyph_row;    struct glyph_row *glyph_row;
9255    struct glyph *glyph;    struct glyph *glyph;
   int cursor_non_selected;  
   int active_cursor = 1;  
9256    
9257    /* This is pointless on invisible frames, and dangerous on garbaged    /* This is pointless on invisible frames, and dangerous on garbaged
9258       windows and frames; in the latter case, the frame or window may       windows and frames; in the latter case, the frame or window may
# Line 9285  x_display_and_set_cursor (w, on, hpos, v Line 9282  x_display_and_set_cursor (w, on, hpos, v
9282    
9283    xassert (interrupt_input_blocked);    xassert (interrupt_input_blocked);
9284    
9285    /* Set new_cursor_type to the cursor we want to be displayed.  In a    /* Set new_cursor_type to the cursor we want to be displayed.  */
9286       mini-buffer window, we want the cursor only to appear if we are    new_cursor_type = get_window_cursor_type (w, &new_cursor_width);
      reading input from this window.  For the selected window, we want  
      the cursor type given by the frame parameter.  If explicitly  
      marked off, draw no cursor.  In all other cases, we want a hollow  
      box cursor.  */  
   cursor_non_selected  
     = !NILP (Fbuffer_local_value (Qcursor_in_non_selected_windows,  
                                   w->buffer));  
   new_cursor_width = -1;  
   if (cursor_in_echo_area  
       && FRAME_HAS_MINIBUF_P (f)  
       && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window))  
     {  
       if (w == XWINDOW (echo_area_window))  
         new_cursor_type = FRAME_DESIRED_CURSOR (f);  
       else  
         {  
           if (cursor_non_selected)  
             new_cursor_type = HOLLOW_BOX_CURSOR;  
           else  
             new_cursor_type = NO_CURSOR;  
           active_cursor = 0;  
         }  
     }  
   else  
     {  
       if (f != FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame  
           || w != XWINDOW (f->selected_window))  
         {  
           active_cursor = 0;  
9287    
           if (MINI_WINDOW_P (w)  
               || !cursor_non_selected  
               || NILP (XBUFFER (w->buffer)->cursor_type))  
             new_cursor_type = NO_CURSOR;  
           else  
             new_cursor_type = HOLLOW_BOX_CURSOR;  
         }  
       else  
         {  
           struct buffer *b = XBUFFER (w->buffer);  
   
           if (EQ (b->cursor_type, Qt))  
             new_cursor_type = FRAME_DESIRED_CURSOR (f);  
           else  
             new_cursor_type = x_specified_cursor_type (b->cursor_type,  
                                                        &new_cursor_width);  
           if (w->cursor_off_p)  
             {  
               if (new_cursor_type == FILLED_BOX_CURSOR)  
                 new_cursor_type = HOLLOW_BOX_CURSOR;  
               else if (new_cursor_type == BAR_CURSOR && new_cursor_width > 1)  
                 new_cursor_width = 1;  
               else  
                 new_cursor_type = NO_CURSOR;  
             }  
         }  
     }  
9288    
9289    /* If cursor is currently being shown and we don't want it to be or    /* If cursor is currently being shown and we don't want it to be or
9290       it is in the wrong place, or the cursor type is not what we want,       it is in the wrong place, or the cursor type is not what we want,
# Line 9353  x_display_and_set_cursor (w, on, hpos, v Line 9294  x_display_and_set_cursor (w, on, hpos, v
9294            || w->phys_cursor.x != x            || w->phys_cursor.x != x
9295            || w->phys_cursor.y != y            || w->phys_cursor.y != y
9296            || new_cursor_type != w->phys_cursor_type            || new_cursor_type != w->phys_cursor_type
9297            || (new_cursor_type == BAR_CURSOR            || ((new_cursor_type == BAR_CURSOR || new_cursor_type == HBAR_CURSOR)
9298                && new_cursor_width != w->phys_cursor_width)))                && new_cursor_width != w->phys_cursor_width)))
9299      x_erase_phys_cursor (w);      x_erase_phys_cursor (w);
9300    
# Line 9384  x_display_and_set_cursor (w, on, hpos, v Line 9325  x_display_and_set_cursor (w, on, hpos, v
9325            x_draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR);            x_draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR);
9326            break;            break;
9327    
9328            case HBAR_CURSOR:
9329              /* TODO.  For now, just draw bar cursor. */
9330          case BAR_CURSOR:          case BAR_CURSOR:
9331            x_draw_bar_cursor (w, glyph_row, new_cursor_width);            x_draw_bar_cursor (w, glyph_row, new_cursor_width);
9332            break;            break;
# Line 13225  void make_mac_frame (struct frame *f) Line 13168  void make_mac_frame (struct frame *f)
13168  {  {
13169    FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;    FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
13170    FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_right;    FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_right;
13171      
13172      FRAME_DESIRED_CURSOR (f) = FILLED_BOX_CURSOR;
13173    
13174    NewMacWindow(f);    NewMacWindow(f);
13175    
13176    f->output_data.mac->cursor_pixel = 0;    f->output_data.mac->cursor_pixel = 0;
# Line 13233  void make_mac_frame (struct frame *f) Line 13178  void make_mac_frame (struct frame *f)
13178    f->output_data.mac->mouse_pixel = 0xff00ff;    f->output_data.mac->mouse_pixel = 0xff00ff;
13179    f->output_data.mac->cursor_foreground_pixel = 0x0000ff;    f->output_data.mac->cursor_foreground_pixel = 0x0000ff;
13180    
   f->output_data.mac->desired_cursor = FILLED_BOX_CURSOR;  
   
13181    f->output_data.mac->fontset = -1;    f->output_data.mac->fontset = -1;
13182    f->output_data.mac->scroll_bar_foreground_pixel = -1;    f->output_data.mac->scroll_bar_foreground_pixel = -1;
13183    f->output_data.mac->scroll_bar_background_pixel = -1;    f->output_data.mac->scroll_bar_background_pixel = -1;

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

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