]> code.delx.au - gnu-emacs/blobdiff - src/macterm.c
Merge from emacs--devo--0
[gnu-emacs] / src / macterm.c
index 85799cddc23168c89d63bc64f60b49988efe77b5..8b3cee42f5c1422fe9aef1449a9fb47e01d1c4fd 100644 (file)
@@ -6,7 +6,7 @@ This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
@@ -226,14 +226,14 @@ void x_raise_frame P_ ((struct frame *));
 void x_set_window_size P_ ((struct frame *, int, int, int));
 void x_wm_set_window_state P_ ((struct frame *, int));
 void x_wm_set_icon_pixmap P_ ((struct frame *, int));
-void mac_initialize P_ ((void));
+static void mac_initialize P_ ((void));
 static void x_font_min_bounds P_ ((XFontStruct *, int *, int *));
 static int x_compute_min_glyph_bounds P_ ((struct frame *));
 static void x_update_end P_ ((struct frame *));
 static void XTframe_up_to_date P_ ((struct frame *));
-static void XTset_terminal_modes P_ ((void));
-static void XTreset_terminal_modes P_ ((void));
-static void x_clear_frame P_ ((void));
+static void XTset_terminal_modes P_ ((struct terminal *));
+static void XTreset_terminal_modes P_ ((struct terminal *));
+static void x_clear_frame P_ ((struct frame *));
 static void frame_highlight P_ ((struct frame *));
 static void frame_unhighlight P_ ((struct frame *));
 static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *));
@@ -261,6 +261,8 @@ static void x_scroll_bar_report_motion P_ ((struct frame **, Lisp_Object *,
 static int is_emacs_window P_ ((WindowRef));
 static XCharStruct *mac_per_char_metric P_ ((XFontStruct *, XChar2b *, int));
 static void XSetFont P_ ((Display *, GC, XFontStruct *));
+static struct terminal *mac_create_terminal P_ ((struct mac_display_info *dpyinfo));
+
 
 #define GC_FORE_COLOR(gc)      (&(gc)->fore_color)
 #define GC_BACK_COLOR(gc)      (&(gc)->back_color)
@@ -2194,11 +2196,12 @@ x_draw_fringe_bitmap (w, row, p)
   Display *display = FRAME_MAC_DISPLAY (f);
   struct face *face = p->face;
   int rowY;
+  int overlay_p = p->overlay_p;
 
 #ifdef MAC_OSX
-  if (p->bx >= 0 && !p->overlay_p)
+  if (!overlay_p)
     {
-      int bx = p->bx, nx = p->nx;
+      int bx = p->bx, by = p->by, nx = p->nx, ny = p->ny;
 
 #if 0  /* MAC_TODO: stipple */
       /* In case the same realized face is used for fringes and
@@ -2227,17 +2230,40 @@ x_draw_fringe_bitmap (w, row, p)
              int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
                           * FRAME_COLUMN_WIDTH (f));
 
-             if (left + width == bx)
+             if (bx < 0
+                 && (left + width == p->x
+                     || p->x + p->wd == left))
                {
-                 bx = left + sb_width;
-                 nx += width - sb_width;
+                 /* Bitmap fills the fringe and we need background
+                    extension.  */
+                 int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w);
+
+                 bx = p->x;
+                 nx = p->wd;
+                 by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height,
+                                                       row->y));
+                 ny = row->visible_height;
+               }
+
+             if (bx >= 0)
+               {
+                 if (left + width == bx)
+                   {
+                     bx = left + sb_width;
+                     nx += width - sb_width;
+                   }
+                 else if (bx + nx == left)
+                   nx += width - sb_width;
                }
-             else if (bx + nx == left)
-               nx += width - sb_width;
            }
        }
 
-      mac_erase_rectangle (f, face->gc, bx, p->by, nx, p->ny);
+      if (bx >= 0)
+       {
+         mac_erase_rectangle (f, face->gc, bx, by, nx, ny);
+         /* The fringe background has already been filled.  */
+         overlay_p = 1;
+       }
 
 #if 0  /* MAC_TODO: stipple */
       if (!face->stipple)
@@ -2302,10 +2328,10 @@ x_draw_fringe_bitmap (w, row, p)
                       : face->foreground));
 #if USE_CG_DRAWING
       mac_draw_cg_image (fringe_bmp[p->which], f, face->gc, 0, p->dh,
-                        p->wd, p->h, p->x, p->y, p->overlay_p);
+                        p->wd, p->h, p->x, p->y, overlay_p);
 #else
       mac_draw_bitmap (f, face->gc, p->x, p->y,
-                      p->wd, p->h, p->bits + p->dh, p->overlay_p);
+                      p->wd, p->h, p->bits + p->dh, overlay_p);
 #endif
       XSetForeground (display, face->gc, gcv.foreground);
     }
@@ -2365,7 +2391,7 @@ mac_destroy_fringe_bitmap (which)
    rarely happens).  */
 
 static void
-XTset_terminal_modes ()
+XTset_terminal_modes (struct terminal *t)
 {
 }
 
@@ -2373,7 +2399,7 @@ XTset_terminal_modes ()
    the windows go away, and suspending requires no action.  */
 
 static void
-XTreset_terminal_modes ()
+XTreset_terminal_modes (struct terminal *t)
 {
 }
 
@@ -3032,10 +3058,17 @@ x_draw_composite_glyph_string_foreground (s)
   else
     {
       for (i = 0; i < s->nchars; i++, ++s->gidx)
-       mac_draw_image_string_16 (s->f, s->gc,
-                                 x + s->cmp->offsets[s->gidx * 2],
-                                 s->ybase - s->cmp->offsets[s->gidx * 2 + 1],
-                                 s->char2b + i, 1, 0, s->face->overstrike);
+       if (mac_per_char_metric (GC_FONT (s->gc), s->char2b + i, 0) == NULL)
+         /* This is a nonexistent or zero-width glyph such as a
+            combining diacritic.  Draw a rectangle.  */
+         mac_draw_rectangle (s->f, s->gc,
+                             x + s->cmp->offsets[s->gidx * 2], s->y,
+                             FONT_WIDTH (GC_FONT (s->gc)) - 1, s->height - 1);
+       else
+         mac_draw_image_string_16 (s->f, s->gc,
+                                   x + s->cmp->offsets[s->gidx * 2],
+                                   s->ybase - s->cmp->offsets[s->gidx * 2 + 1],
+                                   s->char2b + i, 1, 0, s->face->overstrike);
     }
 }
 
@@ -4016,15 +4049,8 @@ x_delete_glyphs (n)
    frame.  Otherwise clear the selected frame.  */
 
 static void
-x_clear_frame ()
+x_clear_frame (struct frame *f)
 {
-  struct frame *f;
-
-  if (updating_frame)
-    f = updating_frame;
-  else
-    f = SELECTED_FRAME ();
-
   /* Clearing the frame will erase any cursor, so mark them all as no
      longer visible.  */
   mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f)));
@@ -4310,14 +4336,6 @@ static void
 frame_highlight (f)
      struct frame *f;
 {
-  OSErr err;
-  ControlRef root_control;
-
-  BLOCK_INPUT;
-  err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
-  if (err == noErr)
-    ActivateControl (root_control);
-  UNBLOCK_INPUT;
   x_update_cursor (f, 1);
 }
 
@@ -4325,14 +4343,6 @@ static void
 frame_unhighlight (f)
      struct frame *f;
 {
-  OSErr err;
-  ControlRef root_control;
-
-  BLOCK_INPUT;
-  err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
-  if (err == noErr)
-    DeactivateControl (root_control);
-  UNBLOCK_INPUT;
   x_update_cursor (f, 1);
 }
 
@@ -4558,7 +4568,7 @@ note_mouse_movement (frame, pos)
       clear_mouse_face (dpyinfo);
       dpyinfo->mouse_face_mouse_frame = 0;
       if (!dpyinfo->grabbed)
-       rif->define_frame_cursor (frame,
+       FRAME_RIF (frame)->define_frame_cursor (frame,
                                  frame->output_data.mac->nontext_cursor);
     }
 
@@ -6090,7 +6100,9 @@ free_frame_tool_bar (f)
 
       BLOCK_INPUT;
       ShowHideWindowToolbar (FRAME_MAC_WINDOW (f), false,
-                            f == mac_focus_frame (dpyinfo));
+                            (NILP (Fsymbol_value
+                                   (intern ("frame-notice-user-settings")))
+                             && f == mac_focus_frame (dpyinfo)));
       /* Mac OS X 10.3 does not issue kEventWindowBoundsChanged events
         on toolbar visibility change.  */
       mac_handle_origin_change (f);
@@ -9367,11 +9379,13 @@ mac_handle_font_event (next_handler, event, data)
   static const EventParamName names_sel[] = {kEventParamATSUFontID,
                                             kEventParamATSUFontSize,
                                             kEventParamFMFontFamily,
+                                            kEventParamFMFontStyle,
                                             kEventParamFMFontSize,
                                             kEventParamFontColor};
   static const EventParamType types_sel[] = {typeATSUFontID,
                                             typeATSUSize,
                                             typeFMFontFamily,
+                                            typeFMFontStyle,
                                             typeFMFontSize,
                                             typeFontColor};
 
@@ -10692,7 +10706,7 @@ mac_handle_window_event (next_handler, event, data)
        {
          struct frame *sf = SELECTED_FRAME ();
 
-         if (!(FRAME_MAC_P (sf)))
+         if (!(FRAME_MAC_P (sf) && sf->async_visible))
            RepositionWindow (wp, NULL, kWindowCenterOnMainScreen);
          else
            {
@@ -10707,8 +10721,11 @@ mac_handle_window_event (next_handler, event, data)
              /* This is a workaround.  RepositionWindow fails to put
                 a window at the cascading position when its parent
                 window has a Carbon HIToolbar.  */
-             if (f->top_pos == sf->top_pos && f->left_pos == sf->left_pos)
-               MoveWindowStructure (wp,  f->left_pos + 10, f->top_pos + 32);
+             if ((f->left_pos == sf->left_pos
+                  && f->top_pos == sf->top_pos)
+                 || (f->left_pos == sf->left_pos + 10 * 2
+                     && f->top_pos == sf->top_pos + 32 * 2))
+               MoveWindowStructure (wp, sf->left_pos + 10, sf->top_pos + 32);
 #endif
            }
          result = noErr;
@@ -10933,7 +10950,7 @@ mac_handle_keyboard_event (next_handler, event, data)
      void *data;
 {
   OSStatus err, result = eventNotHandledErr;
-  UInt32 event_kind, key_code, modifiers, mapped_modifiers;
+  UInt32 event_kind, key_code, modifiers;
   unsigned char char_code;
 
   event_kind = GetEventKind (event);
@@ -10942,32 +10959,16 @@ mac_handle_keyboard_event (next_handler, event, data)
     case kEventRawKeyDown:
     case kEventRawKeyRepeat:
     case kEventRawKeyUp:
-      if (read_socket_inev == NULL)
-       {
-         result = CallNextEventHandler (next_handler, event);
-         break;
-       }
-
-      err = GetEventParameter (event, kEventParamKeyModifiers,
-                              typeUInt32, NULL,
-                              sizeof (UInt32), NULL, &modifiers);
-      if (err != noErr)
-       break;
-
-      mapped_modifiers = mac_mapped_modifiers (modifiers);
-
       /* When using Carbon Events, we need to pass raw keyboard events
         to the TSM ourselves.  If TSM handles it, it will pass back
         noErr, otherwise it will pass back "eventNotHandledErr" and
         we can process it normally.  */
-      if (!(mapped_modifiers
-           & ~(mac_pass_command_to_system ? cmdKey : 0)
-           & ~(mac_pass_control_to_system ? controlKey : 0)))
-       {
-         result = CallNextEventHandler (next_handler, event);
-         if (result != eventNotHandledErr)
-           break;
-       }
+      result = CallNextEventHandler (next_handler, event);
+      if (result != eventNotHandledErr)
+       break;
+
+      if (read_socket_inev == NULL)
+       break;
 
 #if USE_MAC_TSM
       if (read_socket_inev->kind != NO_EVENT)
@@ -10992,6 +10993,12 @@ mac_handle_keyboard_event (next_handler, event, data)
       if (err != noErr)
        break;
 
+      err = GetEventParameter (event, kEventParamKeyModifiers,
+                              typeUInt32, NULL,
+                              sizeof (UInt32), NULL, &modifiers);
+      if (err != noErr)
+       break;
+
       do_keystroke ((event_kind == kEventRawKeyDown ? keyDown : autoKey),
                    char_code, key_code, modifiers,
                    ((unsigned long)
@@ -11140,7 +11147,7 @@ mac_handle_text_input_event (next_handler, event, data)
      EventRef event;
      void *data;
 {
-  OSStatus result, err = noErr;
+  OSStatus err, result;
   Lisp_Object id_key = Qnil;
   int num_params;
   const EventParamName *names;
@@ -11201,6 +11208,7 @@ mac_handle_text_input_event (next_handler, event, data)
       SetEventParameter (event, EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER,
                         typeUInt32, sizeof (UInt32), &seqno_uaia);
       seqno_uaia++;
+      result = noErr;
       break;
 
     case kEventTextInputUnicodeForKeyEvent:
@@ -11218,7 +11226,7 @@ mac_handle_text_input_event (next_handler, event, data)
        if (err == noErr && mac_mapped_modifiers (modifiers))
          /* There're mapped modifier keys.  Process it in
             do_keystroke.  */
-         return eventNotHandledErr;
+         break;
        if (err == noErr)
          err = GetEventParameter (kbd_event, kEventParamKeyUnicodes,
                                   typeUnicodeText, NULL, 0, &actual_size,
@@ -11257,16 +11265,20 @@ mac_handle_text_input_event (next_handler, event, data)
                        XSETFRAME (read_socket_inev->frame_or_window, f);
                      }
                  }
-               return eventNotHandledErr;
+               break;
              }
          }
+       if (err == noErr)
+         {
+           /* Non-ASCII keystrokes without mapped modifiers are
+              processed at the Lisp level.  */
+           id_key = Qunicode_for_key_event;
+           num_params = sizeof (names_ufke) / sizeof (names_ufke[0]);
+           names = names_ufke;
+           types = types_ufke;
+           result = noErr;
+         }
       }
-      /* Non-ASCII keystrokes without mapped modifiers are processed
-        at the Lisp level.  */
-      id_key = Qunicode_for_key_event;
-      num_params = sizeof (names_ufke) / sizeof (names_ufke[0]);
-      names = names_ufke;
-      types = types_ufke;
       break;
 
     case kEventTextInputOffsetToPos:
@@ -11276,22 +11288,24 @@ mac_handle_text_input_event (next_handler, event, data)
        Point p;
 
        if (!OVERLAYP (Vmac_ts_active_input_overlay))
-         return eventNotHandledErr;
+         break;
 
        /* Strictly speaking, this is not always correct because
           previous events may change some states about display.  */
-       if (NILP (Foverlay_get (Vmac_ts_active_input_overlay, Qbefore_string)))
+       if (!NILP (Foverlay_get (Vmac_ts_active_input_overlay, Qbefore_string)))
+         {
+           /* Active input area is displayed around the current point.  */
+           f = SELECTED_FRAME ();
+           w = XWINDOW (f->selected_window);
+         }
+       else if (WINDOWP (echo_area_window))
          {
            /* Active input area is displayed in the echo area.  */
            w = XWINDOW (echo_area_window);
            f = WINDOW_XFRAME (w);
          }
        else
-         {
-           /* Active input area is displayed around the current point.  */
-           f = SELECTED_FRAME ();
-           w = XWINDOW (f->selected_window);
-         }
+         break;
 
        p.h = (WINDOW_TO_FRAME_PIXEL_X (w, w->cursor.x)
               + WINDOW_LEFT_FRINGE_WIDTH (w)
@@ -11301,6 +11315,8 @@ mac_handle_text_input_event (next_handler, event, data)
               + f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f));
        err = SetEventParameter (event, kEventParamTextInputReplyPoint,
                                 typeQDPoint, sizeof (typeQDPoint), &p);
+       if (err == noErr)
+         result = noErr;
       }
       break;
 
@@ -11312,9 +11328,6 @@ mac_handle_text_input_event (next_handler, event, data)
     err = mac_store_event_ref_as_apple_event (0, 0, Qtext_input, id_key,
                                              event, num_params,
                                              names, types);
-  if (err == noErr)
-    result = noErr;
-
   return result;
 }
 #endif
@@ -12132,7 +12145,7 @@ XTread_socket (sd, expected, hold_quit)
                          /* Window will be selected only when it is
                             not selected now and last mouse movement
                             event was not in it.  Minibuffer window
-                            will be selected iff it is active.  */
+                            will be selected only when it is active.  */
                          if (WINDOWP (window)
                              && !EQ (window, last_window)
                              && !EQ (window, selected_window))
@@ -12167,6 +12180,8 @@ XTread_socket (sd, expected, hold_quit)
        case activateEvt:
          {
            WindowRef window_ptr = (WindowRef) er.message;
+           OSErr err;
+           ControlRef root_control;
 
            if (window_ptr == tip_window)
              {
@@ -12184,6 +12199,10 @@ XTread_socket (sd, expected, hold_quit)
                /* A window has been activated */
                Point mouse_loc;
 
+               err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
+               if (err == noErr)
+                 ActivateControl (root_control);
+
                x_detect_focus_change (dpyinfo, &er, &inev);
 
                mouse_loc.h = (er.where.h
@@ -12199,6 +12218,10 @@ XTread_socket (sd, expected, hold_quit)
            else
              {
                /* A window has been deactivated */
+               err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
+               if (err == noErr)
+                 DeactivateControl (root_control);
+
 #ifdef USE_TOOLKIT_SCROLL_BARS
                if (dpyinfo->grabbed && tracked_scroll_bar)
                  {
@@ -12254,13 +12277,29 @@ XTread_socket (sd, expected, hold_quit)
              clear_mouse_face (dpyinfo);
              dpyinfo->mouse_face_hidden = 1;
            }
+
+         {
+           UInt32 modifiers = er.modifiers, mapped_modifiers;
+
+#ifdef MAC_OSX
+           GetEventParameter (eventRef, kEventParamKeyModifiers,
+                              typeUInt32, NULL,
+                              sizeof (UInt32), NULL, &modifiers);
+#endif
+           mapped_modifiers = mac_mapped_modifiers (modifiers);
+
 #if TARGET_API_MAC_CARBON
-         goto OTHER;
-#else
-         do_keystroke (er.what, er.message & charCodeMask,
-                       (er.message & keyCodeMask) >> 8,
-                       er.modifiers, timestamp, &inev);
+           if (!(mapped_modifiers
+                 & ~(mac_pass_command_to_system ? cmdKey : 0)
+                 & ~(mac_pass_control_to_system ? controlKey : 0)))
+             goto OTHER;
+           else
 #endif
+             if (er.what != keyUp)
+               do_keystroke (er.what, er.message & charCodeMask,
+                             (er.message & keyCodeMask) >> 8,
+                             modifiers, timestamp, &inev);
+         }
          break;
 
        case kHighLevelEvent:
@@ -12314,7 +12353,6 @@ XTread_socket (sd, expected, hold_quit)
            }
          count++;
        }
-
     }
 
   /* If the focus was just given to an autoraising frame,
@@ -12488,6 +12526,7 @@ mac_term_init (display_name, xrm_option, resource_name)
      char *resource_name;
 {
   struct mac_display_info *dpyinfo;
+  struct terminal *terminal;
 
   BLOCK_INPUT;
 
@@ -12503,6 +12542,13 @@ mac_term_init (display_name, xrm_option, resource_name)
   dpyinfo = &one_mac_display_info;
   bzero (dpyinfo, sizeof (*dpyinfo));
 
+  terminal = mac_create_terminal (dpyinfo);
+
+  /* Set the name of the terminal. */
+  terminal->name = (char *) xmalloc (SBYTES (display_name) + 1);
+  strncpy (terminal->name, SDATA (display_name), SBYTES (display_name));
+  terminal->name[SBYTES (display_name)] = 0;
+
 #ifdef MAC_OSX
   dpyinfo->mac_id_name
     = (char *) xmalloc (SCHARS (Vinvocation_name)
@@ -12704,44 +12750,71 @@ static struct redisplay_interface x_redisplay_interface =
   mac_shift_glyphs_for_insert
 };
 
-void
+static struct terminal *
+mac_create_terminal (struct mac_display_info *dpyinfo)
+{
+  struct terminal *terminal;
+  
+  terminal = create_terminal ();
+
+  terminal->type = output_mac;
+  terminal->display_info.mac = dpyinfo;
+  dpyinfo->terminal = terminal;
+
+  terminal->clear_frame_hook = x_clear_frame;
+  terminal->ins_del_lines_hook = x_ins_del_lines;
+  terminal->delete_glyphs_hook = x_delete_glyphs;
+  terminal->ring_bell_hook = XTring_bell;
+  terminal->reset_terminal_modes_hook = XTreset_terminal_modes;
+  terminal->set_terminal_modes_hook = XTset_terminal_modes;
+  terminal->update_begin_hook = x_update_begin;
+  terminal->update_end_hook = x_update_end;
+  terminal->set_terminal_window_hook = XTset_terminal_window;
+  terminal->read_socket_hook = XTread_socket;
+  terminal->frame_up_to_date_hook = XTframe_up_to_date;
+  terminal->mouse_position_hook = XTmouse_position;
+  terminal->frame_rehighlight_hook = XTframe_rehighlight;
+  terminal->frame_raise_lower_hook = XTframe_raise_lower;
+  /* terminal->fullscreen_hook = XTfullscreen_hook; */
+  terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
+  terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars;
+  terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar;
+  terminal->judge_scroll_bars_hook = XTjudge_scroll_bars;
+  terminal->delete_frame_hook = x_destroy_window;
+  /* terminal->delete_terminal_hook = x_delete_terminal; */
+
+  terminal->rif = &x_redisplay_interface;
+#if 0
+  TTY_SCROLL_REGION_OK (CURTTY ()) = 1; /* we'll scroll partial frames */
+  TTY_CHAR_INS_DEL_OK (CURTTY ()) = 1;
+  TTY_LINE_INS_DEL_OK (CURTTY ()) = 1; /* we'll just blt 'em */
+  TTY_FAST_CLEAR_END_OF_LINE (CURTTY ()) = 1; /* X does this well */
+  TTY_MEMORY_BELOW_FRAME (CURTTY ()) = 0; /* we don't remember what
+                                                         scrolls off the
+                                                         bottom */
+#else
+  terminal->scroll_region_ok = 1;    /* We'll scroll partial frames. */
+  terminal->char_ins_del_ok = 1;
+  terminal->line_ins_del_ok = 1;         /* We'll just blt 'em. */
+  terminal->fast_clear_end_of_line = 1;  /* X does this well. */
+  terminal->memory_below_frame = 0;   /* We don't remember what scrolls
+                                        off the bottom. */
+
+#endif
+  return terminal;
+}
+
+static void
 mac_initialize ()
 {
-  rif = &x_redisplay_interface;
-
-  clear_frame_hook = x_clear_frame;
-  ins_del_lines_hook = x_ins_del_lines;
-  delete_glyphs_hook = x_delete_glyphs;
-  ring_bell_hook = XTring_bell;
-  reset_terminal_modes_hook = XTreset_terminal_modes;
-  set_terminal_modes_hook = XTset_terminal_modes;
-  update_begin_hook = x_update_begin;
-  update_end_hook = x_update_end;
-  set_terminal_window_hook = XTset_terminal_window;
-  read_socket_hook = XTread_socket;
-  frame_up_to_date_hook = XTframe_up_to_date;
-  mouse_position_hook = XTmouse_position;
-  frame_rehighlight_hook = XTframe_rehighlight;
-  frame_raise_lower_hook = XTframe_raise_lower;
-
-  set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
-  condemn_scroll_bars_hook = XTcondemn_scroll_bars;
-  redeem_scroll_bar_hook = XTredeem_scroll_bar;
-  judge_scroll_bars_hook = XTjudge_scroll_bars;
-
-  scroll_region_ok = 1;         /* we'll scroll partial frames */
-  char_ins_del_ok = 1;
-  line_ins_del_ok = 1;          /* we'll just blt 'em */
-  fast_clear_end_of_line = 1;   /* X does this well */
-  memory_below_frame = 0;       /* we don't remember what scrolls
-                                  off the bottom */
+
   baud_rate = 19200;
 
   last_tool_bar_item = -1;
   any_help_event_p = 0;
 
   /* Try to use interrupt input; if we can't, then start polling.  */
-  Fset_input_mode (Qt, Qnil, Qt, Qnil);
+  Fset_input_interrupt_mode (Qt);
 
   BLOCK_INPUT;
 
@@ -12778,6 +12851,7 @@ mac_initialize ()
 #endif
 
   UNBLOCK_INPUT;
+
 }