diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-08-29 12:31:41 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-08-29 12:31:41 (GMT) |
commit | 3f5962a079fc838a3d5df0e3f021f31e43b05413 (patch) | |
tree | cc57fe4b69c24d163afdafa622ef932fa87a475f /win/tkWinX.c | |
parent | cadfb618609ec0178773f5a484a08112df61de9d (diff) | |
parent | bfee1152c7fdbd81b9341af13ece52aa95a4ce1e (diff) | |
download | tk-3f5962a079fc838a3d5df0e3f021f31e43b05413.zip tk-3f5962a079fc838a3d5df0e3f021f31e43b05413.tar.gz tk-3f5962a079fc838a3d5df0e3f021f31e43b05413.tar.bz2 |
rebase to core-8-6-branch.
should now work with TCL_UTF_MAX=4 and TCL_UTF_MAX=6 (not yet with TCL_UTF_MAX=3)
Diffstat (limited to 'win/tkWinX.c')
-rw-r--r-- | win/tkWinX.c | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/win/tkWinX.c b/win/tkWinX.c index 96a8720..12739ea 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -1209,9 +1209,8 @@ GenerateXEvent( if ((int)wParam & 0xff00) { int i, ch1 = wParam & 0xffff; char buffer[TCL_UTF_MAX+1]; -#if TCL_UTF_MAX >= 4 - MSG msg; +#if TCL_UTF_MAX >= 4 if ((((int)wParam & 0xfc00) == 0xd800) && (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) != 0) && (msg.message == WM_CHAR)) { @@ -1220,20 +1219,13 @@ GenerateXEvent( GetMessage(&msg, NULL, 0, 0); ch2 = wParam & 0xffff; -#if TCL_UTF_MAX == 4 - event.xkey.nbytes = Tcl_UniCharToUtf(ch1, buffer); - event.xkey.nbytes += Tcl_UniCharToUtf(ch2, buffer); -#else ch1 = ((ch1 & 0x3ff) << 10) | (ch2 & 0x3ff); ch1 += 0x10000; event.xkey.nbytes = Tcl_UniCharToUtf(ch1, buffer); -#endif } else #endif - { event.xkey.nbytes = Tcl_UniCharToUtf(ch1, buffer); - } - for (i=0; i<event.xkey.nbytes && i<TCL_UTF_MAX; ++i) { + for (i=0; i<event.xkey.nbytes && i<XMaxTransChars; ++i) { event.xkey.trans_chars[i] = buffer[i]; } event.xany.send_event = -3; @@ -1259,28 +1251,11 @@ GenerateXEvent( case WM_UNICHAR: { char buffer[TCL_UTF_MAX+1]; int i; - event.type = KeyPress; event.xany.send_event = -3; event.xkey.keycode = wParam; -#if TCL_UTF_MAX < 4 - event.xkey.nbytes = Tcl_UniCharToUtf(((int)wParam > 0xffff) ? - 0xfffd : (int)wParam, buffer); -#else -#if TCL_UTF_MAX == 4 - if ((int)wParam > 0xffff) { - Tcl_UniChar uch; - - uch = (((int)wParam - 0x10000) >> 10) & 0x3ff; - event.xkey.nbytes = Tcl_UniCharToUtf(uch | 0xd800, buffer); - uch = ((int)wParam - 0x10000) & 0x3ff; - event.xkey.nbytes += Tcl_UniCharToUtf(uch | 0xdc00, - buffer + event.xkey.nbytes); - } else -#endif event.xkey.nbytes = Tcl_UniCharToUtf((int)wParam, buffer); -#endif - for (i=0; i<event.xkey.nbytes && i<TCL_UTF_MAX; ++i) { + for (i=0; i<event.xkey.nbytes && i<XMaxTransChars; ++i) { event.xkey.trans_chars[i] = buffer[i]; } Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL); @@ -1669,6 +1644,30 @@ HandleIMEComposition( /* *---------------------------------------------------------------------- * + * Tk_FreeXId -- + * + * This interface is not needed under Windows. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +Tk_FreeXId( + Display *display, + XID xid) +{ + /* Do nothing */ +} + +/* + *---------------------------------------------------------------------- + * * TkWinResendEvent -- * * This function converts an X event into a Windows event and invokes the |