comparison dynamin/c/uniscribe.d @ 106:acdbb30fee7e

Port to D2. Most of the effort was dealing with immutable and const.
author Jordan Miner <jminer7@gmail.com>
date Mon, 17 Dec 2012 23:41:50 -0600
parents 0d6778fea624
children
comparison
equal deleted inserted replaced
105:97997a544ac0 106:acdbb30fee7e
26 } 26 }
27 } 27 }
28 28
29 extern(Windows): 29 extern(Windows):
30 30
31 const int USPBUILD = 0400; 31 //const int USPBUILD = octal!400;
32 32
33 enum { 33 enum {
34 SCRIPT_UNDEFINED = 0 34 SCRIPT_UNDEFINED = 0
35 } 35 }
36 36
123 int iCharPos; 123 int iCharPos;
124 SCRIPT_ANALYSIS a; 124 SCRIPT_ANALYSIS a;
125 } 125 }
126 126
127 HRESULT ScriptItemize( 127 HRESULT ScriptItemize(
128 /*const*/ WCHAR* pwcInChars, 128 const(WCHAR)* pwcInChars,
129 int cInChars, 129 int cInChars,
130 int cMaxItems, 130 int cMaxItems,
131 /*const*/ SCRIPT_CONTROL* psControl, 131 const(SCRIPT_CONTROL)* psControl,
132 /*const*/ SCRIPT_STATE* psState, 132 const(SCRIPT_STATE)* psState,
133 SCRIPT_ITEM* pItems, 133 SCRIPT_ITEM* pItems,
134 int* pcItems); 134 int* pcItems);
135 135
136 HRESULT ScriptLayout( 136 HRESULT ScriptLayout(
137 int cRuns, 137 int cRuns,
138 /*const*/ BYTE* pbLevel, 138 const(BYTE)* pbLevel,
139 int* piVisualToLogical, 139 int* piVisualToLogical,
140 int* piLogicalToVisual); 140 int* piLogicalToVisual);
141 141
142 enum SCRIPT_JUSTIFY { 142 enum SCRIPT_JUSTIFY {
143 SCRIPT_JUSTIFY_NONE = 0, 143 SCRIPT_JUSTIFY_NONE = 0,
178 } 178 }
179 179
180 HRESULT ScriptShape( 180 HRESULT ScriptShape(
181 HDC hdc, 181 HDC hdc,
182 SCRIPT_CACHE* psc, 182 SCRIPT_CACHE* psc,
183 /*const*/ WCHAR* pwcChars, 183 const(WCHAR)* pwcChars,
184 int cChars, 184 int cChars,
185 int cMaxGlyphs, 185 int cMaxGlyphs,
186 SCRIPT_ANALYSIS* psa, 186 SCRIPT_ANALYSIS* psa,
187 WORD* pwOutGlyphs, 187 WORD* pwOutGlyphs,
188 WORD* pwLogClust, 188 WORD* pwLogClust,
195 } 195 }
196 196
197 HRESULT ScriptPlace( 197 HRESULT ScriptPlace(
198 HDC hdc, 198 HDC hdc,
199 SCRIPT_CACHE* psc, 199 SCRIPT_CACHE* psc,
200 /*const*/ WORD* pwGlyphs, 200 const(WORD)* pwGlyphs,
201 int cGlyphs, 201 int cGlyphs,
202 /*const*/ SCRIPT_VISATTR* psva, 202 const(SCRIPT_VISATTR)* psva,
203 SCRIPT_ANALYSIS* psa, 203 SCRIPT_ANALYSIS* psa,
204 int* piAdvance, 204 int* piAdvance,
205 GOFFSET* pGoffset, 205 GOFFSET* pGoffset,
206 ABC* pABC); 206 ABC* pABC);
207 207
208 HRESULT ScriptTextOut( 208 HRESULT ScriptTextOut(
209 /*const*/ HDC hdc, 209 const(HDC) hdc,
210 SCRIPT_CACHE* psc, 210 SCRIPT_CACHE* psc,
211 int x, 211 int x,
212 int y, 212 int y,
213 UINT fuOptions, 213 UINT fuOptions,
214 /*const*/ RECT* lprc, 214 const(RECT)* lprc,
215 /*const*/ SCRIPT_ANALYSIS* psa, 215 const(SCRIPT_ANALYSIS)* psa,
216 /*const*/ WCHAR* pwcReserved, 216 const(WCHAR)* pwcReserved,
217 int iReserved, 217 int iReserved,
218 /*const*/ WORD* pwGlyphs, 218 const(WORD)* pwGlyphs,
219 int cGlyphs, 219 int cGlyphs,
220 /*const*/ int* piAdvance, 220 const(int)* piAdvance,
221 /*const*/ int* piJustify, 221 const(int)* piJustify,
222 /*const*/ GOFFSET* pGoffset); 222 const(GOFFSET)* pGoffset);
223 223
224 HRESULT ScriptJustify( 224 HRESULT ScriptJustify(
225 /*const*/ SCRIPT_VISATTR* psva, 225 const(SCRIPT_VISATTR)* psva,
226 /*const*/ int* piAdvance, 226 const(int)* piAdvance,
227 int cGlyphs, 227 int cGlyphs,
228 int iDx, 228 int iDx,
229 int iMinKashida, 229 int iMinKashida,
230 int* piJustify); 230 int* piJustify);
231 231
247 BYTE fReserved :3; 247 BYTE fReserved :3;
248 */ 248 */
249 } 249 }
250 250
251 HRESULT ScriptBreak( 251 HRESULT ScriptBreak(
252 /*const*/ WCHAR* pwcChars, 252 const(WCHAR)* pwcChars,
253 int cChars, 253 int cChars,
254 /*const*/ SCRIPT_ANALYSIS* psa, 254 const(SCRIPT_ANALYSIS)* psa,
255 SCRIPT_LOGATTR* psla); 255 SCRIPT_LOGATTR* psla);
256 256
257 HRESULT ScriptCPtoX( 257 HRESULT ScriptCPtoX(
258 int iCP, 258 int iCP,
259 BOOL fTrailing, 259 BOOL fTrailing,
260 int cChars, 260 int cChars,
261 int cGlyphs, 261 int cGlyphs,
262 /*const*/ WORD* pwLogClust, 262 const(WORD)* pwLogClust,
263 /*const*/ SCRIPT_VISATTR* psva, 263 const(SCRIPT_VISATTR)* psva,
264 /*const*/ int* piAdvance, 264 const(int)* piAdvance,
265 /*const*/ SCRIPT_ANALYSIS* psa, 265 const(SCRIPT_ANALYSIS)* psa,
266 int* piX); 266 int* piX);
267 267
268 HRESULT ScriptXtoCP( 268 HRESULT ScriptXtoCP(
269 int iX, 269 int iX,
270 int cChars, 270 int cChars,
271 int cGlyphs, 271 int cGlyphs,
272 /*const*/ WORD* pwLogClust, 272 const(WORD)* pwLogClust,
273 /*const*/ SCRIPT_VISATTR* psva, 273 const(SCRIPT_VISATTR)* psva,
274 /*const*/ int* piAdvance, 274 const(int)* piAdvance,
275 /*const*/ SCRIPT_ANALYSIS* psa, 275 const(SCRIPT_ANALYSIS)* psa,
276 int* piCP, 276 int* piCP,
277 int* piTrailing); 277 int* piTrailing);
278 278
279 HRESULT ScriptGetLogicalWidths( 279 HRESULT ScriptGetLogicalWidths(
280 /*const*/ SCRIPT_ANALYSIS* psa, 280 const(SCRIPT_ANALYSIS)* psa,
281 int cChars, 281 int cChars,
282 int cGlyphs, 282 int cGlyphs,
283 /*const*/ int* piGlyphWidth, 283 const(int)* piGlyphWidth,
284 /*const*/ WORD* pwLogClust, 284 const(WORD)* pwLogClust,
285 /*const*/ SCRIPT_VISATTR* psva, 285 const(SCRIPT_VISATTR)* psva,
286 int* piDx); 286 int* piDx);
287 287
288 HRESULT ScriptApplyLogicalWidth( 288 HRESULT ScriptApplyLogicalWidth(
289 /*const*/ int* piDx, 289 const(int)* piDx,
290 int cChars, 290 int cChars,
291 int cGlyphs, 291 int cGlyphs,
292 /*const*/ WORD* pwLogClust, 292 const(WORD)* pwLogClust,
293 /*const*/ SCRIPT_VISATTR* psva, 293 const(SCRIPT_VISATTR)* psva,
294 /*const*/ int* piAdvance, 294 const(int)* piAdvance,
295 /*const*/ SCRIPT_ANALYSIS* psa, 295 const(SCRIPT_ANALYSIS)* psa,
296 ABC* pABC, 296 ABC* pABC,
297 int* piJustify); 297 int* piJustify);
298 298
299 enum { 299 enum {
300 SGCM_RTL = 0x00000001 300 SGCM_RTL = 0x00000001
301 } 301 }
302 302
303 HRESULT ScriptGetCMap( 303 HRESULT ScriptGetCMap(
304 HDC hdc, 304 HDC hdc,
305 SCRIPT_CACHE* psc, 305 SCRIPT_CACHE* psc,
306 /*const*/ WCHAR* pwcInChars, 306 const(WCHAR)* pwcInChars,
307 int cChars, 307 int cChars,
308 DWORD dwFlags, 308 DWORD dwFlags,
309 WORD* pwOutGlyphs); 309 WORD* pwOutGlyphs);
310 310
311 HRESULT ScriptGetGlyphABCWidth( 311 HRESULT ScriptGetGlyphABCWidth(
409 409
410 alias void* SCRIPT_STRING_ANALYSIS; 410 alias void* SCRIPT_STRING_ANALYSIS;
411 411
412 HRESULT ScriptStringAnalyse( 412 HRESULT ScriptStringAnalyse(
413 HDC hdc, 413 HDC hdc,
414 /*const*/ void* pString, 414 const(void)* pString,
415 int cString, 415 int cString,
416 int cGlyphs, 416 int cGlyphs,
417 int iCharset, 417 int iCharset,
418 DWORD dwFlags, 418 DWORD dwFlags,
419 int iReqWidth, 419 int iReqWidth,
420 SCRIPT_CONTROL* psControl, 420 SCRIPT_CONTROL* psControl,
421 SCRIPT_STATE* psState, 421 SCRIPT_STATE* psState,
422 /*const*/ int* piDx, 422 const(int)* piDx,
423 SCRIPT_TABDEF* pTabdef, 423 SCRIPT_TABDEF* pTabdef,
424 /*const*/ BYTE* pbInClass, 424 const(BYTE)* pbInClass,
425 SCRIPT_STRING_ANALYSIS* pssa); 425 SCRIPT_STRING_ANALYSIS* pssa);
426 426
427 HRESULT ScriptStringFree(SCRIPT_STRING_ANALYSIS* pssa); 427 HRESULT ScriptStringFree(SCRIPT_STRING_ANALYSIS* pssa);
428 428
429 /*const*/ SIZE* ScriptString_pSize(SCRIPT_STRING_ANALYSIS ssa); 429 /*const*/ SIZE* ScriptString_pSize(SCRIPT_STRING_ANALYSIS ssa);
453 HRESULT ScriptStringOut( 453 HRESULT ScriptStringOut(
454 SCRIPT_STRING_ANALYSIS ssa, 454 SCRIPT_STRING_ANALYSIS ssa,
455 int iX, 455 int iX,
456 int iY, 456 int iY,
457 UINT uOptions, 457 UINT uOptions,
458 /*const*/ RECT* prc, 458 const(RECT)* prc,
459 int iMinSel, 459 int iMinSel,
460 int iMaxSel, 460 int iMaxSel,
461 BOOL fDisabled); 461 BOOL fDisabled);
462 462
463 enum { 463 enum {
465 SIC_ASCIIDIGIT = 2, 465 SIC_ASCIIDIGIT = 2,
466 SIC_NEUTRAL = 4, 466 SIC_NEUTRAL = 4,
467 } 467 }
468 468
469 HRESULT ScriptIsComplex( 469 HRESULT ScriptIsComplex(
470 /*const*/ WCHAR* pwcInChars, 470 const(WCHAR)* pwcInChars,
471 int cInChars, 471 int cInChars,
472 DWORD dwFlags); 472 DWORD dwFlags);
473 473
474 struct SCRIPT_DIGITSUBSTITUTE { 474 struct SCRIPT_DIGITSUBSTITUTE {
475 DWORD fields1; 475 DWORD fields1;
496 SCRIPT_DIGITSUBSTITUTE_NATIONAL = 2, 496 SCRIPT_DIGITSUBSTITUTE_NATIONAL = 2,
497 SCRIPT_DIGITSUBSTITUTE_TRADITIONAL = 3, 497 SCRIPT_DIGITSUBSTITUTE_TRADITIONAL = 3,
498 } 498 }
499 499
500 HRESULT ScriptApplyDigitSubstitution( 500 HRESULT ScriptApplyDigitSubstitution(
501 /*const*/ SCRIPT_DIGITSUBSTITUTE* psds, 501 const(SCRIPT_DIGITSUBSTITUTE)* psds,
502 SCRIPT_CONTROL* psc, 502 SCRIPT_CONTROL* psc,
503 SCRIPT_STATE* pss); 503 SCRIPT_STATE* pss);
504 504
505 505