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

Diff of /emacs/src/msdos.c

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

revision 1.173 by eliz, Fri May 17 13:12:37 2002 UTC revision 1.173.2.1 by miles, Fri Apr 4 06:21:02 2003 UTC
# Line 414  extern int unibyte_display_via_language_ Line 414  extern int unibyte_display_via_language_
414    
415  Lisp_Object Qbar, Qhbar;  Lisp_Object Qbar, Qhbar;
416    
417  /* The screen colors of the curent frame, which serve as the default  /* The screen colors of the current frame, which serve as the default
418     colors for newly-created frames.  */     colors for newly-created frames.  */
419  static int initial_screen_colors[2];  static int initial_screen_colors[2];
420    
# Line 1180  IT_write_glyphs (struct glyph *str, int Line 1180  IT_write_glyphs (struct glyph *str, int
1180                            Mouse Highlight (and friends..)                            Mouse Highlight (and friends..)
1181   ************************************************************************/   ************************************************************************/
1182    
 /* If non-nil, dos_rawgetc generates an event to display that string.  
    (The display is done in keyboard.c:read_char, by calling  
    show_help_echo.)  */  
 static Lisp_Object help_echo;  
 static Lisp_Object previous_help_echo; /* a helper temporary variable */  
   
 /* These record the window, the object and the position where the help  
    echo string was generated.  */  
 static Lisp_Object help_echo_window;  
 static Lisp_Object help_echo_object;  
 static int help_echo_pos;  
   
 /* Non-zero means automatically select any window when the mouse  
    cursor moves into it.  */  
 int mouse_autoselect_window;  
   
1183  /* Last window where we saw the mouse.  Used by mouse-autoselect-window.  */  /* Last window where we saw the mouse.  Used by mouse-autoselect-window.  */
1184  static Lisp_Object last_mouse_window;  static Lisp_Object last_mouse_window;
1185    
# Line 1454  IT_note_mode_line_highlight (struct wind Line 1438  IT_note_mode_line_highlight (struct wind
1438        end = glyph + row->used[TEXT_AREA];        end = glyph + row->used[TEXT_AREA];
1439        if (glyph < end        if (glyph < end
1440            && STRINGP (glyph->object)            && STRINGP (glyph->object)
1441            && XSTRING (glyph->object)->intervals            && STRING_INTERVALS (glyph->object)
1442            && glyph->charpos >= 0            && glyph->charpos >= 0
1443            && glyph->charpos < XSTRING (glyph->object)->size)            && glyph->charpos < SCHARS (glyph->object))
1444          {          {
1445            /* If we're on a string with `help-echo' text property,            /* If we're on a string with `help-echo' text property,
1446               arrange for the help to be displayed.  This is done by               arrange for the help to be displayed.  This is done by
# Line 1465  IT_note_mode_line_highlight (struct wind Line 1449  IT_note_mode_line_highlight (struct wind
1449                                       Qhelp_echo, glyph->object);                                       Qhelp_echo, glyph->object);
1450            if (!NILP (help))            if (!NILP (help))
1451              {              {
1452                help_echo = help;                help_echo_string = help;
1453                XSETWINDOW (help_echo_window, w);                XSETWINDOW (help_echo_window, w);
1454                help_echo_object = glyph->object;                help_echo_object = glyph->object;
1455                help_echo_pos = glyph->charpos;                help_echo_pos = glyph->charpos;
# Line 1482  static void Line 1466  static void
1466  IT_note_mouse_highlight (struct frame *f, int x, int y)  IT_note_mouse_highlight (struct frame *f, int x, int y)
1467  {  {
1468    struct display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);    struct display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
1469    int portion = -1;    enum window_part part = ON_NOTHING;
1470    Lisp_Object window;    Lisp_Object window;
1471    struct window *w;    struct window *w;
1472    
# Line 1508  IT_note_mouse_highlight (struct frame *f Line 1492  IT_note_mouse_highlight (struct frame *f
1492      }      }
1493    
1494    /* Which window is that in?  */    /* Which window is that in?  */
1495    window = window_from_coordinates (f, x, y, &portion, 0);    window = window_from_coordinates (f, x, y, &part, 0);
1496    
1497    /* If we were displaying active text in another window, clear that.  */    /* If we were displaying active text in another window, clear that.  */
1498    if (! EQ (window, dpyinfo->mouse_face_window))    if (! EQ (window, dpyinfo->mouse_face_window))
# Line 1523  IT_note_mouse_highlight (struct frame *f Line 1507  IT_note_mouse_highlight (struct frame *f
1507    x -= WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X (w);    x -= WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X (w);
1508    y -= WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y (w);    y -= WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y (w);
1509    
1510    if (portion == 1 || portion == 3)    if (part == ON_MODE_LINE || part == ON_HEADER_LINE)
1511      {      {
1512        /* Mouse is on the mode or top line.  */        /* Mouse is on the mode or top line.  */
1513        IT_note_mode_line_highlight (w, x, portion == 1);        IT_note_mode_line_highlight (w, x, part == ON_MODE_LINE);
1514        return;        return;
1515      }      }
1516    else    else
# Line 1534  IT_note_mouse_highlight (struct frame *f Line 1518  IT_note_mouse_highlight (struct frame *f
1518    
1519    /* Are we in a window whose display is up to date?    /* Are we in a window whose display is up to date?
1520       And verify the buffer's text has not changed.  */       And verify the buffer's text has not changed.  */
1521    if (/* Within text portion of the window.  */    if (part == ON_TEXT
       portion == 0  
1522        && EQ (w->window_end_valid, w->buffer)        && EQ (w->window_end_valid, w->buffer)
1523        && XFASTINT (w->last_modified) == BUF_MODIFF (XBUFFER (w->buffer))        && XFASTINT (w->last_modified) == BUF_MODIFF (XBUFFER (w->buffer))
1524        && (XFASTINT (w->last_overlay_modified)        && (XFASTINT (w->last_overlay_modified)
# Line 1673  IT_note_mouse_highlight (struct frame *f Line 1656  IT_note_mouse_highlight (struct frame *f
1656                  dpyinfo->mouse_face_window = window;                  dpyinfo->mouse_face_window = window;
1657                  dpyinfo->mouse_face_face_id                  dpyinfo->mouse_face_face_id
1658                    = face_at_buffer_position (w, pos, 0, 0,                    = face_at_buffer_position (w, pos, 0, 0,
1659                                               &ignore, pos + 1, 1);                                               &ignore, pos + 1,
1660                                                 !dpyinfo->mouse_face_hidden);
1661    
1662                  /* Display it as active.  */                  /* Display it as active.  */
1663                  show_mouse_face (dpyinfo, 1);                  show_mouse_face (dpyinfo, 1);
# Line 1707  IT_note_mouse_highlight (struct frame *f Line 1691  IT_note_mouse_highlight (struct frame *f
1691                  dpyinfo->mouse_face_window = window;                  dpyinfo->mouse_face_window = window;
1692                  dpyinfo->mouse_face_face_id                  dpyinfo->mouse_face_face_id
1693                    = face_at_buffer_position (w, pos, 0, 0,                    = face_at_buffer_position (w, pos, 0, 0,
1694                                               &ignore, pos + 1, 1);                                               &ignore, pos + 1,
1695                                                 !dpyinfo->mouse_face_hidden);
1696    
1697                  /* Display it as active.  */                  /* Display it as active.  */
1698                  show_mouse_face (dpyinfo, 1);                  show_mouse_face (dpyinfo, 1);
# Line 1729  IT_note_mouse_highlight (struct frame *f Line 1714  IT_note_mouse_highlight (struct frame *f
1714    
1715            if (!NILP (help))            if (!NILP (help))
1716              {              {
1717                help_echo = help;                help_echo_string = help;
1718                help_echo_window = window;                help_echo_window = window;
1719                help_echo_object = overlay;                help_echo_object = overlay;
1720                help_echo_pos = pos;                help_echo_pos = pos;
# Line 1738  IT_note_mouse_highlight (struct frame *f Line 1723  IT_note_mouse_highlight (struct frame *f
1723            else if (NILP (help)            else if (NILP (help)
1724                     && ((STRINGP (glyph->object)                     && ((STRINGP (glyph->object)
1725                          && glyph->charpos >= 0                          && glyph->charpos >= 0
1726                          && glyph->charpos < XSTRING (glyph->object)->size)                          && glyph->charpos < SCHARS (glyph->object))
1727                         || (BUFFERP (glyph->object)                         || (BUFFERP (glyph->object)
1728                             && glyph->charpos >= BEGV                             && glyph->charpos >= BEGV
1729                             && glyph->charpos < ZV)))                             && glyph->charpos < ZV)))
# Line 1747  IT_note_mouse_highlight (struct frame *f Line 1732  IT_note_mouse_highlight (struct frame *f
1732                                           Qhelp_echo, glyph->object);                                           Qhelp_echo, glyph->object);
1733                if (!NILP (help))                if (!NILP (help))
1734                  {                  {
1735                    help_echo = help;                    help_echo_string = help;
1736                    help_echo_window = window;                    help_echo_window = window;
1737                    help_echo_object = glyph->object;                    help_echo_object = glyph->object;
1738                    help_echo_pos = glyph->charpos;                    help_echo_pos = glyph->charpos;
# Line 2454  IT_set_frame_parameters (f, alist) Line 2439  IT_set_frame_parameters (f, alist)
2439          {          {
2440            x_set_title (f, val);            x_set_title (f, val);
2441            if (termscript)            if (termscript)
2442              fprintf (termscript, "<TITLE: %s>\n", XSTRING (val)->data);              fprintf (termscript, "<TITLE: %s>\n", SDATA (val));
2443          }          }
2444        else if (EQ (prop, Qcursor_type))        else if (EQ (prop, Qcursor_type))
2445          {          {
# Line 3362  dos_rawgetc () Line 3347  dos_rawgetc ()
3347          }          }
3348    
3349        if (code >= 0x100)        if (code >= 0x100)
3350          event.kind = non_ascii_keystroke;          event.kind = NON_ASCII_KEYSTROKE_EVENT;
3351        else        else
3352          event.kind = ascii_keystroke;          event.kind = ASCII_KEYSTROKE_EVENT;
3353        event.code = code;        event.code = code;
3354        event.modifiers = modifiers;        event.modifiers = modifiers;
3355        event.frame_or_window = selected_frame;        event.frame_or_window = selected_frame;
# Line 3395  dos_rawgetc () Line 3380  dos_rawgetc ()
3380            /* Generate SELECT_WINDOW_EVENTs when needed.  */            /* Generate SELECT_WINDOW_EVENTs when needed.  */
3381            if (mouse_autoselect_window)            if (mouse_autoselect_window)
3382              {              {
               int mouse_area;  
   
3383                mouse_window = window_from_coordinates (SELECTED_FRAME(),                mouse_window = window_from_coordinates (SELECTED_FRAME(),
3384                                                        mouse_last_x,                                                        mouse_last_x,
3385                                                        mouse_last_y,                                                        mouse_last_y,
3386                                                        &mouse_area, 0);                                                        0, 0);
3387                /* A window will be selected only when it is not                /* A window will be selected only when it is not
3388                   selected now, and the last mouse movement event was                   selected now, and the last mouse movement event was
3389                   not in it.  A minibuffer window will be selected iff                   not in it.  A minibuffer window will be selected iff
# Line 3420  dos_rawgetc () Line 3403  dos_rawgetc ()
3403            else            else
3404              last_mouse_window = Qnil;              last_mouse_window = Qnil;
3405    
3406            previous_help_echo = help_echo;            previous_help_echo_string = help_echo_string;
3407            help_echo = help_echo_object = help_echo_window = Qnil;            help_echo_string = help_echo_object = help_echo_window = Qnil;
3408            help_echo_pos = -1;            help_echo_pos = -1;
3409            IT_note_mouse_highlight (SELECTED_FRAME(),            IT_note_mouse_highlight (SELECTED_FRAME(),
3410                                     mouse_last_x, mouse_last_y);                                     mouse_last_x, mouse_last_y);
3411            /* If the contents of the global variable help_echo has            /* If the contents of the global variable help_echo has
3412               changed, generate a HELP_EVENT.  */               changed, generate a HELP_EVENT.  */
3413            if (!NILP (help_echo) || !NILP (previous_help_echo))            if (!NILP (help_echo_string) || !NILP (previous_help_echo_string))
3414              {              {
3415                event.kind = HELP_EVENT;                event.kind = HELP_EVENT;
3416                event.frame_or_window = selected_frame;                event.frame_or_window = selected_frame;
3417                event.arg = help_echo_object;                event.arg = help_echo_object;
3418                event.x = WINDOWP (help_echo_window)                event.x = WINDOWP (help_echo_window)
3419                  ? help_echo_window : selected_frame;                  ? help_echo_window : selected_frame;
3420                event.y = help_echo;                event.y = help_echo_string;
3421                event.timestamp = event_timestamp ();                event.timestamp = event_timestamp ();
3422                event.code = help_echo_pos;                event.code = help_echo_pos;
3423                kbd_buffer_store_event (&event);                kbd_buffer_store_event (&event);
# Line 3473  dos_rawgetc () Line 3456  dos_rawgetc ()
3456                        }                        }
3457                    }                    }
3458    
3459                  event.kind = mouse_click;                  event.kind = MOUSE_CLICK_EVENT;
3460                  event.code = button_num;                  event.code = button_num;
3461                  event.modifiers = dos_get_modifiers (0)                  event.modifiers = dos_get_modifiers (0)
3462                    | (press ? down_modifier : up_modifier);                    | (press ? down_modifier : up_modifier);
# Line 3517  dos_keyread () Line 3500  dos_keyread ()
3500  }  }
3501    
3502  #ifndef HAVE_X_WINDOWS  #ifndef HAVE_X_WINDOWS
 /* See xterm.c for more info.  */  
 void  
 pixel_to_glyph_coords (f, pix_x, pix_y, x, y, bounds, noclip)  
      FRAME_PTR f;  
      register int pix_x, pix_y, *x, *y;  
      XRectangle *bounds;  
      int noclip;  
 {  
   if (bounds) abort ();  
   
   /* Ignore clipping.  */  
   
   *x = pix_x;  
   *y = pix_y;  
 }  
3503    
 void  
 glyph_to_pixel_coords (f, x, y, pix_x, pix_y)  
      FRAME_PTR f;  
      register int x, y, *pix_x, *pix_y;  
 {  
   *pix_x = x;  
   *pix_y = y;  
 }  
   
3504  /* Simulation of X's menus.  Nothing too fancy here -- just make it work  /* Simulation of X's menus.  Nothing too fancy here -- just make it work
3505     for now.     for now.
3506    
# Line 4405  The argument object is never altered--th Line 4364  The argument object is never altered--th
4364      return Qnil;      return Qnil;
4365    
4366    tem = Fcopy_sequence (filename);    tem = Fcopy_sequence (filename);
4367    msdos_downcase_filename (XSTRING (tem)->data);    msdos_downcase_filename (SDATA (tem));
4368    return tem;    return tem;
4369  }  }
4370    
# Line 4894  run_msdos_command (argv, working_dir, te Line 4853  run_msdos_command (argv, working_dir, te
4853    return result;    return result;
4854  }  }
4855    
4856    void
4857  croak (badfunc)  croak (badfunc)
4858       char *badfunc;       char *badfunc;
4859  {  {
# Line 4926  gethostname (p, size) Line 4886  gethostname (p, size)
4886  /* When time zones are set from Ms-Dos too many C-libraries are playing  /* When time zones are set from Ms-Dos too many C-libraries are playing
4887     tricks with time values.  We solve this by defining our own version     tricks with time values.  We solve this by defining our own version
4888     of `gettimeofday' bypassing GO32.  Our version needs to be initialized     of `gettimeofday' bypassing GO32.  Our version needs to be initialized
4889     once and after each call to `tzset' with TZ changed.  That is     once and after each call to `tzset' with TZ changed.  That is
4890     accomplished by aliasing tzset to init_gettimeofday. */     accomplished by aliasing tzset to init_gettimeofday. */
4891    
4892  static struct tm time_rec;  static struct tm time_rec;
# Line 5007  static sigset_t pending_signals; Line 4967  static sigset_t pending_signals;
4967  typedef void (*sighandler_t)(int);  typedef void (*sighandler_t)(int);
4968  static sighandler_t prev_handlers[320];  static sighandler_t prev_handlers[320];
4969    
4970  /* A signal handler which just records that a signal occured  /* A signal handler which just records that a signal occurred
4971     (it will be raised later, if and when the signal is unblocked).  */     (it will be raised later, if and when the signal is unblocked).  */
4972  static void  static void
4973  sig_suspender (signo)  sig_suspender (signo)
# Line 5089  sigprocmask (how, new_set, old_set) Line 5049  sigprocmask (how, new_set, old_set)
5049  #else /* not POSIX_SIGNALS */  #else /* not POSIX_SIGNALS */
5050    
5051  sigsetmask (x) int x; { return 0; }  sigsetmask (x) int x; { return 0; }
5052  sigblock (mask) int mask; { return 0; }  sigblock (mask) int mask; { return 0; }
5053    
5054  #endif /* not POSIX_SIGNALS */  #endif /* not POSIX_SIGNALS */
5055  #endif /* not __DJGPP_MINOR__ < 2 */  #endif /* not __DJGPP_MINOR__ < 2 */
# Line 5302  syms_of_msdos () Line 5262  syms_of_msdos ()
5262  {  {
5263    recent_doskeys = Fmake_vector (make_number (NUM_RECENT_DOSKEYS), Qnil);    recent_doskeys = Fmake_vector (make_number (NUM_RECENT_DOSKEYS), Qnil);
5264    staticpro (&recent_doskeys);    staticpro (&recent_doskeys);
5265    
5266  #ifndef HAVE_X_WINDOWS  #ifndef HAVE_X_WINDOWS
   help_echo = Qnil;  
   staticpro (&help_echo);  
   help_echo_object = Qnil;  
   staticpro (&help_echo_object);  
   help_echo_window = Qnil;  
   staticpro (&help_echo_window);  
   previous_help_echo = Qnil;  
   staticpro (&previous_help_echo);  
   help_echo_pos = -1;  
5267    
5268    /* The following two are from xfns.c:  */    /* The following two are from xfns.c:  */
5269    Qbar = intern ("bar");    Qbar = intern ("bar");
# Line 5329  syms_of_msdos () Line 5281  syms_of_msdos ()
5281  This variable is used only by MSDOS terminals.  */);  This variable is used only by MSDOS terminals.  */);
5282    Vdos_unsupported_char_glyph = '\177';    Vdos_unsupported_char_glyph = '\177';
5283    
   DEFVAR_BOOL ("mouse-autoselect-window", &mouse_autoselect_window,  
     doc: /* *Non-nil means autoselect window with mouse pointer.  */);  
   mouse_autoselect_window = 0;  
5284  #endif  #endif
5285  #ifndef subprocesses  #ifndef subprocesses
5286    DEFVAR_BOOL ("delete-exited-processes", &delete_exited_processes,    DEFVAR_BOOL ("delete-exited-processes", &delete_exited_processes,

Legend:
Removed from v.1.173  
changed lines
  Added in v.1.173.2.1

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