comparison com.ibm.icu/src/com/ibm/icu/mangoicu/UChar.d @ 120:536e43f63c81

Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661 ===D2=== * added [Try]Immutable/Const/Shared templates to work with differenses in D1/D2 instead of version statements used these templates to work with strict type storage rules of dmd-2.053 * com.ibm.icu now also compilable with D2, but not tested yet * small fixes Snippet288 - shared data is in TLS ===Phobos=== * fixed critical bugs in Phobos implemention completely incorrect segfault prone fromStringz (Linux's port ruthless killer) terrible, incorrect StringBuffer realization (StyledText killer) * fixed small bugs as well Snippet72 - misprint in the snippet * implemented missed functionality for Phobos ByteArrayOutputStream implemented (image loading available) formatting correctly works for all DWT's cases As a result, folowing snippets now works with Phobos (Snippet### - what is fixed): Snippet24, 42, 111, 115, 130, 235, 276 - bad string formatting Snippet48, 282 - crash on image loading Snippet163, 189, 211, 213, 217, 218, 222 - crash on copy/cut in StyledText Snippet244 - hang-up ===Tango=== * few changes for the latest Tango trunc-r5661 * few small performance improvments ===General=== * implMissing-s for only one version changed to implMissingInTango/InPhobos * incorrect calls to Format in toString-s fixed * fixed loading \uXXXX characters in ResourceBundle * added good UTF-8 support for StyledText, TextLayout (Win32) and friends UTF functions revised and tested. It is now in java.nonstandard.*Utf modules StyledText and TextLayout (Win32) modules revised for UTF-8 support * removed small diferences in most identical files in *.swt.* folders *.swt.internal.image, *.swt.events and *.swt.custom are identical in Win32/Linux32 now 179 of 576 (~31%) files in *.swt.* folders are fully identical * Win32: snippets now have right subsystem, pretty icons and native system style controls * small fixes in snippets Snippet44 - it's not Snippet44 Snippet212 - functions work with different images and offsets arrays Win32: Snippet282 - crash on close if the button has an image Snippet293 - setGrayed is commented and others Win32: As a result, folowing snippets now works Snippet68 - color doesn't change Snippet163, 189, 211, 213, 217, 218, 222 - UTF-8 issues (see above) Snippet193 - no tabel headers
author Denis Shelomovskij <verylonglogin.reg@gmail.com>
date Sat, 09 Jul 2011 15:50:20 +0300
parents ebefa5c2eab4
children
comparison
equal deleted inserted replaced
119:d00e8db0a568 120:536e43f63c81
668 668
669 Retrieve the name of a Unicode character. 669 Retrieve the name of a Unicode character.
670 670
671 ***********************************************************************/ 671 ***********************************************************************/
672 672
673 char[] getCharName (dchar c, CharNameChoice choice, inout char[] dst) 673 char[] getCharName (dchar c, CharNameChoice choice, ref char[] dst)
674 { 674 {
675 UErrorCode e; 675 UErrorCode e;
676 676
677 uint len = u_charName (c, choice, dst.ptr, dst.length, e); 677 uint len = u_charName (c, choice, dst.ptr, dst.length, e);
678 testError (e, "failed to extract char name (buffer too small?)"); 678 testError (e, "failed to extract char name (buffer too small?)");
683 683
684 Get the ISO 10646 comment for a character. 684 Get the ISO 10646 comment for a character.
685 685
686 ***********************************************************************/ 686 ***********************************************************************/
687 687
688 char[] getComment (dchar c, inout char[] dst) 688 char[] getComment (dchar c, ref char[] dst)
689 { 689 {
690 UErrorCode e; 690 UErrorCode e;
691 691
692 uint len = u_getISOComment (c, dst.ptr, dst.length, e); 692 uint len = u_getISOComment (c, dst.ptr, dst.length, e);
693 testError (e, "failed to extract comment (buffer too small?)"); 693 testError (e, "failed to extract comment (buffer too small?)");
738 738
739 Gets the Unicode version information 739 Gets the Unicode version information
740 740
741 ***********************************************************************/ 741 ***********************************************************************/
742 742
743 void getUnicodeVersion (inout Version v) 743 void getUnicodeVersion (ref Version v)
744 { 744 {
745 u_getUnicodeVersion (v); 745 u_getUnicodeVersion (v);
746 } 746 }
747 747
748 /*********************************************************************** 748 /***********************************************************************
749 749
750 Get the "age" of the code point 750 Get the "age" of the code point
751 751
752 ***********************************************************************/ 752 ***********************************************************************/
753 753
754 void getCharAge (dchar c, inout Version v) 754 void getCharAge (dchar c, ref Version v)
755 { 755 {
756 u_charAge (c, v); 756 u_charAge (c, v);
757 } 757 }
758 758
759 759
1137 complicated by the issues regarding D and DLLs on the 1137 complicated by the issues regarding D and DLLs on the
1138 Windows platform 1138 Windows platform
1139 1139
1140 ***********************************************************************/ 1140 ***********************************************************************/
1141 1141
1142 private static void* library; 1142 mixin(genICUNative!("uc"
1143 1143 ,"uint function (uint, uint)", "u_getIntPropertyValue"
1144 /*********************************************************************** 1144 ,"uint function (uint)", "u_getIntPropertyMinValue"
1145 1145 ,"uint function (uint)", "u_getIntPropertyMaxValue"
1146 ***********************************************************************/ 1146 ,"uint function (dchar)", "u_charDirection"
1147 1147 ,"uint function (dchar)", "ublock_getCode"
1148 private static extern (C) 1148 ,"uint function (dchar, uint, char*, uint, ref UErrorCode)", "u_charName"
1149 { 1149 ,"uint function (dchar, char*, uint, ref UErrorCode)", "u_getISOComment"
1150 uint function (uint, uint) u_getIntPropertyValue; 1150 ,"uint function (uint, char*, ref UErrorCode)", "u_charFromName"
1151 uint function (uint) u_getIntPropertyMinValue; 1151 ,"char* function (uint, uint)", "u_getPropertyName"
1152 uint function (uint) u_getIntPropertyMaxValue; 1152 ,"char* function (uint, uint, uint)", "u_getPropertyValueName"
1153 uint function (dchar) u_charDirection; 1153 ,"void function (ref Version)", "u_getUnicodeVersion"
1154 uint function (dchar) ublock_getCode; 1154 ,"void function (dchar, ref Version)", "u_charAge"
1155 uint function (dchar, uint, char*, uint, inout UErrorCode) u_charName; 1155 ));
1156 uint function (dchar, char*, uint, inout UErrorCode) u_getISOComment;
1157 uint function (uint, char*, inout UErrorCode) u_charFromName;
1158 char* function (uint, uint) u_getPropertyName;
1159 char* function (uint, uint, uint) u_getPropertyValueName;
1160 void function (inout Version) u_getUnicodeVersion;
1161 void function (dchar, inout Version) u_charAge;
1162 }
1163
1164 /***********************************************************************
1165
1166 ***********************************************************************/
1167
1168 static FunctionLoader.Bind[] targets =
1169 [
1170 {cast(void**) &forDigit, "u_forDigit"},
1171 {cast(void**) &digit, "u_digit"},
1172 {cast(void**) &foldCase, "u_foldCase"},
1173 {cast(void**) &toTitle, "u_totitle"},
1174 {cast(void**) &toUpper, "u_toupper"},
1175 {cast(void**) &toLower, "u_tolower"},
1176 {cast(void**) &charType, "u_charType"},
1177 {cast(void**) &charMirror, "u_charMirror"},
1178 {cast(void**) &charDigitValue, "u_charDigitValue"},
1179 {cast(void**) &isJavaIDPart, "u_isJavaIDPart"},
1180 {cast(void**) &isJavaIDStart, "u_isJavaIDStart"},
1181 {cast(void**) &isIDIgnorable, "u_isIDIgnorable"},
1182 {cast(void**) &isIDPart, "u_isIDPart"},
1183 {cast(void**) &isIDStart, "u_isIDStart"},
1184 {cast(void**) &isMirrored, "u_isMirrored"},
1185 {cast(void**) &isBase, "u_isbase"},
1186 {cast(void**) &isPrint, "u_isprint"},
1187 {cast(void**) &isISOControl, "u_isISOControl"},
1188 {cast(void**) &isCtrl, "u_iscntrl"},
1189 {cast(void**) &isWhiteSpace, "u_isWhitespace"},
1190 {cast(void**) &isJavaSpaceChar, "u_isJavaSpaceChar"},
1191 {cast(void**) &isSpace, "u_isspace"},
1192 {cast(void**) &isDefined, "u_isdefined"},
1193 {cast(void**) &isBlank, "u_isblank"},
1194 {cast(void**) &isGraph, "u_isgraph"},
1195 {cast(void**) &isPunct, "u_ispunct"},
1196 {cast(void**) &isHexDigit, "u_isxdigit"},
1197 {cast(void**) &isAlpha, "u_isalpha"},
1198 {cast(void**) &isAlphaNumeric, "u_isalnum"},
1199 {cast(void**) &isDigit, "u_isdigit"},
1200 {cast(void**) &isTitle, "u_istitle"},
1201 {cast(void**) &isUpper, "u_isupper"},
1202 {cast(void**) &isLower, "u_islower"},
1203 {cast(void**) &isUAlphabetic, "u_isUAlphabetic"},
1204 {cast(void**) &isUWhiteSpace, "u_isUWhiteSpace"},
1205 {cast(void**) &isUUppercase, "u_isUUppercase"},
1206 {cast(void**) &isULowercase, "u_isULowercase"},
1207 {cast(void**) &getNumericValue, "u_getNumericValue"},
1208 {cast(void**) &getCombiningClass, "u_getCombiningClass"},
1209 {cast(void**) &u_getIntPropertyValue, "u_getIntPropertyValue"},
1210 {cast(void**) &u_getIntPropertyMinValue,"u_getIntPropertyMinValue"},
1211 {cast(void**) &u_getIntPropertyMaxValue,"u_getIntPropertyMaxValue"},
1212 {cast(void**) &u_charDirection, "u_charDirection"},
1213 {cast(void**) &ublock_getCode, "ublock_getCode"},
1214 {cast(void**) &u_charName, "u_charName"},
1215 {cast(void**) &u_getISOComment, "u_getISOComment"},
1216 {cast(void**) &u_charFromName, "u_charFromName"},
1217 {cast(void**) &u_getPropertyName, "u_getPropertyName"},
1218 {cast(void**) &u_getPropertyValueName, "u_getPropertyValueName"},
1219 {cast(void**) &u_getUnicodeVersion, "u_getUnicodeVersion"},
1220 {cast(void**) &u_charAge, "u_charAge"},
1221 ];
1222
1223 /***********************************************************************
1224
1225 ***********************************************************************/
1226
1227 static this ()
1228 {
1229 library = FunctionLoader.bind (icuuc, targets);
1230 }
1231
1232 /***********************************************************************
1233
1234 ***********************************************************************/
1235
1236 static ~this ()
1237 {
1238 FunctionLoader.unbind (library);
1239 }
1240 } 1156 }