home *** CD-ROM | disk | FTP | other *** search
- To: vim-dev@vim.org
- Subject: Patch 6.1.016 (extra)
- Fcc: outbox
- From: Bram Moolenaar <Bram@moolenaar.net>
- MIME-Version: 1.0
- Content-Type: text/plain; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
- ------------
-
- Patch 6.1.016 (extra)
- Problem: Win32: Outputting Hebrew or Arabic text might have a problem with
- reversing.
- Solution: Replace the RevOut() function with ETO_IGNORELANGUAGE. (Ron Aaron)
- Files: src/gui_w32.c
-
-
- *** ../vim61.015/src/gui_w32.c Mon Mar 18 21:40:45 2002
- --- src/gui_w32.c Wed Apr 10 21:33:23 2002
- ***************
- *** 249,254 ****
- --- 249,258 ----
- # define pImmGetConversionStatus ImmGetConversionStatus
- #endif
-
- + #ifndef ETO_IGNORELANGUAGE
- + # define ETO_IGNORELANGUAGE 0x1000
- + #endif
- +
- /*
- * Return TRUE when running under Windows NT 3.x or Win32s, both of which have
- * less fancy GUI APIs.
- ***************
- *** 1607,1663 ****
- }
- #endif
-
- -
- - #ifdef FEAT_RIGHTLEFT
- - /*
- - * What is this for? In the case where you are using Win98 or Win2K or later,
- - * and you are using a Hebrew font (or Arabic!), Windows does you a favor and
- - * reverses the string sent to the TextOut... family. This sucks, because we
- - * go to a lot of effort to do the right thing, and there doesn't seem to be a
- - * way to tell Windblows not to do this!
- - *
- - * The short of it is that this 'RevOut' only gets called if you are running
- - * one of the new, "improved" MS OSes, and only if you are running in
- - * 'rightleft' mode. It makes display take *slightly* longer, but not
- - * noticeably so.
- - */
- - static void
- - RevOut( HDC s_hdc,
- - int col,
- - int row,
- - UINT foptions,
- - CONST RECT *pcliprect,
- - LPCTSTR text,
- - UINT len,
- - CONST INT *padding)
- - {
- - int ix;
- - static int special = -1;
- -
- - if (special == -1)
- - {
- - /* Check windows version: special treatment is needed if it is NT 5 or
- - * Win98 or higher. */
- - if ((os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
- - && os_version.dwMajorVersion >= 5)
- - || (os_version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
- - && (os_version.dwMajorVersion > 4
- - || (os_version.dwMajorVersion == 4
- - && os_version.dwMinorVersion > 0))))
- - special = 1;
- - else
- - special = 0;
- - }
- -
- - if (special)
- - for (ix = 0; ix < (int)len; ++ix)
- - ExtTextOut(s_hdc, col + TEXT_X(ix), row, foptions,
- - pcliprect, text + ix, 1, padding);
- - else
- - ExtTextOut(s_hdc, col, row, foptions, pcliprect, text, len, padding);
- - }
- - #endif
- -
- void
- gui_mch_draw_string(
- int row,
- --- 1611,1616 ----
- ***************
- *** 1843,1849 ****
- ++clen;
- }
- ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
- ! foptions, pcliprect, unicodebuf, clen, NULL);
- len = cells; /* used for underlining */
- }
- else if (is_funky_dbcs)
- --- 1796,1803 ----
- ++clen;
- }
- ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
- ! ETO_IGNORELANGUAGE | foptions, pcliprect,
- ! unicodebuf, clen, NULL);
- len = cells; /* used for underlining */
- }
- else if (is_funky_dbcs)
- ***************
- *** 1857,1877 ****
- (char *)text, len,
- (LPWSTR)unicodebuf, unibuflen)))
- ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
- ! foptions, pcliprect, unicodebuf, len, NULL);
- }
- }
- else
- #endif
- {
- ! #ifdef FEAT_RIGHTLEFT
- ! /* ron: fixed Hebrew on Win98/Win2000 */
- ! if (curwin->w_p_rl)
- ! RevOut(s_hdc, TEXT_X(col), TEXT_Y(row),
- ! foptions, pcliprect, (char *)text, len, padding);
- ! else
- ! #endif
- ! ExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row),
- ! foptions, pcliprect, (char *)text, len, padding);
- }
- }
-
- --- 1811,1826 ----
- (char *)text, len,
- (LPWSTR)unicodebuf, unibuflen)))
- ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
- ! ETO_IGNORELANGUAGE | foptions, pcliprect,
- ! unicodebuf, len, NULL);
- }
- }
- else
- #endif
- {
- ! ExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row),
- ! ETO_IGNORELANGUAGE | foptions, pcliprect,
- ! (char *)text, len, padding);
- }
- }
-
- *** ../vim61.015/src/version.c Wed Apr 10 10:36:02 2002
- --- src/version.c Wed Apr 10 21:33:31 2002
- ***************
- *** 608,609 ****
- --- 608,611 ----
- { /* Add new patch number below this line */
- + /**/
- + 16,
- /**/
-
- --
- hundred-and-one symptoms of being an internet addict:
- 137. You decide to stay in college for an additional year or two,
- just so you can have the free Internet access.
-
- /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\
- /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
- \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
- \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
-