Changeset 4005
- Timestamp:
- 2005年12月28日 01時30分53秒 (3 years ago)
- Files:
-
- trunk/lisp/ChangeLog.Meadow (modified) (1 diff)
- trunk/lisp/international/meadow.el (modified) (3 diffs)
- trunk/src/ChangeLog.Meadow (modified) (1 diff)
- trunk/src/mw32fns.c (modified) (4 diffs)
- trunk/src/mw32ime.c (modified) (10 diffs)
- trunk/src/mw32term.c (modified) (3 diffs)
- trunk/src/mw32term.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/ChangeLog.Meadow
r4002 r4005 1 2005-12-28 Kyotaro HORIGUCHI <horiguti@meadowy.org> 2 3 * international/meadow.el (mw32-input-method): Don't continue to 4 use FEP when length of the composition string is zero. Set 5 redisplay-dont-pause when calling sit-for. Preserve 6 buffer-modified-p. 7 1 8 2005-12-14 Hideyuki SHIRAI <shirai@meadowy.org> 2 9 trunk/lisp/international/meadow.el
r4002 r4005 525 525 (fep-get-mode)) 526 526 (list key) 527 (sit-for 0) 527 (let ((redisplay-dont-pause t)) 528 (sit-for 0)) 528 529 (fep-force-on) 529 530 (let* ((pos (point)) 531 (modified-p (buffer-modified-p)) 530 532 (ov (make-overlay (point) (1+ (point)))) 531 533 (ret (mw32-ime-input-method-function (char-to-string key))) 532 (result (append (car ret) nil))) 533 ;;; Continue to conversion if composition string cannot be 534 ;;; convert into single ascii character. 534 (result (append (car ret) nil)) 535 (redisplay-dont-pause t)) 536 ;; Continue to conversion if composition string cannot be 537 ;; convert into single ascii character. 535 538 (unwind-protect 536 539 (while (or … … 538 541 (and 539 542 (cadr ret) 543 (> (length (cadr ret)) 0) 540 544 (not (eq (string-to-char (japanese-hankaku (cadr ret))) 541 545 (car (cddr ret)))))) … … 555 559 (fep-force-off) 556 560 (delete-region pos (point)) 557 (delete-overlay ov)) 561 (delete-overlay ov) 562 (set-buffer-modified-p modified-p)) 558 563 result))) 559 564 trunk/src/ChangeLog.Meadow
r4004 r4005 1 2005-12-27 Kyotaro HORIGUCHI <horiguti@meadowy.org> 2 3 * mw32ime.c (fep_switch_event): New sync object. 4 (mw32-fep-switch-by-key-event): New lisp variable. 5 (mw32_ime_control_init): Initialize fep_switch_event. 6 (mw32_ime_input_method_function_unwind): Set parameter properly to 7 call Ffep_force_off(). 8 (mw32-ime-input-method-function): call 9 redisplay_preserve_echo_area () before set the position of fep 10 window. 11 (fep-force-on): Add new mode that changes FEP state by internally 12 generated windows key event instead of IMM API. This mode is 13 activated when mw32-fep-switch-by-key-event is not nil. 14 (fep-force-off): Ditto. 15 (mw32-fep-switch-by-key-event): New function to control behavior 16 of fep-force-on and fep-force-off. 17 18 * mw32term.c (SendInputProc): New function pointer for Win32 API. 19 (mw32_send_key_event): New function. 20 (mw32_initialize): Initialize SendInputProc. 21 22 * mw32term.h (struct INPUT): New struct for SendInput. 23 (struct MOUSEINPUT): Ditto. 24 (struct KEYBDINUT): Ditto. 25 (struct HARDWAREINPUT): Ditto. 26 (SENDINPUTPROC): New typedef. 27 28 * mw32fns.c (fep_switch_state): New extern. 29 (mw32_WndProc<WM_IME_NOTIFY>): Set event when FEP switched. 30 (mw32_WndProc<WM_IME_REPORT>): Set event when FEP switched. 31 1 32 2005-12-25 Masayuki FUJII <boochang@m4.kcn.ne.jp> 2 33 trunk/src/mw32fns.c
r4003 r4005 1922 1922 #ifdef IME_CONTROL 1923 1923 extern int IME_event_off_count; 1924 extern HANDLE fep_switch_event; 1924 1925 #endif 1925 1926 extern void mw32_scroll_bar_store_event (WPARAM wParam, LPARAM lParam); … … 2412 2413 else 2413 2414 IME_event_off_count--; 2415 SetEvent (fep_switch_event); 2414 2416 } 2415 2417 goto dflt; … … 2499 2501 else 2500 2502 IME_event_off_count--; 2503 SetEvent (fep_switch_event); 2501 2504 return 0; 2502 2505 } … … 2665 2668 last_bitmap = MW32_FRAME_CARET_BITMAP (f); 2666 2669 } 2667 2670 2668 2671 SetCaretPos (caret_xpos, caret_ypos); 2669 2672 trunk/src/mw32ime.c
r4003 r4005 155 155 static int waiting_on_main_thread = FALSE; 156 156 static HANDLE input_method_function_string = INVALID_HANDLE_VALUE; 157 HANDLE fep_switch_event = INVALID_HANDLE_VALUE; 157 158 158 159 Lisp_Object Vime_control; 159 160 Lisp_Object VIME_command_off_flag; 160 161 Lisp_Object Qim_info; 162 Lisp_Object Vmw32_fep_switch_by_key_event; 161 163 162 164 int IME_event_off_count; … … 586 588 Vime_control = Qt; 587 589 input_method_function_event = CreateEvent (NULL, FALSE, FALSE, NULL); 590 fep_switch_event = CreateEvent (NULL, FALSE, FALSE, NULL); 588 591 } 589 592 } … … 811 814 812 815 if (NILP (arg)) 813 Ffep_force_off ( );816 Ffep_force_off (Qnil); 814 817 815 818 return Qnil; … … 848 851 849 852 result = Qnil; 850 Ffep_force_on ();853 redisplay_preserve_echo_area (30); 851 854 852 855 /* If new ascii (expected..) key event comes after this function … … 871 874 (WPARAM)(SDATA (str)), 0); 872 875 } 876 Ffep_force_on (Qnil); 873 877 874 878 mw32_set_ime_conv_window (hwnd, … … 950 954 DEFUN ("fep-force-on", Ffep_force_on, Sfep_force_on, 0, 1, 0, 951 955 doc: /* Force status of IME open. 952 If EVENPT is not nil, this function also creates [kanji] key event. */) 956 If EVENPT is not nil, this function also creates [kanji] key event. 957 `mw32-fep-switch-by-key-event' controlls how activate IME. */) 953 958 (eventp) 954 959 Lisp_Object eventp; … … 966 971 hwnd = hwndConsole; 967 972 #endif 968 SendMessage (hwnd, WM_MULE_IMM_SET_STATUS, 1, 0); 973 #ifdef HAVE_NTGUI 974 if (Vmw32_fep_switch_by_key_event) 975 { 976 ResetEvent (fep_switch_event); 977 mw32_send_key_input (VK_KANJI, 0, 0); 978 mw32_send_key_input (VK_KANJI, 0, KEYEVENTF_KEYUP); 979 WaitForSingleObject (fep_switch_event, 500L); 980 } 981 else 982 #endif 983 SendMessage (hwnd, WM_MULE_IMM_SET_STATUS, 1, 0); 969 984 } 970 985 return Qnil; … … 974 989 DEFUN ("fep-force-off", Ffep_force_off, Sfep_force_off, 0, 1, 0, 975 990 doc: /* Force status of IME close. 976 If EVENTP is not nil, this function also creates [kanji] key event. */) 991 If EVENPT is not nil, this function also creates [kanji] key event. 992 `mw32-fep-switch-by-key-event' controlls how deactivate IME. */) 977 993 (eventp) 978 994 Lisp_Object eventp; … … 990 1006 hwnd = hwndConsole; 991 1007 #endif 992 SendMessage (hwnd, WM_MULE_IMM_SET_STATUS, 0, 0); 1008 #ifdef HAVE_NTGUI 1009 if (Vmw32_fep_switch_by_key_event) 1010 { 1011 ResetEvent (fep_switch_event); 1012 mw32_send_key_input (VK_KANJI, 0, 0); 1013 mw32_send_key_input (VK_KANJI, 0, KEYEVENTF_KEYUP); 1014 WaitForSingleObject (fep_switch_event, 500L); 1015 } 1016 else 1017 #endif 1018 SendMessage (hwnd, WM_MULE_IMM_SET_STATUS, 0, 0); 993 1019 } 994 1020 return Qnil; … … 1836 1862 1837 1863 DEFVAR_LISP ("ime-control", &Vime_control, doc: /* IME control flag */); 1864 DEFVAR_BOOL ("mw32-fep-switch-by-key-event", &Vmw32_fep_switch_by_key_event, 1865 doc: /* If non-nil, use windows key event instead of IMM API in `fep-force-on' 1866 and `fep-force-off'. */); 1867 Vmw32_fep_switch_by_key_event = FALSE; 1838 1868 1839 1869 defsubr (&Simm_get_conversion_status); trunk/src/mw32term.c
r4003 r4005 234 234 /* Layered Window */ 235 235 SETLAYEREDWINDOWATTRPROC SetLayeredWindowAttributes = NULL; 236 237 SENDINPUTPROC SendInputProc = NULL; 236 238 237 239 /* Incremented by XTread_socket whenever it really tries to read … … 3615 3617 } 3616 3618 3619 void 3620 mw32_send_key_input (int vkeycode, int scancode, int flags) 3621 { 3622 INPUT in; 3623 3624 if (SendInputProc == NULL) return; 3625 3626 in.type = INPUT_KEYBOARD; 3627 in.ki.wVk = vkeycode; 3628 in.ki.wScan = scancode; 3629 in.ki.dwFlags = flags; 3630 in.ki.time = GetTickCount (); 3631 in.ki.dwExtraInfo = 0; 3632 SendInputProc (1, &in, sizeof (in)); 3633 } 3634 3617 3635 DEFUN ("mw32-get-window-position", Fmw32_get_window_position, 3618 3636 Smw32_get_window_position, 0, 2, 0, … … 6291 6309 SetLayeredWindowAttributes = (SETLAYEREDWINDOWATTRPROC) 6292 6310 GetProcAddress (user32_lib, "SetLayeredWindowAttributes"); 6311 6312 SendInputProc = (SENDINPUTPROC) 6313 GetProcAddress (user32_lib, "SendInput"); 6293 6314 } 6294 6315 } trunk/src/mw32term.h
r3998 r4005 1292 1292 #endif 1293 1293 1294 typedef struct{ 1295 LONG dx; 1296 LONG dy; 1297 DWORD mouseData; 1298 DWORD dwFlags; 1299 DWORD time; 1300 ULONG_PTR dwExtraInfo; 1301 } MOUSEINPUT; 1302 1303 typedef struct { 1304 WORD wVk; 1305 WORD wScan; 1306 DWORD dwFlags; 1307 DWORD time; 1308 ULONG_PTR dwExtraInfo; 1309 } KEYBDINPUT; 1310 1311 typedef struct { 1312 DWORD uMsg; 1313 WORD wParamL; 1314 WORD wParamH; 1315 } HARDWAREINPUT; 1316 1317 #define INPUT_MOUSE 0 1318 #define INPUT_KEYBOARD 1 1319 #define INPUT_HARDWARE 2 1320 1321 typedef struct { 1322 DWORD type; 1323 union 1324 { 1325 MOUSEINPUT mi; 1326 KEYBDINPUT ki; 1327 HARDWAREINPUT hi; 1328 }; 1329 } INPUT; 1330 1331 typedef UINT (WINAPI *SENDINPUTPROC)(UINT, INPUT*, int); 1332 1294 1333 #endif /* not _MW32TERM_H_ */
