aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2003-03-21 13:50:39 +0000
committerKim F. Storm2003-03-21 13:50:39 +0000
commit02d4b97dffa9b4ee6c1e22ad39d11f5f6aacd747 (patch)
tree1a305786ab4887c9f32490b04a5e8289a10cc2b2 /src
parent57cb6dbe6655d16575d9febfdf3c818d0fdf1588 (diff)
downloademacs-02d4b97dffa9b4ee6c1e22ad39d11f5f6aacd747.tar.gz
emacs-02d4b97dffa9b4ee6c1e22ad39d11f5f6aacd747.zip
Remove consolidated defines and code.
(IT_note_mouse_highlight, dos_rawgetc): Use enum window_part.
Diffstat (limited to 'src')
-rw-r--r--src/msdos.c58
1 files changed, 14 insertions, 44 deletions
diff --git a/src/msdos.c b/src/msdos.c
index 6b56cf72deb..3ab3597b8ed 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1180,22 +1180,6 @@ IT_write_glyphs (struct glyph *str, int str_len)
1180 Mouse Highlight (and friends..) 1180 Mouse Highlight (and friends..)
1181 ************************************************************************/ 1181 ************************************************************************/
1182 1182
1183/* If non-nil, dos_rawgetc generates an event to display that string.
1184 (The display is done in keyboard.c:read_char, by calling
1185 show_help_echo.) */
1186static Lisp_Object help_echo;
1187static Lisp_Object previous_help_echo; /* a helper temporary variable */
1188
1189/* These record the window, the object and the position where the help
1190 echo string was generated. */
1191static Lisp_Object help_echo_window;
1192static Lisp_Object help_echo_object;
1193static int help_echo_pos;
1194
1195/* Non-zero means automatically select any window when the mouse
1196 cursor moves into it. */
1197int mouse_autoselect_window;
1198
1199/* Last window where we saw the mouse. Used by mouse-autoselect-window. */ 1183/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
1200static Lisp_Object last_mouse_window; 1184static Lisp_Object last_mouse_window;
1201 1185
@@ -1465,7 +1449,7 @@ IT_note_mode_line_highlight (struct window *w, int x, int mode_line_p)
1465 Qhelp_echo, glyph->object); 1449 Qhelp_echo, glyph->object);
1466 if (!NILP (help)) 1450 if (!NILP (help))
1467 { 1451 {
1468 help_echo = help; 1452 help_echo_string = help;
1469 XSETWINDOW (help_echo_window, w); 1453 XSETWINDOW (help_echo_window, w);
1470 help_echo_object = glyph->object; 1454 help_echo_object = glyph->object;
1471 help_echo_pos = glyph->charpos; 1455 help_echo_pos = glyph->charpos;
@@ -1482,7 +1466,7 @@ static void
1482IT_note_mouse_highlight (struct frame *f, int x, int y) 1466IT_note_mouse_highlight (struct frame *f, int x, int y)
1483{ 1467{
1484 struct display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 1468 struct display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
1485 int portion = -1; 1469 enum window_part part = ON_NOTHING;
1486 Lisp_Object window; 1470 Lisp_Object window;
1487 struct window *w; 1471 struct window *w;
1488 1472
@@ -1508,7 +1492,7 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
1508 } 1492 }
1509 1493
1510 /* Which window is that in? */ 1494 /* Which window is that in? */
1511 window = window_from_coordinates (f, x, y, &portion, 0); 1495 window = window_from_coordinates (f, x, y, &part, 0);
1512 1496
1513 /* If we were displaying active text in another window, clear that. */ 1497 /* If we were displaying active text in another window, clear that. */
1514 if (! EQ (window, dpyinfo->mouse_face_window)) 1498 if (! EQ (window, dpyinfo->mouse_face_window))
@@ -1523,10 +1507,10 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
1523 x -= WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X (w); 1507 x -= WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X (w);
1524 y -= WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y (w); 1508 y -= WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y (w);
1525 1509
1526 if (portion == 1 || portion == 3) 1510 if (part == ON_MODE_LINE || part == ON_HEADER_LINE)
1527 { 1511 {
1528 /* Mouse is on the mode or top line. */ 1512 /* Mouse is on the mode or top line. */
1529 IT_note_mode_line_highlight (w, x, portion == 1); 1513 IT_note_mode_line_highlight (w, x, part == ON_MODE_LINE);
1530 return; 1514 return;
1531 } 1515 }
1532 else 1516 else
@@ -1534,8 +1518,7 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
1534 1518
1535 /* Are we in a window whose display is up to date? 1519 /* Are we in a window whose display is up to date?
1536 And verify the buffer's text has not changed. */ 1520 And verify the buffer's text has not changed. */
1537 if (/* Within text portion of the window. */ 1521 if (part == ON_TEXT
1538 portion == 0
1539 && EQ (w->window_end_valid, w->buffer) 1522 && EQ (w->window_end_valid, w->buffer)
1540 && XFASTINT (w->last_modified) == BUF_MODIFF (XBUFFER (w->buffer)) 1523 && XFASTINT (w->last_modified) == BUF_MODIFF (XBUFFER (w->buffer))
1541 && (XFASTINT (w->last_overlay_modified) 1524 && (XFASTINT (w->last_overlay_modified)
@@ -1731,7 +1714,7 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
1731 1714
1732 if (!NILP (help)) 1715 if (!NILP (help))
1733 { 1716 {
1734 help_echo = help; 1717 help_echo_string = help;
1735 help_echo_window = window; 1718 help_echo_window = window;
1736 help_echo_object = overlay; 1719 help_echo_object = overlay;
1737 help_echo_pos = pos; 1720 help_echo_pos = pos;
@@ -1749,7 +1732,7 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
1749 Qhelp_echo, glyph->object); 1732 Qhelp_echo, glyph->object);
1750 if (!NILP (help)) 1733 if (!NILP (help))
1751 { 1734 {
1752 help_echo = help; 1735 help_echo_string = help;
1753 help_echo_window = window; 1736 help_echo_window = window;
1754 help_echo_object = glyph->object; 1737 help_echo_object = glyph->object;
1755 help_echo_pos = glyph->charpos; 1738 help_echo_pos = glyph->charpos;
@@ -3397,12 +3380,10 @@ dos_rawgetc ()
3397 /* Generate SELECT_WINDOW_EVENTs when needed. */ 3380 /* Generate SELECT_WINDOW_EVENTs when needed. */
3398 if (mouse_autoselect_window) 3381 if (mouse_autoselect_window)
3399 { 3382 {
3400 int mouse_area;
3401
3402 mouse_window = window_from_coordinates (SELECTED_FRAME(), 3383 mouse_window = window_from_coordinates (SELECTED_FRAME(),
3403 mouse_last_x, 3384 mouse_last_x,
3404 mouse_last_y, 3385 mouse_last_y,
3405 &mouse_area, 0); 3386 0, 0);
3406 /* A window will be selected only when it is not 3387 /* A window will be selected only when it is not
3407 selected now, and the last mouse movement event was 3388 selected now, and the last mouse movement event was
3408 not in it. A minibuffer window will be selected iff 3389 not in it. A minibuffer window will be selected iff
@@ -3422,21 +3403,21 @@ dos_rawgetc ()
3422 else 3403 else
3423 last_mouse_window = Qnil; 3404 last_mouse_window = Qnil;
3424 3405
3425 previous_help_echo = help_echo; 3406 previous_help_echo_string = help_echo_string;
3426 help_echo = help_echo_object = help_echo_window = Qnil; 3407 help_echo_string = help_echo_object = help_echo_window = Qnil;
3427 help_echo_pos = -1; 3408 help_echo_pos = -1;
3428 IT_note_mouse_highlight (SELECTED_FRAME(), 3409 IT_note_mouse_highlight (SELECTED_FRAME(),
3429 mouse_last_x, mouse_last_y); 3410 mouse_last_x, mouse_last_y);
3430 /* If the contents of the global variable help_echo has 3411 /* If the contents of the global variable help_echo has
3431 changed, generate a HELP_EVENT. */ 3412 changed, generate a HELP_EVENT. */
3432 if (!NILP (help_echo) || !NILP (previous_help_echo)) 3413 if (!NILP (help_echo_string) || !NILP (previous_help_echo_string))
3433 { 3414 {
3434 event.kind = HELP_EVENT; 3415 event.kind = HELP_EVENT;
3435 event.frame_or_window = selected_frame; 3416 event.frame_or_window = selected_frame;
3436 event.arg = help_echo_object; 3417 event.arg = help_echo_object;
3437 event.x = WINDOWP (help_echo_window) 3418 event.x = WINDOWP (help_echo_window)
3438 ? help_echo_window : selected_frame; 3419 ? help_echo_window : selected_frame;
3439 event.y = help_echo; 3420 event.y = help_echo_string;
3440 event.timestamp = event_timestamp (); 3421 event.timestamp = event_timestamp ();
3441 event.code = help_echo_pos; 3422 event.code = help_echo_pos;
3442 kbd_buffer_store_event (&event); 3423 kbd_buffer_store_event (&event);
@@ -5305,16 +5286,8 @@ syms_of_msdos ()
5305{ 5286{
5306 recent_doskeys = Fmake_vector (make_number (NUM_RECENT_DOSKEYS), Qnil); 5287 recent_doskeys = Fmake_vector (make_number (NUM_RECENT_DOSKEYS), Qnil);
5307 staticpro (&recent_doskeys); 5288 staticpro (&recent_doskeys);
5289
5308#ifndef HAVE_X_WINDOWS 5290#ifndef HAVE_X_WINDOWS
5309 help_echo = Qnil;
5310 staticpro (&help_echo);
5311 help_echo_object = Qnil;
5312 staticpro (&help_echo_object);
5313 help_echo_window = Qnil;
5314 staticpro (&help_echo_window);
5315 previous_help_echo = Qnil;
5316 staticpro (&previous_help_echo);
5317 help_echo_pos = -1;
5318 5291
5319 /* The following two are from xfns.c: */ 5292 /* The following two are from xfns.c: */
5320 Qbar = intern ("bar"); 5293 Qbar = intern ("bar");
@@ -5332,9 +5305,6 @@ syms_of_msdos ()
5332This variable is used only by MSDOS terminals. */); 5305This variable is used only by MSDOS terminals. */);
5333 Vdos_unsupported_char_glyph = '\177'; 5306 Vdos_unsupported_char_glyph = '\177';
5334 5307
5335 DEFVAR_BOOL ("mouse-autoselect-window", &mouse_autoselect_window,
5336 doc: /* *Non-nil means autoselect window with mouse pointer. */);
5337 mouse_autoselect_window = 0;
5338#endif 5308#endif
5339#ifndef subprocesses 5309#ifndef subprocesses
5340 DEFVAR_BOOL ("delete-exited-processes", &delete_exited_processes, 5310 DEFVAR_BOOL ("delete-exited-processes", &delete_exited_processes,