From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eugen Anghel Newsgroups: gmane.emacs.devel Subject: Re: Switch the Windows port to using Unicode keyboard input Date: Sun, 4 Oct 2009 20:41:53 +0300 Message-ID: References: <83y6nrnthg.fsf@gnu.org> <4AC8B391.4020906@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=00032555bc9a6f4b0904751f8489 X-Trace: ger.gmane.org 1254679166 21928 80.91.229.12 (4 Oct 2009 17:59:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 Oct 2009 17:59:26 +0000 (UTC) Cc: emacs-devel@gnu.org To: Jason Rumney , Lennart Borgman , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 04 19:59:19 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MuV7R-0002NF-5M for ged-emacs-devel@m.gmane.org; Sun, 04 Oct 2009 19:45:14 +0200 Original-Received: from localhost ([127.0.0.1]:47694 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MuV7P-0000wU-QK for ged-emacs-devel@m.gmane.org; Sun, 04 Oct 2009 13:43:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MuV7K-0000vm-PD for emacs-devel@gnu.org; Sun, 04 Oct 2009 13:43:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MuV7F-0000u2-9y for emacs-devel@gnu.org; Sun, 04 Oct 2009 13:43:30 -0400 Original-Received: from [199.232.76.173] (port=47083 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MuV7F-0000tz-73 for emacs-devel@gnu.org; Sun, 04 Oct 2009 13:43:25 -0400 Original-Received: from mail-bw0-f220.google.com ([209.85.218.220]:50327) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MuV6G-00029R-E2; Sun, 04 Oct 2009 13:42:26 -0400 Original-Received: by bwz20 with SMTP id 20so2096359bwz.42 for ; Sun, 04 Oct 2009 10:42:14 -0700 (PDT) Original-Received: by 10.204.24.15 with SMTP id t15mr3221147bkb.113.1254678133164; Sun, 04 Oct 2009 10:42:13 -0700 (PDT) In-Reply-To: <4AC8B391.4020906@gnu.org> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115893 Archived-At: --00032555bc9a6f4b0904751f8489 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2009/10/4 Jason Rumney : > Lennart Borgman wrote: >> >> Isn't it possible to keep the old code and check whether to use it or >> not in the binary? >> > > It may be, but changing the window class in a backwards compatible way is > not as straightforward as the other function calls where we have done tha= t. > =C2=A0I suspect that a better approach would be to fix all the locations = where > system calls are used to cope with both _UNICODE and non _UNICODE builds, > and use the non-specific system functions throughout. > Is having two separate binaries, one for 9x/Me and one for XP/Vista an option? because I agree, that would simplify some things. As for loading the functions at runtime, I've attached a patch that should work on both 9x and XP/Vista. While kind of ugly, it's definitely a possibility. --00032555bc9a6f4b0904751f8489 Content-Type: application/octet-stream; name="patch.patch" Content-Disposition: attachment; filename="patch.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g0e2va140 ZGlmZiAtLWdpdCBhL3NyYy9jb2RpbmcuYyBiL3NyYy9jb2RpbmcuYwppbmRleCA0MDUyODRmLi41 N2YzMDYzIDEwMDY0NAotLS0gYS9zcmMvY29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V9TWVNURU0gKG5hbWUpOworICAgICAgICAgIFNldFdpbmRv d1RleHRBIChGUkFNRV9XMzJfV0lORE9XIChmKSwgU0RBVEEgKG5hbWUpKTsKKyAgICAgICAgfQog ICAgICAgVU5CTE9DS19JTlBVVDsKICAgICB9CiB9CkBAIC0xOTIzLDExICsxOTUzLDIzIEBAIHhf c2V0X3RpdGxlIChmLCBuYW1lLCBvbGRfbmFtZSkKIAogICBpZiAoRlJBTUVfVzMyX1dJTkRPVyAo ZikpCiAgICAgewotICAgICAgaWYgKFNUUklOR19NVUxUSUJZVEUgKG5hbWUpKQotCW5hbWUgPSBF TkNPREVfU1lTVEVNIChuYW1lKTsKKyAgICAgIC8qIGVuc3VyZSBuYW1lIGlzIG51bGwtdGVybWlu YXRlZCAqLworICAgICAgaWYgKFNSRUYgKG5hbWUsIFNCWVRFUyAobmFtZSkgLSAxKSkKKyAgICAg ICAgbmFtZSA9IG1ha2Vfc3RyaW5nIChTREFUQSAobmFtZSksIFNCWVRFUyAobmFtZSkgKyAxKTsK IAogICAgICAgQkxPQ0tfSU5QVVQ7Ci0gICAgICBTZXRXaW5kb3dUZXh0IChGUkFNRV9XMzJfV0lO RE9XIChmKSwgU0RBVEEgKG5hbWUpKTsKKyAgICAgIGlmIChzZXRfd2luZG93X3RleHRfdW5pY29k ZV9mbikKKyAgICAgICAgeworICAgICAgICAgIG5hbWUgPSBjb2RlX2NvbnZlcnRfc3RyaW5nX25v cmVjb3JkKG5hbWUsIFF1dGZfMTZsZSwgMSk7CisgICAgICAgICAgc2V0X3dpbmRvd190ZXh0X3Vu aWNvZGVfZm4gKEZSQU1FX1czMl9XSU5ET1cgKGYpLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAoTFBDV1NUUikgU0RBVEEgKG5hbWUpKTsKKyAgICAgICAgfQorICAgICAg ZWxzZQorICAgICAgICB7CisgICAgICAgICAgaWYgKFNUUklOR19NVUxUSUJZVEUgKG5hbWUpKQor ICAgICAgICAgIC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IFJFU19UWVBFX05VTUJFUik7CiAgICAgfQogCi0gIEZS QU1FX1czMl9XSU5ET1cgKGYpID0gaHduZAotICAgID0gQ3JlYXRlV2luZG93IChFTUFDU19DTEFT UywKLQkJICAgIGYtPm5hbWVidWYsCi0JCSAgICBmLT5vdXRwdXRfZGF0YS53MzItPmR3U3R5bGUg fCBXU19DTElQQ0hJTERSRU4sCi0JCSAgICBFUSAobGVmdCwgUXVuYm91bmQpID8gQ1dfVVNFREVG QVVMVCA6IFhJTlQgKGxlZnQpLAotCQkgICAgRVEgKHRvcCwgUXVuYm91bmQpID8gQ1dfVVNFREVG QVVMVCA6IFhJTlQgKHRvcCksCi0JCSAgICByZWN0LnJpZ2h0IC0gcmVjdC5sZWZ0LAotCQkgICAg cmVjdC5ib3R0b20gLSByZWN0LnRvcCwKLQkJICAgIE5VTEwsCi0JCSAgICBOVUxMLAotCQkgICAg aGluc3QsCi0JCSAgICBOVUxMKTsKKyAgaWYgKEhBU19VTklDT0RFX1dJTkRPV1MpCisgICAgewor ICAgICAgY2xhc3NTdHIgPSBjb2RlX2NvbnZlcnRfc3RyaW5nX25vcmVjb3JkKGNsYXNzU3RyLCBR dXRmXzE2bGUsIDEpOworICAgICAgbmFtZVN0ciA9IGNvZGVfY29udmVydF9zdHJpbmdfbm9yZWNv cmQobmFtZVN0ciwgUXV0Zl8xNmxlLCAxKTsKKyAgICAgIEZSQU1FX1czMl9XSU5ET1cgKGYpID0g aHduZAorICAgICAgICA9IGNyZWF0ZV93aW5kb3dfZXhfdW5pY29kZV9mbiAoCisgICAgICAgICAg MCwKKyAgICAgICAgICAoTFBXU1RSKSBTREFUQSAoY2xhc3NTdHIpLAorICAgICAgICAgIChMUFdT VFIpIFNEQVRBIChuYW1lU3RyKSwKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmR3U3R5 bGUgfCBXU19DTElQQ0hJTERSRU4sCisgICAgICAgICAgRVEgKGxlZnQsIFF1bmJvdW5kKSA/IENX X1VTRURFRkFVTFQgOiBYSU5UIChsZWZ0KSwKKyAgICAgICAgICBFUSAodG9wLCBRdW5ib3VuZCkg PyBDV19VU0VERUZBVUxUIDogWElOVCAodG9wKSwKKyAgICAgICAgICByZWN0LnJpZ2h0IC0gcmVj dC5sZWZ0LAorICAgICAgICAgIHJlY3QuYm90dG9tIC0gcmVjdC50b3AsCisgICAgICAgICAgTlVM TCwKKyAgICAgICAgICBOVUxMLAorICAgICAgICAgIGhpbnN0LAorICAgICAgICAgIE5VTEwpOwor ICAgIH0KKyAgZWxzZQorICAgIHsKKyAgICAgIEZSQU1FX1czMl9XSU5ET1cgKGYpID0gaHduZAor ICAgICAgICA9IENyZWF0ZVdpbmRvd0EgKFNEQVRBIChjbGFzc1N0ciksCisgICAgICAgICAgICAg ICAgICAgICAgICBTREFUQSAobmFtZVN0ciksCisgICAgICAgICAgICAgICAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmR3U3R5bGUgfCBXU19DTElQQ0hJTERSRU4sCisgICAgICAgICAgICAg ICAgICAgICAgICBFUSAobGVmdCwgUXVuYm91bmQpID8gQ1dfVVNFREVGQVVMVCA6IFhJTlQgKGxl ZnQpLAorICAgICAgICAgICAgICAgICAgICAgICAgRVEgKHRvcCwgUXVuYm91bmQpID8gQ1dfVVNF REVGQVVMVCA6IFhJTlQgKHRvcCksCisgICAgICAgICAgICAgICAgICAgICAgICByZWN0LnJpZ2h0 IC0gcmVjdC5sZWZ0LAorICAgICAgICAgICAgICAgICAgICAgICAgcmVjdC5ib3R0b20gLSByZWN0 LnRvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCisgICAgICAgICAgICAgICAgICAg ICAgICBOVUxMLAorICAgICAgICAgICAgICAgICAgICAgICAgaGluc3QsCisgICAgICAgICAgICAg ICAgICAgICAgICBOVUxMKTsKKyAgICB9CiAKICAgaWYgKGh3bmQpCiAgICAgewpAQCAtMjQ0MSw3 ICsyNTI4LDcgQEAgdzMyX21zZ19wdW1wICh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y93MzJ0ZXJtLmMKaW5kZXggYjc2NDJiNC4uNWYyOGIyYiAx MDA2NDQKLS0tIGEvc3JjL3czMnRlcm0uYworKysgYi9zcmMvdzMydGVybS5jCkBAIC00MjI5LDEw ICs0MjI5LDE0IEBAIHczMl9yZWFkX3NvY2tldCAoc2QsIGV4cGVjdGVkLCBob2xkX3F1aXQpCiAJ ICAgICAgWFNFVEZSQU1FIChpbmV2LmZyYW1lX29yX3dpbmRvdywgZik7CiAJICAgICAgaW5ldi50 aW1lc3RhbXAgPSBtc2cubXNnLnRpbWU7CiAKKwogICAgICAgICAgICAgICBpZiAobXNnLm1zZy5t ZXNzYWdlID09IFdNX1VOSUNIQVIpCiAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAg ICAgaW5ldi5jb2RlID0gbXNnLm1zZy53UGFyYW07CiAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICBlbHNlIGlmIChJc1dpbmRvd1VuaWNvZGUgKG1zZy5tc2cuaHduZCkpIHsKKyAgICAg ICAgICAgICAgICBpbmV2LmNvZGUgPSBtc2cubXNnLndQYXJhbTsKKyAgICAgICAgICAgICAgfQog ICAgICAgICAgICAgICBlbHNlIGlmIChtc2cubXNnLndQYXJhbSA8IDI1NikKICAgICAgICAgICAg ICAgICB7CiAgICAgICAgICAgICAgICAgICB3Y2hhcl90IGNvZGU7CkBAIC00MjQ1LDcgKzQyNDks NyBAQCB3MzJfcmVhZF9zb2NrZXQgKHNkLCBleHBlY3RlZCwgaG9sZF9xdWl0KQogICAgICAgICAg ICAgICAgICAgICAgIGRiY3NbMF0gPSBkYmNzX2xlYWQ7CiAgICAgICAgICAgICAgICAgICAgICAg ZGJjc19sZWFkID0gMDsKICAgICAgICAgICAgICAgICAgICAgICBpZiAoIU11bHRpQnl0ZVRvV2lk ZUNoYXIgKGtleWJvYXJkX2NvZGVwYWdlLCAwLAotCQkJCQkJZGJjcywgMiwgJmNvZGUsIDEpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYmNzLCAyLCAm Y29kZSwgMSkpCiAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAg ICAgICAgIC8qIEdhcmJhZ2UgKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgRGViUHJpbnQg KCgiSW52YWxpZCBEQkNTIHNlcXVlbmNlOiAlZCAlZFxuIiwKQEAgLTQyNTUsNyArNDI1OSw3IEBA IHczMl9yZWFkX3NvY2tldCAoc2QsIGV4cGVjdGVkLCBob2xkX3F1aXQpCiAgICAgICAgICAgICAg ICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKElzREJDU0xlYWRCeXRlRXggKGtleWJvYXJkX2NvZGVwYWdlLAotCQkJCQkgICAgIChC WVRFKSBtc2cubXNnLndQYXJhbSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChCWVRFKSBtc2cubXNnLndQYXJhbSkpCiAgICAgICAgICAgICAgICAgICAgIHsK ICAgICAgICAgICAgICAgICAgICAgICBkYmNzX2xlYWQgPSAoY2hhcikgbXNnLm1zZy53UGFyYW07 CiAgICAgICAgICAgICAgICAgICAgICAgaW5ldi5raW5kID0gTk9fRVZFTlQ7CkBAIC00MjY0LDcg KzQyNjgsNyBAQCB3MzJfcmVhZF9zb2NrZXQgKHNkLCBleHBlY3RlZCwgaG9sZF9xdWl0KQogICAg ICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAg ICAgICAgICAgaWYgKCFNdWx0aUJ5dGVUb1dpZGVDaGFyIChrZXlib2FyZF9jb2RlcGFnZSwgMCwK LQkJCQkJCSZkYmNzWzFdLCAxLCAmY29kZSwgMSkpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICZkYmNzWzFdLCAxLCAmY29kZSwgMSkpCiAgICAgICAgICAg ICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdoYXQgdG8gZG8g d2l0aCBnYXJiYWdlPyAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICBEZWJQcmludCAoKCJJ bnZhbGlkIGNoYXJhY3RlcjogJWRcbiIsIGRiY3NbMV0pKTsK --00032555bc9a6f4b0904751f8489--