home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.1.016 < prev    next >
Encoding:
Internet Message Format  |  2002-04-09  |  4.7 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.016 (extra)
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.1.016 (extra)
  11. Problem:    Win32: Outputting Hebrew or Arabic text might have a problem with
  12.         reversing.
  13. Solution:   Replace the RevOut() function with ETO_IGNORELANGUAGE. (Ron Aaron)
  14. Files:        src/gui_w32.c
  15.  
  16.  
  17. *** ../vim61.015/src/gui_w32.c    Mon Mar 18 21:40:45 2002
  18. --- src/gui_w32.c    Wed Apr 10 21:33:23 2002
  19. ***************
  20. *** 249,254 ****
  21. --- 249,258 ----
  22.   # define pImmGetConversionStatus  ImmGetConversionStatus
  23.   #endif
  24.   
  25. + #ifndef ETO_IGNORELANGUAGE
  26. + # define ETO_IGNORELANGUAGE  0x1000
  27. + #endif
  28.   /*
  29.    * Return TRUE when running under Windows NT 3.x or Win32s, both of which have
  30.    * less fancy GUI APIs.
  31. ***************
  32. *** 1607,1663 ****
  33.   }
  34.   #endif
  35.   
  36. - #ifdef FEAT_RIGHTLEFT
  37. - /*
  38. -  * What is this for?  In the case where you are using Win98 or Win2K or later,
  39. -  * and you are using a Hebrew font (or Arabic!), Windows does you a favor and
  40. -  * reverses the string sent to the TextOut... family.  This sucks, because we
  41. -  * go to a lot of effort to do the right thing, and there doesn't seem to be a
  42. -  * way to tell Windblows not to do this!
  43. -  *
  44. -  * The short of it is that this 'RevOut' only gets called if you are running
  45. -  * one of the new, "improved" MS OSes, and only if you are running in
  46. -  * 'rightleft' mode.  It makes display take *slightly* longer, but not
  47. -  * noticeably so.
  48. -  */
  49. -     static void
  50. - RevOut( HDC s_hdc,
  51. -     int col,
  52. -     int row,
  53. -     UINT foptions,
  54. -     CONST RECT *pcliprect,
  55. -     LPCTSTR text,
  56. -     UINT len,
  57. -     CONST INT *padding)
  58. - {
  59. -     int        ix;
  60. -     static int    special = -1;
  61. -     if (special == -1)
  62. -     {
  63. -     /* Check windows version: special treatment is needed if it is NT 5 or
  64. -      * Win98 or higher. */
  65. -     if  ((os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
  66. -             && os_version.dwMajorVersion >= 5)
  67. -         || (os_version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
  68. -             && (os_version.dwMajorVersion > 4
  69. -             || (os_version.dwMajorVersion == 4
  70. -                 && os_version.dwMinorVersion > 0))))
  71. -         special = 1;
  72. -     else
  73. -         special = 0;
  74. -     }
  75. -     if (special)
  76. -     for (ix = 0; ix < (int)len; ++ix)
  77. -         ExtTextOut(s_hdc, col + TEXT_X(ix), row, foptions,
  78. -                         pcliprect, text + ix, 1, padding);
  79. -     else
  80. -     ExtTextOut(s_hdc, col, row, foptions, pcliprect, text, len, padding);
  81. - }
  82. - #endif
  83.       void
  84.   gui_mch_draw_string(
  85.       int        row,
  86. --- 1611,1616 ----
  87. ***************
  88. *** 1843,1849 ****
  89.           ++clen;
  90.           }
  91.           ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
  92. !                  foptions, pcliprect, unicodebuf, clen, NULL);
  93.           len = cells;    /* used for underlining */
  94.       }
  95.       else if (is_funky_dbcs)
  96. --- 1796,1803 ----
  97.           ++clen;
  98.           }
  99.           ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
  100. !             ETO_IGNORELANGUAGE | foptions, pcliprect,
  101. !                               unicodebuf, clen, NULL);
  102.           len = cells;    /* used for underlining */
  103.       }
  104.       else if (is_funky_dbcs)
  105. ***************
  106. *** 1857,1877 ****
  107.                   (char *)text, len,
  108.                   (LPWSTR)unicodebuf, unibuflen)))
  109.               ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
  110. !                   foptions, pcliprect, unicodebuf, len, NULL);
  111.           }
  112.       }
  113.       else
  114.   #endif
  115.       {
  116. ! #ifdef FEAT_RIGHTLEFT
  117. !         /* ron: fixed Hebrew on Win98/Win2000 */
  118. !         if (curwin->w_p_rl)
  119. !         RevOut(s_hdc, TEXT_X(col), TEXT_Y(row),
  120. !                  foptions, pcliprect, (char *)text, len, padding);
  121. !         else
  122. ! #endif
  123. !         ExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row),
  124. !                  foptions, pcliprect, (char *)text, len, padding);
  125.       }
  126.       }
  127.   
  128. --- 1811,1826 ----
  129.                   (char *)text, len,
  130.                   (LPWSTR)unicodebuf, unibuflen)))
  131.               ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
  132. !                 ETO_IGNORELANGUAGE | foptions, pcliprect,
  133. !                                unicodebuf, len, NULL);
  134.           }
  135.       }
  136.       else
  137.   #endif
  138.       {
  139. !         ExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row),
  140. !             ETO_IGNORELANGUAGE | foptions, pcliprect,
  141. !                           (char *)text, len, padding);
  142.       }
  143.       }
  144.   
  145. *** ../vim61.015/src/version.c    Wed Apr 10 10:36:02 2002
  146. --- src/version.c    Wed Apr 10 21:33:31 2002
  147. ***************
  148. *** 608,609 ****
  149. --- 608,611 ----
  150.   {   /* Add new patch number below this line */
  151. + /**/
  152. +     16,
  153.   /**/
  154.  
  155. -- 
  156. hundred-and-one symptoms of being an internet addict:
  157. 137. You decide to stay in college for an additional year or two,
  158.      just so you can have the free Internet access.
  159.  
  160.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  161. ///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
  162. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  163.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  164.