/[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.142 by tamm, Fri Nov 11 16:33:44 2005 UTC revision 1.143 by mituharu, Sun Nov 13 05:46:52 2005 UTC
# Line 86  Boston, MA 02110-1301, USA.  */ Line 86  Boston, MA 02110-1301, USA.  */
86  #include "intervals.h"  #include "intervals.h"
87  #include "atimer.h"  #include "atimer.h"
88  #include "keymap.h"  #include "keymap.h"
89    
90    
91    
92  /* Non-nil means Emacs uses toolkit scroll bars.  */  /* Non-nil means Emacs uses toolkit scroll bars.  */
# Line 771  mac_draw_string_common (f, gc, x, y, buf Line 771  mac_draw_string_common (f, gc, x, y, buf
771                QDEndCGContext (port, &context);                QDEndCGContext (port, &context);
772  #if 0  #if 0
773                /* This doesn't work on Mac OS X 10.1.  */                /* This doesn't work on Mac OS X 10.1.  */
774                ATSUClearLayoutControls (text_layout,                ATSUClearLayoutControls (text_layout,
775                                         sizeof (tags) / sizeof (tags[0]),                                         sizeof (tags) / sizeof (tags[0]),
776                                         tags);                                         tags);
777  #else  #else
# Line 864  mac_draw_image_string_16 (f, gc, x, y, b Line 864  mac_draw_image_string_16 (f, gc, x, y, b
864  }  }
865    
866    
867    #if USE_CG_TEXT_DRAWING
868    static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *));
869    
870    static int
871    mac_draw_string_cg (f, gc, x, y, buf, nchars)
872         struct frame *f;
873         GC gc;
874         int x, y;
875         XChar2b *buf;
876         int nchars;
877    {
878      CGrafPtr port;
879      float port_height, gx, gy;
880      int i;
881      CGContextRef context;
882      CGGlyph *glyphs;
883      CGSize *advances;
884    
885      if (NILP (Vmac_use_core_graphics) || GC_FONT (gc)->cg_font == NULL)
886        return 0;
887    
888      port = GetWindowPort (FRAME_MAC_WINDOW (f));
889      port_height = FRAME_PIXEL_HEIGHT (f);
890      gx = x;
891      gy = port_height - y;
892      glyphs = (CGGlyph *)buf;
893      advances = xmalloc (sizeof (CGSize) * nchars);
894      for (i = 0; i < nchars; i++)
895        {
896          advances[i].width = x_per_char_metric (GC_FONT (gc), buf)->width;
897          advances[i].height = 0;
898          glyphs[i] = GC_FONT (gc)->cg_glyphs[buf->byte2];
899          buf++;
900        }
901    
902      QDBeginCGContext (port, &context);
903      if (gc->n_clip_rects)
904        {
905          CGContextTranslateCTM (context, 0, port_height);
906          CGContextScaleCTM (context, 1, -1);
907          CGContextClipToRects (context, gc->clip_rects, gc->n_clip_rects);
908          CGContextScaleCTM (context, 1, -1);
909          CGContextTranslateCTM (context, 0, -port_height);
910        }
911      CGContextSetRGBFillColor (context,
912                                RED_FROM_ULONG (gc->xgcv.foreground) / 255.0,
913                                GREEN_FROM_ULONG (gc->xgcv.foreground) / 255.0,
914                                BLUE_FROM_ULONG (gc->xgcv.foreground) / 255.0,
915                                1.0);
916      CGContextSetFont (context, GC_FONT (gc)->cg_font);
917      CGContextSetFontSize (context, GC_FONT (gc)->mac_fontsize);
918    #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
919      CGContextSetTextPosition (context, gx, gy);
920      CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars);
921    #else
922      for (i = 0; i < nchars; i++)
923        {
924          CGContextShowGlyphsAtPoint (context, gx, gy, glyphs + i, 1);
925          gx += advances[i].width;
926        }
927    #endif
928      CGContextSynchronize (context);
929      QDEndCGContext (port, &context);
930    
931      xfree (advances);
932    
933      return 1;
934    }
935    #endif
936    
937    
938  /* Mac replacement for XCopyArea: dest must be window.  */  /* Mac replacement for XCopyArea: dest must be window.  */
939    
940  static void  static void
# Line 2258  x_draw_glyph_string_foreground (s) Line 2329  x_draw_glyph_string_foreground (s)
2329                || GC_FONT (s->gc)->mac_style                || GC_FONT (s->gc)->mac_style
2330  #endif  #endif
2331                )                )
2332    #if USE_CG_TEXT_DRAWING
2333                if (!s->two_byte_p
2334                    && mac_draw_string_cg (s->f, s->gc, x, s->ybase - boff,
2335                                           s->char2b, s->nchars))
2336                  ;
2337                else
2338    #endif
2339              mac_draw_string_16 (s->f, s->gc, x, s->ybase - boff,              mac_draw_string_16 (s->f, s->gc, x, s->ybase - boff,
2340                                  s->char2b, s->nchars);                                  s->char2b, s->nchars);
2341            else            else
# Line 7281  XLoadQueryFont (Display *dpy, char *font Line 7359  XLoadQueryFont (Display *dpy, char *font
7359    Str31 charset;    Str31 charset;
7360    SInt16 fontnum;    SInt16 fontnum;
7361  #if USE_ATSUI  #if USE_ATSUI
7362      static ATSUFontID font_id;
7363    ATSUStyle mac_style = NULL;    ATSUStyle mac_style = NULL;
7364  #endif  #endif
7365    Style fontface;    Style fontface;
# Line 7315  XLoadQueryFont (Display *dpy, char *font Line 7394  XLoadQueryFont (Display *dpy, char *font
7394                                   kATSUQDBoldfaceTag, kATSUQDItalicTag};                                   kATSUQDBoldfaceTag, kATSUQDItalicTag};
7395        ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed),        ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed),
7396                             sizeof (Boolean), sizeof (Boolean)};                             sizeof (Boolean), sizeof (Boolean)};
       static ATSUFontID font_id;  
7397        static Fixed size_fixed;        static Fixed size_fixed;
7398        static Boolean bold_p, italic_p;        static Boolean bold_p, italic_p;
7399        ATSUAttributeValuePtr values[] = {&font_id, &size_fixed,        ATSUAttributeValuePtr values[] = {&font_id, &size_fixed,
# Line 7369  XLoadQueryFont (Display *dpy, char *font Line 7447  XLoadQueryFont (Display *dpy, char *font
7447    font->mac_scriptcode = scriptcode;    font->mac_scriptcode = scriptcode;
7448  #if USE_ATSUI  #if USE_ATSUI
7449    font->mac_style = mac_style;    font->mac_style = mac_style;
7450    #if USE_CG_TEXT_DRAWING
7451      font->cg_font = NULL;
7452      font->cg_glyphs = NULL;
7453    #endif
7454  #endif  #endif
7455    
7456    /* Apple Japanese (SJIS) font is listed as both    /* Apple Japanese (SJIS) font is listed as both
# Line 7398  XLoadQueryFont (Display *dpy, char *font Line 7480  XLoadQueryFont (Display *dpy, char *font
7480          }          }
7481        bzero (font->per_char, sizeof (XCharStruct) * 0x10000);        bzero (font->per_char, sizeof (XCharStruct) * 0x10000);
7482    
7483    #if USE_CG_TEXT_DRAWING
7484          {
7485            FMFontFamily font_family;
7486            FMFontStyle style;
7487            ATSFontRef ats_font;
7488    
7489            err = FMGetFontFamilyInstanceFromFont (font_id, &font_family, &style);
7490            if (err == noErr)
7491              err = FMGetFontFromFontFamilyInstance (font_family, fontface,
7492                                                     &font_id, &style);
7493            /* Use CG text drawing if italic/bold is not synthesized.  */
7494            if (err == noErr && style == fontface)
7495              {
7496                ats_font = FMGetATSFontRefFromFont (font_id);
7497                font->cg_font = CGFontCreateWithPlatformFont (&ats_font);
7498              }
7499          }
7500    
7501          if (font->cg_font)
7502            font->cg_glyphs = xmalloc (sizeof (CGGlyph) * 0x100);
7503          if (font->cg_glyphs)
7504            bzero (font->cg_glyphs, sizeof (CGGlyph) * 0x100);
7505    #endif
7506    
7507        err = atsu_get_text_layout_with_text_ptr (&c, 1,        err = atsu_get_text_layout_with_text_ptr (&c, 1,
7508                                                  font->mac_style,                                                  font->mac_style,
7509                                                  &text_layout);                                                  &text_layout);
# Line 7407  XLoadQueryFont (Display *dpy, char *font Line 7513  XLoadQueryFont (Display *dpy, char *font
7513            return NULL;            return NULL;
7514          }          }
7515    
7516        for (c = 0x20; c <= 0x7e; c++)        for (c = 0x20; c <= 0xff; c++)
7517          {          {
7518              if (c == 0xad)
7519                /* Soft hyphen is not supported in ATSUI.  */
7520                continue;
7521              else if (c == 0x7f)
7522                {
7523                  STORE_XCHARSTRUCT (font->min_bounds, min_width, min_bounds);
7524                  STORE_XCHARSTRUCT (font->max_bounds, max_width, max_bounds);
7525                  c = 0x9f;
7526                  continue;
7527                }
7528    
7529            err = ATSUClearLayoutCache (text_layout, kATSUFromTextBeginning);            err = ATSUClearLayoutCache (text_layout, kATSUFromTextBeginning);
7530            if (err == noErr)            if (err == noErr)
7531              err = ATSUMeasureTextImage (text_layout,              err = ATSUMeasureTextImage (text_layout,
# Line 7457  XLoadQueryFont (Display *dpy, char *font Line 7574  XLoadQueryFont (Display *dpy, char *font
7574                      }                      }
7575                  }                  }
7576              }              }
7577    #if USE_CG_TEXT_DRAWING
7578              if (err == noErr && char_width > 0 && font->cg_font)
7579                {
7580                  ATSUGlyphInfoArray glyph_info_array;
7581                  ByteCount count = sizeof (ATSUGlyphInfoArray);
7582    
7583                  err = ATSUMatchFontsToText (text_layout, kATSUFromTextBeginning,
7584                                              kATSUToTextEnd, NULL, NULL, NULL);
7585                  if (err == noErr)
7586                    err = ATSUGetGlyphInfo (text_layout, kATSUFromTextBeginning,
7587                                            kATSUToTextEnd, &count,
7588                                            &glyph_info_array);
7589                  if (err == noErr)
7590                    font->cg_glyphs[c] = glyph_info_array.glyphs[0].glyphID;
7591                  else
7592                    {
7593                      /* Don't use CG text drawing if font substitution
7594                         occurs in ASCII or Latin-1 characters.  */
7595                      CGFontRelease (font->cg_font);
7596                      font->cg_font = NULL;
7597                      xfree (font->cg_glyphs);
7598                      font->cg_glyphs = NULL;
7599                    }
7600                }
7601    #endif
7602          }          }
       STORE_XCHARSTRUCT (font->min_bounds, min_width, min_bounds);  
       STORE_XCHARSTRUCT (font->max_bounds, max_width, max_bounds);  
7603    
7604        font->min_byte1 = 0;        font->min_byte1 = 0;
7605        font->max_byte1 = 0xff;        font->max_byte1 = 0xff;
# Line 7572  XLoadQueryFont (Display *dpy, char *font Line 7712  XLoadQueryFont (Display *dpy, char *font
7712            SetRect (&max_bounds, 0, 0, 0, 0);            SetRect (&max_bounds, 0, 0, 0, 0);
7713            for (c = 0x20; c <= 0xff; c++)            for (c = 0x20; c <= 0xff; c++)
7714              {              {
7715                  if (c == 0x7f)
7716                    {
7717                      STORE_XCHARSTRUCT (font->min_bounds, min_width, min_bounds);
7718                      STORE_XCHARSTRUCT (font->max_bounds, max_width, max_bounds);
7719                      continue;
7720                    }
7721    
7722                ch = c;                ch = c;
7723                char_width = CharWidth (ch);                char_width = CharWidth (ch);
7724                QDTextBounds (1, &ch, &char_bounds);                QDTextBounds (1, &ch, &char_bounds);
# Line 7594  XLoadQueryFont (Display *dpy, char *font Line 7741  XLoadQueryFont (Display *dpy, char *font
7741                    UnionRect (&max_bounds, &char_bounds, &max_bounds);                    UnionRect (&max_bounds, &char_bounds, &max_bounds);
7742                  }                  }
7743              }              }
           STORE_XCHARSTRUCT (font->min_bounds, min_width, min_bounds);  
           STORE_XCHARSTRUCT (font->max_bounds, max_width, max_bounds);  
7744            if (min_width == max_width            if (min_width == max_width
7745                && max_bounds.left >= 0 && max_bounds.right <= max_width)                && max_bounds.left >= 0 && max_bounds.right <= max_width)
7746              {              {
# Line 7611  XLoadQueryFont (Display *dpy, char *font Line 7756  XLoadQueryFont (Display *dpy, char *font
7756        TextFace (old_fontface);        TextFace (old_fontface);
7757      }      }
7758    
7759    #if !defined (MAC_OS8) || USE_ATSUI
7760      /* AppKit and WebKit do some adjustment to the heights of Courier,
7761         Helvetica, and Times.  This only works on the environments where
7762         the XDrawImageString counterpart is never used.  */
7763      if (strcmp (family, "courier") == 0 || strcmp (family, "helvetica") == 0
7764          || strcmp (family, "times") == 0)
7765        font->ascent += (font->ascent + font->descent) * .15 + 0.5;
7766    #endif
7767    
7768    return font;    return font;
7769  }  }
7770    
# Line 7626  mac_unload_font (dpyinfo, font) Line 7780  mac_unload_font (dpyinfo, font)
7780  #if USE_ATSUI  #if USE_ATSUI
7781    if (font->mac_style)    if (font->mac_style)
7782      ATSUDisposeStyle (font->mac_style);      ATSUDisposeStyle (font->mac_style);
7783    #if USE_CG_TEXT_DRAWING
7784      if (font->cg_font)
7785        CGFontRelease (font->cg_font);
7786      if (font->cg_glyphs)
7787        xfree (font->cg_glyphs);
7788    #endif
7789  #endif  #endif
7790    xfree (font);    xfree (font);
7791  }  }
# Line 8000  mac_to_emacs_modifiers (EventModifiers m Line 8160  mac_to_emacs_modifiers (EventModifiers m
8160    unsigned int result = 0;    unsigned int result = 0;
8161    if (mods & shiftKey)    if (mods & shiftKey)
8162      result |= shift_modifier;      result |= shift_modifier;
8163    
8164    
8165    
8166    /* Deactivated to simplify configuration:    /* Deactivated to simplify configuration:
8167       if Vmac_option_modifier is non-NIL, we fully process the Option       if Vmac_option_modifier is non-NIL, we fully process the Option
8168       key. Otherwise, we only process it if an additional Ctrl or Command       key. Otherwise, we only process it if an additional Ctrl or Command
8169       is pressed. That way the system may convert the character to a       is pressed. That way the system may convert the character to a
8170       composed one.       composed one.
8171       if ((mods & optionKey) &&       if ((mods & optionKey) &&
8172        (( !NILP(Vmac_option_modifier) ||        (( !NILP(Vmac_option_modifier) ||
8173        ((mods & cmdKey) || (mods & controlKey))))) */        ((mods & cmdKey) || (mods & controlKey))))) */
8174    
8175    if (!NILP (Vmac_option_modifier) && (mods & optionKey)) {    if (!NILP (Vmac_option_modifier) && (mods & optionKey)) {
# Line 8021  mac_to_emacs_modifiers (EventModifiers m Line 8181  mac_to_emacs_modifiers (EventModifiers m
8181      Lisp_Object val = Fget(Vmac_command_modifier, Qmodifier_value);      Lisp_Object val = Fget(Vmac_command_modifier, Qmodifier_value);
8182      if (INTEGERP(val))      if (INTEGERP(val))
8183        result |= XUINT(val);        result |= XUINT(val);
8184    }      }
8185    if (!NILP (Vmac_control_modifier) && (mods & controlKey)) {    if (!NILP (Vmac_control_modifier) && (mods & controlKey)) {
8186      Lisp_Object val = Fget(Vmac_control_modifier, Qmodifier_value);      Lisp_Object val = Fget(Vmac_control_modifier, Qmodifier_value);
8187      if (INTEGERP(val))      if (INTEGERP(val))
8188        result |= XUINT(val);        result |= XUINT(val);
8189    }      }
8190    
8191  #ifdef MAC_OSX  #ifdef MAC_OSX
8192    if (!NILP (Vmac_function_modifier) && (mods & kEventKeyModifierFnMask)) {    if (!NILP (Vmac_function_modifier) && (mods & kEventKeyModifierFnMask)) {
8193      Lisp_Object val = Fget(Vmac_function_modifier, Qmodifier_value);      Lisp_Object val = Fget(Vmac_function_modifier, Qmodifier_value);
8194      if (INTEGERP(val))      if (INTEGERP(val))
8195        result |= XUINT(val);        result |= XUINT(val);
8196    }    }
8197  #endif  #endif
8198    
8199    return result;    return result;
8200  }  }
8201    
# Line 9407  static unsigned char keycode_to_xkeysym_ Line 9567  static unsigned char keycode_to_xkeysym_
9567  };  };
9568    
9569    
9570  static int  static int
9571  keycode_to_xkeysym (int keyCode, int *xKeySym)  keycode_to_xkeysym (int keyCode, int *xKeySym)
9572  {  {
9573    *xKeySym = keycode_to_xkeysym_table [keyCode & 0x7f];    *xKeySym = keycode_to_xkeysym_table [keyCode & 0x7f];
# Line 9448  static int Line 9608  static int
9608  convert_fn_keycode (EventRef eventRef, int keyCode, int *newCode)  convert_fn_keycode (EventRef eventRef, int keyCode, int *newCode)
9609  {  {
9610  #ifdef MAC_OSX  #ifdef MAC_OSX
9611    /* Use the special map to translate keys when function modifier is    /* Use the special map to translate keys when function modifier is
9612       to be caught. KeyTranslate can't be used in that case.       to be caught. KeyTranslate can't be used in that case.
9613       We can't detect the function key using the input_event.modifiers,       We can't detect the function key using the input_event.modifiers,
9614       because this uses the high word of an UInt32. Therefore,       because this uses the high word of an UInt32. Therefore,
# Line 9464  convert_fn_keycode (EventRef eventRef, i Line 9624  convert_fn_keycode (EventRef eventRef, i
9624    
9625    - The table is meant for English language keyboards, and it will work    - The table is meant for English language keyboards, and it will work
9626    for many others with the exception of key combinations like Fn-ö on    for many others with the exception of key combinations like Fn-ö on
9627    a German keyboard, which is currently mapped to Fn-;.    a German keyboard, which is currently mapped to Fn-;.
9628    How to solve this without keeping separate tables for all keyboards    How to solve this without keeping separate tables for all keyboards
9629    around? KeyTranslate isn't of much help here, as it only takes a 16-bit    around? KeyTranslate isn't of much help here, as it only takes a 16-bit
9630    value for keycode with the modifiers in he high byte, i.e. no room for the    value for keycode with the modifiers in he high byte, i.e. no room for the
# Line 9473  convert_fn_keycode (EventRef eventRef, i Line 9633  convert_fn_keycode (EventRef eventRef, i
9633    */    */
9634    
9635    UInt32 mods = 0;    UInt32 mods = 0;
9636    if (!NILP(Vmac_function_modifier))      if (!NILP(Vmac_function_modifier))
9637      {      {
9638        GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL,        GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL,
9639                           sizeof (UInt32), NULL, &mods);                           sizeof (UInt32), NULL, &mods);
9640        if (mods & kEventKeyModifierFnMask)        if (mods & kEventKeyModifierFnMask)
9641          {  *newCode = fn_keycode_to_xkeysym_table [keyCode & 0x7f];          {  *newCode = fn_keycode_to_xkeysym_table [keyCode & 0x7f];
9642              
9643            return (*newCode != 0);            return (*newCode != 0);
9644          }          }
9645      }      }
# Line 9487  convert_fn_keycode (EventRef eventRef, i Line 9647  convert_fn_keycode (EventRef eventRef, i
9647    return false;    return false;
9648  }  }
9649    
9650  static int  static int
9651  backtranslate_modified_keycode(int mods, int keycode, int def)  backtranslate_modified_keycode(int mods, int keycode, int def)
9652  {  {
9653    if  (mods &    if  (mods &
9654         (controlKey |         (controlKey |
9655          (NILP (Vmac_option_modifier) ? 0 : optionKey) |          (NILP (Vmac_option_modifier) ? 0 : optionKey) |
9656          cmdKey))          cmdKey))
9657      {      {
9658        /* This code comes from Keyboard Resource,        /* This code comes from Keyboard Resource,
# Line 9504  backtranslate_modified_keycode(int mods, Line 9664  backtranslate_modified_keycode(int mods,
9664           here also.           here also.
9665    
9666           Not done for combinations with the option key (alt)           Not done for combinations with the option key (alt)
9667           unless it is to be caught by Emacs:  this is           unless it is to be caught by Emacs:  this is
9668           to preserve key combinations translated by the OS           to preserve key combinations translated by the OS
9669           such as Alt-3.           such as Alt-3.
9670        */        */
9671        /* mask off option and command */        /* mask off option and command */
9672        int new_modifiers = mods & 0xe600;        int new_modifiers = mods & 0xe600;
9673        /* set high byte of keycode to modifier high byte*/        /* set high byte of keycode to modifier high byte*/
9674        int new_keycode = keycode | new_modifiers;        int new_keycode = keycode | new_modifiers;
9675        Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);        Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);
# Line 10126  XTread_socket (sd, expected, hold_quit) Line 10286  XTread_socket (sd, expected, hold_quit)
10286                {                {
10287                  inev.code = xkeysym;                  inev.code = xkeysym;
10288                  /* this doesn't work - tried to add shift modifiers */                  /* this doesn't work - tried to add shift modifiers */
10289                    inev.code =                      inev.code =
10290                      backtranslate_modified_keycode(er.modifiers & (~0x2200),                      backtranslate_modified_keycode(er.modifiers & (~0x2200),
10291                                                     xkeysym | 0x80,  xkeysym);                                                     xkeysym | 0x80,  xkeysym);
10292                  inev.kind = ASCII_KEYSTROKE_EVENT;                  inev.kind = ASCII_KEYSTROKE_EVENT;
10293                }                }
10294              else              else
10295  #endif        #endif
10296                if (keycode_to_xkeysym (keycode, &xkeysym))                if (keycode_to_xkeysym (keycode, &xkeysym))
10297                  {                  {
10298                    inev.code = 0xff00 | xkeysym;                    inev.code = 0xff00 | xkeysym;
10299                    inev.kind = NON_ASCII_KEYSTROKE_EVENT;                    inev.kind = NON_ASCII_KEYSTROKE_EVENT;
10300                  }                  }
10301                else                else
10302                  {                  {
10303    
10304                    inev.code =                    inev.code =
10305                      backtranslate_modified_keycode(er.modifiers, keycode,                      backtranslate_modified_keycode(er.modifiers, keycode,
10306                                                     er.message & charCodeMask);                                                     er.message & charCodeMask);
10307                    inev.kind = ASCII_KEYSTROKE_EVENT;                    inev.kind = ASCII_KEYSTROKE_EVENT;
10308    
10309                  }                  }
10310            }            }
10311    
# Line 10587  mac_determine_quit_char_modifiers() Line 10747  mac_determine_quit_char_modifiers()
10747    /* Map modifiers */    /* Map modifiers */
10748    mac_quit_char_modifiers = 0;    mac_quit_char_modifiers = 0;
10749    if (qc_modifiers & ctrl_modifier)  mac_quit_char_modifiers |= controlKey;    if (qc_modifiers & ctrl_modifier)  mac_quit_char_modifiers |= controlKey;
10750    if (qc_modifiers & shift_modifier) mac_quit_char_modifiers |= shiftKey;    if (qc_modifiers & shift_modifier) mac_quit_char_modifiers |= shiftKey;
10751    if (qc_modifiers & alt_modifier)   mac_quit_char_modifiers |= optionKey;    if (qc_modifiers & alt_modifier)   mac_quit_char_modifiers |= optionKey;
10752  }  }
10753    
# Line 10748  syms_of_macterm () Line 10908  syms_of_macterm ()
10908    Qctrl = intern ("ctrl");    Qctrl = intern ("ctrl");
10909    Fput (Qctrl, Qmodifier_value, make_number (ctrl_modifier));    Fput (Qctrl, Qmodifier_value, make_number (ctrl_modifier));
10910    Qmeta = intern ("meta");    Qmeta = intern ("meta");
10911    Fput (Qmeta, Qmodifier_value, make_number (meta_modifier));    Fput (Qmeta, Qmodifier_value, make_number (meta_modifier));
10912    Qalt = intern ("alt");    Qalt = intern ("alt");
10913    Fput (Qalt, Qmodifier_value, make_number (alt_modifier));    Fput (Qalt, Qmodifier_value, make_number (alt_modifier));
10914    Qhyper = intern ("hyper");    Qhyper = intern ("hyper");
# Line 10800  syms_of_macterm () Line 10960  syms_of_macterm ()
10960    
10961    staticpro (&last_mouse_motion_frame);    staticpro (&last_mouse_motion_frame);
10962    last_mouse_motion_frame = Qnil;    last_mouse_motion_frame = Qnil;
10963    
10964    
10965    
10966  /* Variables to configure modifier key assignment.  */  /* Variables to configure modifier key assignment.  */
10967            
10968    DEFVAR_LISP ("mac-control-modifier", &Vmac_control_modifier,    DEFVAR_LISP ("mac-control-modifier", &Vmac_control_modifier,
10969      doc: /* Modifier key assumed when the Mac control key is pressed.        doc: /* Modifier key assumed when the Mac control key is pressed.
10970  The value can be `alt', `ctrl', `hyper', or `super' for the respective  The value can be `alt', `ctrl', `hyper', or `super' for the respective
10971  modifier.  The default is `ctrl'.  */);  modifier.  The default is `ctrl'.  */);
10972    Vmac_control_modifier = Qctrl;    Vmac_control_modifier = Qctrl;
# Line 10815  modifier.  The default is `ctrl'.  */); Line 10975  modifier.  The default is `ctrl'.  */);
10975      doc: /* Modifier key assumed when the Mac alt/option key is pressed.      doc: /* Modifier key assumed when the Mac alt/option key is pressed.
10976  The value can be `alt', `ctrl', `hyper', or `super' for the respective  The value can be `alt', `ctrl', `hyper', or `super' for the respective
10977  modifier.  If the value is nil then the key will act as the normal  modifier.  If the value is nil then the key will act as the normal
10978  Mac control modifier, and the option key can be used to compose  Mac control modifier, and the option key can be used to compose
10979  characters depending on the chosen Mac keyboard setting. */);  characters depending on the chosen Mac keyboard setting. */);
10980    Vmac_option_modifier = Qnil;    Vmac_option_modifier = Qnil;
10981    
10982    DEFVAR_LISP ("mac-command-modifier", &Vmac_command_modifier,    DEFVAR_LISP ("mac-command-modifier", &Vmac_command_modifier,
10983      doc: /* Modifier key assumed when the Mac command key is pressed.        doc: /* Modifier key assumed when the Mac command key is pressed.
10984  The value can be `alt', `ctrl', `hyper', or `super' for the respective  The value can be `alt', `ctrl', `hyper', or `super' for the respective
10985  modifier. The default is `meta'. */);  modifier. The default is `meta'. */);
10986    Vmac_command_modifier = Qmeta;    Vmac_command_modifier = Qmeta;
10987    
10988    DEFVAR_LISP ("mac-function-modifier", &Vmac_function_modifier,    DEFVAR_LISP ("mac-function-modifier", &Vmac_function_modifier,
10989      doc: /* Modifier key assumed when the Mac function key is pressed.        doc: /* Modifier key assumed when the Mac function key is pressed.
10990  The value can be `alt', `ctrl', `hyper', or `super' for the respective  The value can be `alt', `ctrl', `hyper', or `super' for the respective
10991  modifier. Note that remapping the function key may lead to unexpected  modifier. Note that remapping the function key may lead to unexpected
10992  results for some keys on non-US/GB keyboards.  */);  results for some keys on non-US/GB keyboards.  */);

Legend:
Removed from v.1.142  
changed lines
  Added in v.1.143

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