aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2002-08-30 12:02:10 +0000
committerKim F. Storm2002-08-30 12:02:10 +0000
commit668e2d326015e004cc1a7ca0698f6d381b6ff3e8 (patch)
treee5829b7c9455606a8a2c3f7ea17e049f356fcdb7
parent154372ef09c228e9b8a3fd1596216776d95f273f (diff)
downloademacs-668e2d326015e004cc1a7ca0698f6d381b6ff3e8.tar.gz
emacs-668e2d326015e004cc1a7ca0698f6d381b6ff3e8.zip
(x_specified_cursor_type): Remove prototype.
(x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH. (x_display_and_set_cursor): Use get_window_cursor_type. Remove unused local variables cursor_non_selected, active_cursor. Redraw cursor if hbar cursor width changes. (make_mac_frame): Set FRAME_DESIRED_CURSOR.
-rw-r--r--src/macterm.c75
1 files changed, 9 insertions, 66 deletions
diff --git a/src/macterm.c b/src/macterm.c
index dacdd6c8b91..460960e7beb 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -419,7 +419,6 @@ void x_wm_set_icon_pixmap P_ ((struct frame *, int));
419void mac_initialize P_ ((void)); 419void mac_initialize P_ ((void));
420static void x_font_min_bounds P_ ((XFontStruct *, int *, int *)); 420static void x_font_min_bounds P_ ((XFontStruct *, int *, int *));
421static int x_compute_min_glyph_bounds P_ ((struct frame *)); 421static int x_compute_min_glyph_bounds P_ ((struct frame *));
422enum text_cursor_kinds x_specified_cursor_type P_ ((Lisp_Object, int *));
423static void x_draw_phys_cursor_glyph P_ ((struct window *, 422static void x_draw_phys_cursor_glyph P_ ((struct window *,
424 struct glyph_row *, 423 struct glyph_row *,
425 enum draw_glyphs_face)); 424 enum draw_glyphs_face));
@@ -9049,7 +9048,7 @@ x_draw_bar_cursor (w, row, width)
9049 } 9048 }
9050 9049
9051 if (width < 0) 9050 if (width < 0)
9052 width = f->output_data.mac->cursor_width; 9051 width = FRAME_CURSOR_WIDTH (f);
9053 9052
9054 x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); 9053 x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
9055 x_clip_to_row (w, row, gc, 0); 9054 x_clip_to_row (w, row, gc, 0);
@@ -9254,8 +9253,6 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
9254 struct glyph_matrix *current_glyphs; 9253 struct glyph_matrix *current_glyphs;
9255 struct glyph_row *glyph_row; 9254 struct glyph_row *glyph_row;
9256 struct glyph *glyph; 9255 struct glyph *glyph;
9257 int cursor_non_selected;
9258 int active_cursor = 1;
9259 9256
9260 /* This is pointless on invisible frames, and dangerous on garbaged 9257 /* This is pointless on invisible frames, and dangerous on garbaged
9261 windows and frames; in the latter case, the frame or window may 9258 windows and frames; in the latter case, the frame or window may
@@ -9285,65 +9282,9 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
9285 9282
9286 xassert (interrupt_input_blocked); 9283 xassert (interrupt_input_blocked);
9287 9284
9288 /* Set new_cursor_type to the cursor we want to be displayed. In a 9285 /* Set new_cursor_type to the cursor we want to be displayed. */
9289 mini-buffer window, we want the cursor only to appear if we are 9286 new_cursor_type = get_window_cursor_type (w, &new_cursor_width);
9290 reading input from this window. For the selected window, we want
9291 the cursor type given by the frame parameter. If explicitly
9292 marked off, draw no cursor. In all other cases, we want a hollow
9293 box cursor. */
9294 cursor_non_selected
9295 = !NILP (Fbuffer_local_value (Qcursor_in_non_selected_windows,
9296 w->buffer));
9297 new_cursor_width = -1;
9298 if (cursor_in_echo_area
9299 && FRAME_HAS_MINIBUF_P (f)
9300 && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window))
9301 {
9302 if (w == XWINDOW (echo_area_window))
9303 new_cursor_type = FRAME_DESIRED_CURSOR (f);
9304 else
9305 {
9306 if (cursor_non_selected)
9307 new_cursor_type = HOLLOW_BOX_CURSOR;
9308 else
9309 new_cursor_type = NO_CURSOR;
9310 active_cursor = 0;
9311 }
9312 }
9313 else
9314 {
9315 if (f != FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame
9316 || w != XWINDOW (f->selected_window))
9317 {
9318 active_cursor = 0;
9319 9287
9320 if (MINI_WINDOW_P (w)
9321 || !cursor_non_selected
9322 || NILP (XBUFFER (w->buffer)->cursor_type))
9323 new_cursor_type = NO_CURSOR;
9324 else
9325 new_cursor_type = HOLLOW_BOX_CURSOR;
9326 }
9327 else
9328 {
9329 struct buffer *b = XBUFFER (w->buffer);
9330
9331 if (EQ (b->cursor_type, Qt))
9332 new_cursor_type = FRAME_DESIRED_CURSOR (f);
9333 else
9334 new_cursor_type = x_specified_cursor_type (b->cursor_type,
9335 &new_cursor_width);
9336 if (w->cursor_off_p)
9337 {
9338 if (new_cursor_type == FILLED_BOX_CURSOR)
9339 new_cursor_type = HOLLOW_BOX_CURSOR;
9340 else if (new_cursor_type == BAR_CURSOR && new_cursor_width > 1)
9341 new_cursor_width = 1;
9342 else
9343 new_cursor_type = NO_CURSOR;
9344 }
9345 }
9346 }
9347 9288
9348 /* If cursor is currently being shown and we don't want it to be or 9289 /* If cursor is currently being shown and we don't want it to be or
9349 it is in the wrong place, or the cursor type is not what we want, 9290 it is in the wrong place, or the cursor type is not what we want,
@@ -9353,7 +9294,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
9353 || w->phys_cursor.x != x 9294 || w->phys_cursor.x != x
9354 || w->phys_cursor.y != y 9295 || w->phys_cursor.y != y
9355 || new_cursor_type != w->phys_cursor_type 9296 || new_cursor_type != w->phys_cursor_type
9356 || (new_cursor_type == BAR_CURSOR 9297 || ((new_cursor_type == BAR_CURSOR || new_cursor_type == HBAR_CURSOR)
9357 && new_cursor_width != w->phys_cursor_width))) 9298 && new_cursor_width != w->phys_cursor_width)))
9358 x_erase_phys_cursor (w); 9299 x_erase_phys_cursor (w);
9359 9300
@@ -9384,6 +9325,8 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
9384 x_draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR); 9325 x_draw_phys_cursor_glyph (w, glyph_row, DRAW_CURSOR);
9385 break; 9326 break;
9386 9327
9328 case HBAR_CURSOR:
9329 /* TODO. For now, just draw bar cursor. */
9387 case BAR_CURSOR: 9330 case BAR_CURSOR:
9388 x_draw_bar_cursor (w, glyph_row, new_cursor_width); 9331 x_draw_bar_cursor (w, glyph_row, new_cursor_width);
9389 break; 9332 break;
@@ -13225,7 +13168,9 @@ void make_mac_frame (struct frame *f)
13225{ 13168{
13226 FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; 13169 FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
13227 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_right; 13170 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_right;
13228 13171
13172 FRAME_DESIRED_CURSOR (f) = FILLED_BOX_CURSOR;
13173
13229 NewMacWindow(f); 13174 NewMacWindow(f);
13230 13175
13231 f->output_data.mac->cursor_pixel = 0; 13176 f->output_data.mac->cursor_pixel = 0;
@@ -13233,8 +13178,6 @@ void make_mac_frame (struct frame *f)
13233 f->output_data.mac->mouse_pixel = 0xff00ff; 13178 f->output_data.mac->mouse_pixel = 0xff00ff;
13234 f->output_data.mac->cursor_foreground_pixel = 0x0000ff; 13179 f->output_data.mac->cursor_foreground_pixel = 0x0000ff;
13235 13180
13236 f->output_data.mac->desired_cursor = FILLED_BOX_CURSOR;
13237
13238 f->output_data.mac->fontset = -1; 13181 f->output_data.mac->fontset = -1;
13239 f->output_data.mac->scroll_bar_foreground_pixel = -1; 13182 f->output_data.mac->scroll_bar_foreground_pixel = -1;
13240 f->output_data.mac->scroll_bar_background_pixel = -1; 13183 f->output_data.mac->scroll_bar_background_pixel = -1;