summaryrefslogtreecommitdiffstats
path: root/win/tkWinX.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-08-29 12:31:41 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-08-29 12:31:41 (GMT)
commit8a165192c2d08763b9540f35e9f2cb4f521b5f5f (patch)
treecc57fe4b69c24d163afdafa622ef932fa87a475f /win/tkWinX.c
parent9900ef4bf9c3880f8d01968600aa70ab2897b8a6 (diff)
parentd1ffebb971d9a844511bf96c8c734b96c0b75424 (diff)
downloadtk-8a165192c2d08763b9540f35e9f2cb4f521b5f5f.zip
tk-8a165192c2d08763b9540f35e9f2cb4f521b5f5f.tar.gz
tk-8a165192c2d08763b9540f35e9f2cb4f521b5f5f.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.c55
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