Mercurial > projects > dwt2
comparison com.ibm.icu/src/com/ibm/icu/mangoicu/UBreakIterator.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 |
---|---|
100 // { | 100 // { |
101 // /*********************************************************************** | 101 // /*********************************************************************** |
102 // | 102 // |
103 // ***********************************************************************/ | 103 // ***********************************************************************/ |
104 // | 104 // |
105 // this (inout ULocale locale, UStringView text = null) | 105 // this (ref ULocale locale, UStringView text = null) |
106 // { | 106 // { |
107 // super (Type.Character, locale, text); | 107 // super (Type.Character, locale, text); |
108 // } | 108 // } |
109 // } | 109 // } |
110 // | 110 // |
131 // | 131 // |
132 // /*********************************************************************** | 132 // /*********************************************************************** |
133 // | 133 // |
134 // ***********************************************************************/ | 134 // ***********************************************************************/ |
135 // | 135 // |
136 // this (inout ULocale locale, UStringView text = null) | 136 // this (ref ULocale locale, UStringView text = null) |
137 // { | 137 // { |
138 // super (Type.Word, locale, text); | 138 // super (Type.Word, locale, text); |
139 // } | 139 // } |
140 // | 140 // |
141 // /*********************************************************************** | 141 // /*********************************************************************** |
143 // Return the status from the break rule that determined | 143 // Return the status from the break rule that determined |
144 // the most recently returned break position. | 144 // the most recently returned break position. |
145 // | 145 // |
146 // ***********************************************************************/ | 146 // ***********************************************************************/ |
147 // | 147 // |
148 // void getStatus (inout Break b) | 148 // void getStatus (ref Break b) |
149 // { | 149 // { |
150 // b = cast(Break) super.getStatus(); | 150 // b = cast(Break) super.getStatus(); |
151 // } | 151 // } |
152 // } | 152 // } |
153 // | 153 // |
168 // | 168 // |
169 // /*********************************************************************** | 169 // /*********************************************************************** |
170 // | 170 // |
171 // ***********************************************************************/ | 171 // ***********************************************************************/ |
172 // | 172 // |
173 // this (inout ULocale locale, UStringView text = null) | 173 // this (ref ULocale locale, UStringView text = null) |
174 // { | 174 // { |
175 // super (Type.Line, locale, text); | 175 // super (Type.Line, locale, text); |
176 // } | 176 // } |
177 // | 177 // |
178 // /*********************************************************************** | 178 // /*********************************************************************** |
180 // Return the status from the break rule that determined | 180 // Return the status from the break rule that determined |
181 // the most recently returned break position. | 181 // the most recently returned break position. |
182 // | 182 // |
183 // ***********************************************************************/ | 183 // ***********************************************************************/ |
184 // | 184 // |
185 // void getStatus (inout Break b) | 185 // void getStatus (ref Break b) |
186 // { | 186 // { |
187 // b = cast(Break) super.getStatus(); | 187 // b = cast(Break) super.getStatus(); |
188 // } | 188 // } |
189 // } | 189 // } |
190 // | 190 // |
205 // | 205 // |
206 // /*********************************************************************** | 206 // /*********************************************************************** |
207 // | 207 // |
208 // ***********************************************************************/ | 208 // ***********************************************************************/ |
209 // | 209 // |
210 // this (inout ULocale locale, UStringView text = null) | 210 // this (ref ULocale locale, UStringView text = null) |
211 // { | 211 // { |
212 // super (Type.Sentence, locale, text); | 212 // super (Type.Sentence, locale, text); |
213 // } | 213 // } |
214 // | 214 // |
215 // /*********************************************************************** | 215 // /*********************************************************************** |
217 // Return the status from the break rule that determined | 217 // Return the status from the break rule that determined |
218 // the most recently returned break position. | 218 // the most recently returned break position. |
219 // | 219 // |
220 // ***********************************************************************/ | 220 // ***********************************************************************/ |
221 // | 221 // |
222 // void getStatus (inout Break b) | 222 // void getStatus (ref Break b) |
223 // { | 223 // { |
224 // b = cast(Break) super.getStatus(); | 224 // b = cast(Break) super.getStatus(); |
225 // } | 225 // } |
226 // } | 226 // } |
227 // | 227 // |
234 // { | 234 // { |
235 // /*********************************************************************** | 235 // /*********************************************************************** |
236 // | 236 // |
237 // ***********************************************************************/ | 237 // ***********************************************************************/ |
238 // | 238 // |
239 // this (inout ULocale locale, UStringView text = null) | 239 // this (ref ULocale locale, UStringView text = null) |
240 // { | 240 // { |
241 // super (Type.Title, locale, text); | 241 // super (Type.Title, locale, text); |
242 // } | 242 // } |
243 // } | 243 // } |
244 // | 244 // |
518 Return the status from the break rule that determined | 518 Return the status from the break rule that determined |
519 the most recently returned break position. | 519 the most recently returned break position. |
520 | 520 |
521 ***********************************************************************/ | 521 ***********************************************************************/ |
522 | 522 |
523 void getStatus (inout uint s) | 523 void getStatus (ref uint s) |
524 { | 524 { |
525 s = getStatus (); | 525 s = getStatus (); |
526 } | 526 } |
527 | 527 |
528 /*********************************************************************** | 528 /*********************************************************************** |
551 complicated by the issues regarding D and DLLs on the | 551 complicated by the issues regarding D and DLLs on the |
552 Windows platform | 552 Windows platform |
553 | 553 |
554 ***********************************************************************/ | 554 ***********************************************************************/ |
555 | 555 |
556 private static void* library; | 556 mixin(/*ICU.*/genICUNative!("uc" |
557 | 557 ,"Handle function (uint, char*, wchar*, uint, ref ICU.UErrorCode)", "ubrk_open" |
558 /*********************************************************************** | 558 ,"Handle function (wchar*, uint, wchar*, uint, void*, ref ICU.UErrorCode)", "ubrk_openRules" |
559 | 559 ,"void function (Handle)", "ubrk_close" |
560 ***********************************************************************/ | 560 ,"void function (Handle, wchar*, uint, ref ICU.UErrorCode)", "ubrk_setText" |
561 | 561 ,"uint function (Handle)", "ubrk_current" |
562 private static extern (C) | 562 ,"uint function (Handle)", "ubrk_next" |
563 { | 563 ,"uint function (Handle)", "ubrk_previous" |
564 Handle function (uint, char*, wchar*, uint, inout ICU.UErrorCode) ubrk_open; | 564 ,"uint function (Handle)", "ubrk_first" |
565 Handle function (wchar*, uint, wchar*, uint, void*, inout ICU.UErrorCode) ubrk_openRules; | 565 ,"uint function (Handle)", "ubrk_last" |
566 void function (Handle) ubrk_close; | 566 ,"uint function (Handle, uint)", "ubrk_preceding" |
567 void function (Handle, wchar*, uint, inout ICU.UErrorCode) ubrk_setText; | 567 ,"uint function (Handle, uint)", "ubrk_following" |
568 uint function (Handle) ubrk_current; | 568 ,"byte function (Handle, uint)", "ubrk_isBoundary" |
569 uint function (Handle) ubrk_next; | 569 ,"uint function (Handle)", "ubrk_getRuleStatus" |
570 uint function (Handle) ubrk_previous; | 570 ,"Handle function (Handle, void *, int *, ref ICU.UErrorCode)", "ubrk_safeClone" |
571 uint function (Handle) ubrk_first; | 571 ,"void function (Handle, UText*, ref ICU.UErrorCode)", "ubrk_setUText" |
572 uint function (Handle) ubrk_last; | 572 )); |
573 uint function (Handle, uint) ubrk_preceding; | |
574 uint function (Handle, uint) ubrk_following; | |
575 byte function (Handle, uint) ubrk_isBoundary; | |
576 uint function (Handle) ubrk_getRuleStatus; | |
577 Handle function (Handle, void *, int *, inout ICU.UErrorCode) ubrk_safeClone; | |
578 void function (Handle, UText*, inout ICU.UErrorCode) ubrk_setUText; | |
579 } | |
580 | |
581 /*********************************************************************** | |
582 | |
583 ***********************************************************************/ | |
584 | |
585 static FunctionLoader.Bind[] targets = | |
586 [ | |
587 {cast(void**) &ubrk_open, "ubrk_open"}, | |
588 {cast(void**) &ubrk_close, "ubrk_close"}, | |
589 {cast(void**) &ubrk_openRules, "ubrk_openRules"}, | |
590 {cast(void**) &ubrk_setText, "ubrk_setText"}, | |
591 {cast(void**) &ubrk_current, "ubrk_current"}, | |
592 {cast(void**) &ubrk_next, "ubrk_next"}, | |
593 {cast(void**) &ubrk_previous, "ubrk_previous"}, | |
594 {cast(void**) &ubrk_first, "ubrk_first"}, | |
595 {cast(void**) &ubrk_last, "ubrk_last"}, | |
596 {cast(void**) &ubrk_preceding, "ubrk_preceding"}, | |
597 {cast(void**) &ubrk_following, "ubrk_following"}, | |
598 {cast(void**) &ubrk_isBoundary, "ubrk_isBoundary"}, | |
599 {cast(void**) &ubrk_getRuleStatus, "ubrk_getRuleStatus"}, | |
600 {cast(void**) &ubrk_setUText, "ubrk_setUText"}, | |
601 {cast(void**) &ubrk_safeClone, "ubrk_safeClone"}, | |
602 ]; | |
603 | |
604 /********************************************************************** | |
605 | |
606 **********************************************************************/ | |
607 | |
608 static this () | |
609 { | |
610 library = FunctionLoader.bind (ICU.icuuc, targets); | |
611 } | |
612 | |
613 /********************************************************************** | |
614 | |
615 **********************************************************************/ | |
616 | |
617 static ~this () | |
618 { | |
619 FunctionLoader.unbind (library); | |
620 } | |
621 } | 573 } |