1 | /*
|
---|
2 | * Copyright (C) 2005 Steven Edwards
|
---|
3 | * Copyright (C) 2005 Vijay Kiran Kamuju
|
---|
4 | *
|
---|
5 | * This library is free software; you can redistribute it and/or
|
---|
6 | * modify it under the terms of the GNU Lesser General Public
|
---|
7 | * License as published by the Free Software Foundation; either
|
---|
8 | * version 2.1 of the License, or (at your option) any later version.
|
---|
9 | *
|
---|
10 | * This library is distributed in the hope that it will be useful,
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
13 | * Lesser General Public License for more details.
|
---|
14 | *
|
---|
15 | * You should have received a copy of the GNU Lesser General Public
|
---|
16 | * License along with this library; if not, write to the Free Software
|
---|
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
18 | */
|
---|
19 |
|
---|
20 | /*
|
---|
21 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
22 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
23 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
24 | * a choice of LGPL license versions is made available with the language indicating
|
---|
25 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
26 | * of the LGPL is applied is otherwise unspecified.
|
---|
27 | */
|
---|
28 |
|
---|
29 | #ifndef __USP10_H
|
---|
30 | #define __USP10_H
|
---|
31 |
|
---|
32 | #include <windows.h>
|
---|
33 | /* FIXME: #include <specstrings.h> */
|
---|
34 |
|
---|
35 | #ifdef __cplusplus
|
---|
36 | extern "C" {
|
---|
37 | #endif
|
---|
38 |
|
---|
39 | /** ScriptStringAnalyse */
|
---|
40 | #define SSA_PASSWORD 0x00000001
|
---|
41 | #define SSA_TAB 0x00000002
|
---|
42 | #define SSA_CLIP 0x00000004
|
---|
43 | #define SSA_FIT 0x00000008
|
---|
44 | #define SSA_DZWG 0x00000010
|
---|
45 | #define SSA_FALLBACK 0x00000020
|
---|
46 | #define SSA_BREAK 0x00000040
|
---|
47 | #define SSA_GLYPHS 0x00000080
|
---|
48 | #define SSA_RTL 0x00000100
|
---|
49 | #define SSA_GCP 0x00000200
|
---|
50 | #define SSA_HOTKEY 0x00000400
|
---|
51 | #define SSA_METAFILE 0x00000800
|
---|
52 | #define SSA_LINK 0x00001000
|
---|
53 | #define SSA_HIDEHOTKEY 0x00002000
|
---|
54 | #define SSA_HOTKEYONLY 0x00002400
|
---|
55 | #define SSA_FULLMEASURE 0x04000000
|
---|
56 | #define SSA_LPKANSIFALLBACK 0x08000000
|
---|
57 | #define SSA_PIDX 0x10000000
|
---|
58 | #define SSA_LAYOUTRTL 0x20000000
|
---|
59 | #define SSA_DONTGLYPH 0x40000000
|
---|
60 | #define SSA_NOKASHIDA 0x80000000
|
---|
61 |
|
---|
62 | /** StringIsComplex */
|
---|
63 | #define SIC_COMPLEX 1
|
---|
64 | #define SIC_ASCIIDIGIT 2
|
---|
65 | #define SIC_NEUTRAL 4
|
---|
66 |
|
---|
67 | /** ScriptGetCMap */
|
---|
68 | #define SGCM_RTL 0x00000001
|
---|
69 |
|
---|
70 | /** ScriptApplyDigitSubstitution */
|
---|
71 | #define SCRIPT_DIGITSUBSTITUTE_CONTEXT 0
|
---|
72 | #define SCRIPT_DIGITSUBSTITUTE_NONE 1
|
---|
73 | #define SCRIPT_DIGITSUBSTITUTE_NATIONAL 2
|
---|
74 | #define SCRIPT_DIGITSUBSTITUTE_TRADITIONAL 3
|
---|
75 |
|
---|
76 | #define SCRIPT_UNDEFINED 0
|
---|
77 |
|
---|
78 | #define USP_E_SCRIPT_NOT_IN_FONT MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,0x200)
|
---|
79 |
|
---|
80 | typedef enum tag_SCRIPT_JUSTIFY {
|
---|
81 | SCRIPT_JUSTIFY_NONE = 0,
|
---|
82 | SCRIPT_JUSTIFY_ARABIC_BLANK = 1,
|
---|
83 | SCRIPT_JUSTIFY_CHARACTER = 2,
|
---|
84 | SCRIPT_JUSTIFY_RESERVED1 = 3,
|
---|
85 | SCRIPT_JUSTIFY_BLANK = 4,
|
---|
86 | SCRIPT_JUSTIFY_RESERVED2 = 5,
|
---|
87 | SCRIPT_JUSTIFY_RESERVED3 = 6,
|
---|
88 | SCRIPT_JUSTIFY_ARABIC_NORMAL = 7,
|
---|
89 | SCRIPT_JUSTIFY_ARABIC_KASHIDA = 8,
|
---|
90 | SCRIPT_JUSTIFY_ARABIC_ALEF = 9,
|
---|
91 | SCRIPT_JUSTIFY_ARABIC_HA = 10,
|
---|
92 | SCRIPT_JUSTIFY_ARABIC_RA = 11,
|
---|
93 | SCRIPT_JUSTIFY_ARABIC_BA = 12,
|
---|
94 | SCRIPT_JUSTIFY_ARABIC_BARA = 13,
|
---|
95 | SCRIPT_JUSTIFY_ARABIC_SEEN = 14,
|
---|
96 | SCRIPT_JUSTIFY_ARABIC_SEEN_M = 15,
|
---|
97 | } SCRIPT_JUSTIFY;
|
---|
98 |
|
---|
99 | typedef struct tag_SCRIPT_CONTROL {
|
---|
100 | DWORD uDefaultLanguage :16;
|
---|
101 | DWORD fContextDigits :1;
|
---|
102 | DWORD fInvertPreBoundDir :1;
|
---|
103 | DWORD fInvertPostBoundDir :1;
|
---|
104 | DWORD fLinkStringBefore :1;
|
---|
105 | DWORD fLinkStringAfter :1;
|
---|
106 | DWORD fNeutralOverride :1;
|
---|
107 | DWORD fNumericOverride :1;
|
---|
108 | DWORD fLegacyBidiClass :1;
|
---|
109 | DWORD fMergeNeutralItems :1;
|
---|
110 | DWORD fReserved :7;
|
---|
111 | } SCRIPT_CONTROL;
|
---|
112 |
|
---|
113 | typedef struct {
|
---|
114 | DWORD langid :16;
|
---|
115 | DWORD fNumeric :1;
|
---|
116 | DWORD fComplex :1;
|
---|
117 | DWORD fNeedsWordBreaking :1;
|
---|
118 | DWORD fNeedsCaretInfo :1;
|
---|
119 | DWORD bCharSet :8;
|
---|
120 | DWORD fControl :1;
|
---|
121 | DWORD fPrivateUseArea :1;
|
---|
122 | DWORD fNeedsCharacterJustify :1;
|
---|
123 | DWORD fInvalidGlyph :1;
|
---|
124 | DWORD fInvalidLogAttr :1;
|
---|
125 | DWORD fCDM :1;
|
---|
126 | DWORD fAmbiguousCharSet :1;
|
---|
127 | DWORD fClusterSizeVaries :1;
|
---|
128 | DWORD fRejectInvalid :1;
|
---|
129 | } SCRIPT_PROPERTIES;
|
---|
130 |
|
---|
131 | typedef struct tag_SCRIPT_STATE {
|
---|
132 | WORD uBidiLevel :5;
|
---|
133 | WORD fOverrideDirection :1;
|
---|
134 | WORD fInhibitSymSwap :1;
|
---|
135 | WORD fCharShape :1;
|
---|
136 | WORD fDigitSubstitute :1;
|
---|
137 | WORD fInhibitLigate :1;
|
---|
138 | WORD fDisplayZWG :1;
|
---|
139 | WORD fArabicNumContext :1;
|
---|
140 | WORD fGcpClusters :1;
|
---|
141 | WORD fReserved :1;
|
---|
142 | WORD fEngineReserved :2;
|
---|
143 | } SCRIPT_STATE;
|
---|
144 |
|
---|
145 | typedef struct tag_SCRIPT_ANALYSIS {
|
---|
146 | WORD eScript :10;
|
---|
147 | WORD fRTL :1;
|
---|
148 | WORD fLayoutRTL :1;
|
---|
149 | WORD fLinkBefore :1;
|
---|
150 | WORD fLinkAfter :1;
|
---|
151 | WORD fLogicalOrder :1;
|
---|
152 | WORD fNoGlyphIndex :1;
|
---|
153 | SCRIPT_STATE s;
|
---|
154 | } SCRIPT_ANALYSIS;
|
---|
155 |
|
---|
156 | typedef struct tag_SCRIPT_ITEM {
|
---|
157 | int iCharPos;
|
---|
158 | SCRIPT_ANALYSIS a;
|
---|
159 | } SCRIPT_ITEM;
|
---|
160 |
|
---|
161 | typedef struct tag_SCRIPT_DIGITSUBSTITUTE {
|
---|
162 | DWORD NationalDigitLanguage :16;
|
---|
163 | DWORD TraditionalDigitLanguage :16;
|
---|
164 | DWORD DigitSubstitute :8;
|
---|
165 | DWORD dwReserved;
|
---|
166 | } SCRIPT_DIGITSUBSTITUTE;
|
---|
167 |
|
---|
168 | typedef struct tag_SCRIPT_FONTPROPERTIES {
|
---|
169 | int cBytes;
|
---|
170 | WORD wgBlank;
|
---|
171 | WORD wgDefault;
|
---|
172 | WORD wgInvalid;
|
---|
173 | WORD wgKashida;
|
---|
174 | int iKashidaWidth;
|
---|
175 | } SCRIPT_FONTPROPERTIES;
|
---|
176 |
|
---|
177 | typedef struct tag_SCRIPT_TABDEF {
|
---|
178 | int cTabStops;
|
---|
179 | int iScale;
|
---|
180 | int *pTabStops;
|
---|
181 | int iTabOrigin;
|
---|
182 | } SCRIPT_TABDEF;
|
---|
183 |
|
---|
184 | typedef struct tag_SCRIPT_VISATTR {
|
---|
185 | WORD uJustification :4;
|
---|
186 | WORD fClusterStart :1;
|
---|
187 | WORD fDiacritic :1;
|
---|
188 | WORD fZeroWidth :1;
|
---|
189 | WORD fReserved :1;
|
---|
190 | WORD fShapeReserved :8;
|
---|
191 | } SCRIPT_VISATTR;
|
---|
192 |
|
---|
193 | typedef struct tag_SCRIPT_LOGATTR {
|
---|
194 | BYTE fSoftBreak :1;
|
---|
195 | BYTE fWhiteSpace :1;
|
---|
196 | BYTE fCharStop :1;
|
---|
197 | BYTE fWordStop :1;
|
---|
198 | BYTE fInvalid :1;
|
---|
199 | BYTE fReserved :3;
|
---|
200 | } SCRIPT_LOGATTR;
|
---|
201 |
|
---|
202 | typedef void *SCRIPT_CACHE;
|
---|
203 | typedef void *SCRIPT_STRING_ANALYSIS;
|
---|
204 |
|
---|
205 | #ifndef LSDEFS_DEFINED
|
---|
206 | typedef struct tagGOFFSET {
|
---|
207 | LONG du;
|
---|
208 | LONG dv;
|
---|
209 | } GOFFSET;
|
---|
210 | #endif
|
---|
211 |
|
---|
212 | typedef ULONG OPENTYPE_TAG;
|
---|
213 |
|
---|
214 | typedef struct tagOPENTYPE_FEATURE_RECORD
|
---|
215 | {
|
---|
216 | OPENTYPE_TAG tagFeature;
|
---|
217 | LONG lParameter;
|
---|
218 | } OPENTYPE_FEATURE_RECORD;
|
---|
219 |
|
---|
220 | typedef struct tagSCRIPT_GLYPHPROP
|
---|
221 | {
|
---|
222 | SCRIPT_VISATTR sva;
|
---|
223 | WORD reserved;
|
---|
224 | } SCRIPT_GLYPHPROP;
|
---|
225 |
|
---|
226 | typedef struct tagSCRIPT_CHARPROP
|
---|
227 | {
|
---|
228 | WORD fCanGlyphAlone :1;
|
---|
229 | WORD reserved :15;
|
---|
230 | } SCRIPT_CHARPROP;
|
---|
231 |
|
---|
232 | typedef struct tagTEXTRANGE_PROPERTIES
|
---|
233 | {
|
---|
234 | OPENTYPE_FEATURE_RECORD *potfRecords;
|
---|
235 | INT cotfRecords;
|
---|
236 | } TEXTRANGE_PROPERTIES;
|
---|
237 |
|
---|
238 | /* Function Declarations */
|
---|
239 |
|
---|
240 | HRESULT WINAPI ScriptApplyDigitSubstitution(const SCRIPT_DIGITSUBSTITUTE* psds,
|
---|
241 | SCRIPT_CONTROL* psc, SCRIPT_STATE* pss);
|
---|
242 | HRESULT WINAPI ScriptApplyLogicalWidth(const int *piDx, int cChars, int cGlyphs, const WORD *pwLogClust,
|
---|
243 | const SCRIPT_VISATTR *psva, const int *piAdvance,
|
---|
244 | const SCRIPT_ANALYSIS *psa, ABC *pABC, int *piJustify);
|
---|
245 | HRESULT WINAPI ScriptRecordDigitSubstitution(LCID Locale, SCRIPT_DIGITSUBSTITUTE *psds);
|
---|
246 | HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItems,
|
---|
247 | const SCRIPT_CONTROL *psControl, const SCRIPT_STATE *psState,
|
---|
248 | SCRIPT_ITEM *pItems, int *pcItems);
|
---|
249 | HRESULT WINAPI ScriptGetCMap(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars, int cChars,
|
---|
250 | DWORD dwFlags, WORD *pwOutGlyphs);
|
---|
251 | HRESULT WINAPI ScriptGetFontProperties(HDC hdc, SCRIPT_CACHE *psc, SCRIPT_FONTPROPERTIES *sfp);
|
---|
252 | HRESULT WINAPI ScriptGetGlyphABCWidth(HDC hdc, SCRIPT_CACHE *psc, WORD wGlyph, ABC *pABC);
|
---|
253 | HRESULT WINAPI ScriptGetLogicalWidths(const SCRIPT_ANALYSIS *psa, int cChars, int cGlyphs,
|
---|
254 | const int *piGlyphWidth, const WORD *pwLogClust,
|
---|
255 | const SCRIPT_VISATTR *psva, int *piDx);
|
---|
256 | HRESULT WINAPI ScriptGetProperties(const SCRIPT_PROPERTIES ***ppSp, int *piNumScripts);
|
---|
257 | HRESULT WINAPI ScriptStringAnalyse(HDC hdc,
|
---|
258 | const void *pString,
|
---|
259 | int cString,
|
---|
260 | int cGlyphs,
|
---|
261 | int iCharset,
|
---|
262 | DWORD dwFlags,
|
---|
263 | int iReqWidth,
|
---|
264 | SCRIPT_CONTROL *psControl,
|
---|
265 | SCRIPT_STATE *psState,
|
---|
266 | const int *piDx,
|
---|
267 | SCRIPT_TABDEF *pTabdef,
|
---|
268 | const BYTE *pbInClass,
|
---|
269 | SCRIPT_STRING_ANALYSIS *pssa);
|
---|
270 | HRESULT WINAPI ScriptStringValidate(SCRIPT_STRING_ANALYSIS ssa);
|
---|
271 | HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *pssa);
|
---|
272 | HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc);
|
---|
273 | HRESULT WINAPI ScriptIsComplex(const WCHAR* pwcInChars, int cInChars, DWORD dwFlags);
|
---|
274 | HRESULT WINAPI ScriptJustify(const SCRIPT_VISATTR *psva, const int *piAdvance, int cGlyphs,
|
---|
275 | int iDx, int iMinKashida, int *piJustify);
|
---|
276 | HRESULT WINAPI ScriptLayout(int cRuns, const BYTE *pbLevel, int *piVisualToLogical, int *piLogicalToVisual);
|
---|
277 | HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars, int cChars, int cMaxGlyphs,
|
---|
278 | SCRIPT_ANALYSIS *psa, WORD *pwOutGlyphs, WORD *pwLogClust, SCRIPT_VISATTR *psva, int *pcGlyphs);
|
---|
279 | HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs, int cGlyphs, const SCRIPT_VISATTR *psva,
|
---|
280 | SCRIPT_ANALYSIS *psa, int *piAdvance, GOFFSET *pGoffset, ABC *pABC );
|
---|
281 | HRESULT WINAPI ScriptBreak(const WCHAR *pwcChars, int cChars, const SCRIPT_ANALYSIS *psa, SCRIPT_LOGATTR *psla);
|
---|
282 | HRESULT WINAPI ScriptCacheGetHeight(HDC hdc, SCRIPT_CACHE *psc, LONG *tmHeight);
|
---|
283 | HRESULT WINAPI ScriptCPtoX(int iCP, BOOL fTrailing, int cChars, int cGlyphs, const WORD *pwLogClust, const SCRIPT_VISATTR *psva,
|
---|
284 | const int *piAdvance, const SCRIPT_ANALYSIS *psa, int *piX);
|
---|
285 | HRESULT WINAPI ScriptXtoCP(int iX, int cChars, int cGlyphs, const WORD *pwLogClust, const SCRIPT_VISATTR *psva,
|
---|
286 | const int *piAdvance, const SCRIPT_ANALYSIS *psa, int *piCP, int *piTrailing);
|
---|
287 | HRESULT WINAPI ScriptStringCPtoX(SCRIPT_STRING_ANALYSIS ssa, int icp, BOOL fTrailing, int *pX);
|
---|
288 | HRESULT WINAPI ScriptStringXtoCP(SCRIPT_STRING_ANALYSIS ssa, int iX, int *piCh , int *piTrailing);
|
---|
289 | HRESULT WINAPI ScriptStringGetLogicalWidths(SCRIPT_STRING_ANALYSIS ssa, int *piDx);
|
---|
290 | HRESULT WINAPI ScriptStringGetOrder(SCRIPT_STRING_ANALYSIS ssa, UINT *puOrder);
|
---|
291 | HRESULT WINAPI ScriptStringOut(SCRIPT_STRING_ANALYSIS ssa, int iX, int iY, UINT uOptions, const RECT *prc,
|
---|
292 | int iMinSel, int iMaxSel, BOOL fDisabled);
|
---|
293 | HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UINT fuOptions, const RECT *lprc,
|
---|
294 | const SCRIPT_ANALYSIS *psa, const WCHAR *pwcReserved, int iReserved, const WORD *pwGlyphs,
|
---|
295 | int cGlyphs, const int *piAdvance, const int *piJustify, const GOFFSET *pGoffset);
|
---|
296 | const int* WINAPI ScriptString_pcOutChars(SCRIPT_STRING_ANALYSIS ssa);
|
---|
297 | const SCRIPT_LOGATTR* WINAPI ScriptString_pLogAttr(SCRIPT_STRING_ANALYSIS ssa);
|
---|
298 | const SIZE* WINAPI ScriptString_pSize(SCRIPT_STRING_ANALYSIS ssa);
|
---|
299 |
|
---|
300 | #ifdef __cplusplus
|
---|
301 | } /* extern "C" */
|
---|
302 | #endif
|
---|
303 |
|
---|
304 | #endif /* __USP10_H */
|
---|