diff options
| author | YAMAMOTO Mitsuharu | 2007-02-21 08:28:01 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2007-02-21 08:28:01 +0000 |
| commit | d8506697cc4ed039cc2d6cb8a397e3ca58d5b648 (patch) | |
| tree | 5b565b7329e1138914fd8ca820b0a626c66d96e8 | |
| parent | 474d2d60a3236413faa33fa2d2695f82f5392b25 (diff) | |
| download | emacs-d8506697cc4ed039cc2d6cb8a397e3ca58d5b648.tar.gz emacs-d8506697cc4ed039cc2d6cb8a397e3ca58d5b648.zip | |
(WINDOW_RESOURCE, TERM_WINDOW_RESOURCE): Remove macros.
[USE_MAC_TSM] (mac_handle_text_input_event): Remove unused variable
`mapped_modifiers'.
(XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1020]: Use Keyboard
Layout Services routines to get current Unicode keyboard layout.
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/macterm.c | 22 |
2 files changed, 24 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ea85360e144..79cf4b256a7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2007-02-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * macterm.c (WINDOW_RESOURCE, TERM_WINDOW_RESOURCE): Remove macros. | ||
| 4 | [USE_MAC_TSM] (mac_handle_text_input_event): Remove unused variable | ||
| 5 | `mapped_modifiers'. | ||
| 6 | (XTread_socket) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1020]: Use Keyboard | ||
| 7 | Layout Services routines to get current Unicode keyboard layout. | ||
| 8 | |||
| 1 | 2007-02-20 Chong Yidong <cyd@stupidchicken.com> | 9 | 2007-02-20 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 10 | ||
| 3 | * frame.c (x_set_screen_gamma): Apply gamma value to the frame's | 11 | * frame.c (x_set_screen_gamma): Apply gamma value to the frame's |
diff --git a/src/macterm.c b/src/macterm.c index 289972d3a48..b5dc0e6170e 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -8791,9 +8791,6 @@ mac_set_font_info_for_selection (f, face_id, c) | |||
| 8791 | #define M_APPLE 234 | 8791 | #define M_APPLE 234 |
| 8792 | #define I_ABOUT 1 | 8792 | #define I_ABOUT 1 |
| 8793 | 8793 | ||
| 8794 | #define WINDOW_RESOURCE 128 | ||
| 8795 | #define TERM_WINDOW_RESOURCE 129 | ||
| 8796 | |||
| 8797 | #define DEFAULT_NUM_COLS 80 | 8794 | #define DEFAULT_NUM_COLS 80 |
| 8798 | 8795 | ||
| 8799 | #define MIN_DOC_SIZE 64 | 8796 | #define MIN_DOC_SIZE 64 |
| @@ -10120,7 +10117,7 @@ mac_handle_text_input_event (next_handler, event, data) | |||
| 10120 | case kEventTextInputUnicodeForKeyEvent: | 10117 | case kEventTextInputUnicodeForKeyEvent: |
| 10121 | { | 10118 | { |
| 10122 | EventRef kbd_event; | 10119 | EventRef kbd_event; |
| 10123 | UInt32 actual_size, modifiers, mapped_modifiers; | 10120 | UInt32 actual_size, modifiers; |
| 10124 | 10121 | ||
| 10125 | err = GetEventParameter (event, kEventParamTextInputSendKeyboardEvent, | 10122 | err = GetEventParameter (event, kEventParamTextInputSendKeyboardEvent, |
| 10126 | typeEventRef, NULL, sizeof (EventRef), NULL, | 10123 | typeEventRef, NULL, sizeof (EventRef), NULL, |
| @@ -11165,6 +11162,16 @@ XTread_socket (sd, expected, hold_quit) | |||
| 11165 | /* translate the keycode back to determine the | 11162 | /* translate the keycode back to determine the |
| 11166 | original key */ | 11163 | original key */ |
| 11167 | #ifdef MAC_OSX | 11164 | #ifdef MAC_OSX |
| 11165 | UCKeyboardLayout *uchr_ptr = NULL; | ||
| 11166 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 | ||
| 11167 | OSStatus err; | ||
| 11168 | KeyboardLayoutRef layout; | ||
| 11169 | |||
| 11170 | err = KLGetCurrentKeyboardLayout (&layout); | ||
| 11171 | if (err == noErr) | ||
| 11172 | KLGetKeyboardLayoutProperty (layout, kKLuchrData, | ||
| 11173 | (const void **) &uchr_ptr); | ||
| 11174 | #else | ||
| 11168 | static SInt16 last_key_layout_id = 0; | 11175 | static SInt16 last_key_layout_id = 0; |
| 11169 | static Handle uchr_handle = (Handle)-1; | 11176 | static Handle uchr_handle = (Handle)-1; |
| 11170 | SInt16 current_key_layout_id = | 11177 | SInt16 current_key_layout_id = |
| @@ -11176,8 +11183,11 @@ XTread_socket (sd, expected, hold_quit) | |||
| 11176 | uchr_handle = GetResource ('uchr', current_key_layout_id); | 11183 | uchr_handle = GetResource ('uchr', current_key_layout_id); |
| 11177 | last_key_layout_id = current_key_layout_id; | 11184 | last_key_layout_id = current_key_layout_id; |
| 11178 | } | 11185 | } |
| 11179 | |||
| 11180 | if (uchr_handle) | 11186 | if (uchr_handle) |
| 11187 | uchr_ptr = (UCKeyboardLayout *)*uchr_handle; | ||
| 11188 | #endif | ||
| 11189 | |||
| 11190 | if (uchr_ptr) | ||
| 11181 | { | 11191 | { |
| 11182 | OSStatus status; | 11192 | OSStatus status; |
| 11183 | UInt16 key_action = er.what - keyDown; | 11193 | UInt16 key_action = er.what - keyDown; |
| @@ -11188,7 +11198,7 @@ XTread_socket (sd, expected, hold_quit) | |||
| 11188 | UniChar code; | 11198 | UniChar code; |
| 11189 | UniCharCount actual_length; | 11199 | UniCharCount actual_length; |
| 11190 | 11200 | ||
| 11191 | status = UCKeyTranslate ((UCKeyboardLayout *)*uchr_handle, | 11201 | status = UCKeyTranslate (uchr_ptr, |
| 11192 | keycode, key_action, | 11202 | keycode, key_action, |
| 11193 | modifier_key_state, | 11203 | modifier_key_state, |
| 11194 | keyboard_type, | 11204 | keyboard_type, |