blob: 79e27bca0a995719dde3782a9d28e104bb498e0e [file] [log] [blame]
Steven Edwards54508df2005-07-27 11:02:52 +00001/*
2 * Copyright (C) 2005 Steven Edwards
Vijay Kiran Kamujua1eeaf92005-11-28 11:52:55 +01003 * Copyright (C) 2005 Vijay Kiran Kamuju
Steven Edwards54508df2005-07-27 11:02:52 +00004 *
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
Jonathan Ernst360a3f92006-05-18 14:49:52 +020017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Steven Edwards54508df2005-07-27 11:02:52 +000018 */
19
20#ifndef __USP10_H
21#define __USP10_H
22
Marcus Meissnera7c26122005-11-24 19:23:00 +010023#ifdef __cplusplus
24extern "C" {
25#endif
26
Raphael Junqueira8f554aa2005-11-15 12:02:16 +000027/** ScriptStringAnalyse */
28#define SSA_PASSWORD 0x00000001
29#define SSA_TAB 0x00000002
30#define SSA_CLIP 0x00000004
31#define SSA_FIT 0x00000008
32#define SSA_DZWG 0x00000010
33#define SSA_FALLBACK 0x00000020
34#define SSA_BREAK 0x00000040
35#define SSA_GLYPHS 0x00000080
36#define SSA_RTL 0x00000100
37#define SSA_GCP 0x00000200
38#define SSA_HOTKEY 0x00000400
39#define SSA_METAFILE 0x00000800
40#define SSA_LINK 0x00001000
41#define SSA_HIDEHOTKEY 0x00002000
42#define SSA_HOTKEYONLY 0x00002400
43#define SSA_FULLMEASURE 0x04000000
44#define SSA_LPKANSIFALLBACK 0x08000000
45#define SSA_PIDX 0x10000000
46#define SSA_LAYOUTRTL 0x20000000
47#define SSA_DONTGLYPH 0x40000000
48#define SSA_NOKASHIDA 0x80000000
49
50/** StringIsComplex */
51#define SIC_COMPLEX 1
52#define SIC_ASCIIDIGIT 2
53#define SIC_NEUTRAL 4
54
Vijay Kiran Kamujua1eeaf92005-11-28 11:52:55 +010055/** ScriptGetCMap */
56#define SGCM_RTL 0x00000001
57
58/** ScriptApplyDigitSubstitution */
59#define SCRIPT_DIGITSUBSTITUTE_CONTEXT 0
60#define SCRIPT_DIGITSUBSTITUTE_NONE 1
61#define SCRIPT_DIGITSUBSTITUTE_NATIONAL 2
62#define SCRIPT_DIGITSUBSTITUTE_TRADITIONAL 3
63
64#define SCRIPT_UNDEFINED 0
65
66#define USP_E_SCRIPT_NOT_IN_FONT MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,0x200)
67
68typedef enum tag_SCRIPT_JUSTIFY {
69 SCRIPT_JUSTIFY_NONE = 0,
70 SCRIPT_JUSTIFY_ARABIC_BLANK = 1,
71 SCRIPT_JUSTIFY_CHARACTER = 2,
72 SCRIPT_JUSTIFY_RESERVED1 = 3,
73 SCRIPT_JUSTIFY_BLANK = 4,
74 SCRIPT_JUSTIFY_RESERVED2 = 5,
75 SCRIPT_JUSTIFY_RESERVED3 = 6,
76 SCRIPT_JUSTIFY_ARABIC_NORMAL = 7,
77 SCRIPT_JUSTIFY_ARABIC_KASHIDA = 8,
78 SCRIPT_JUSTIFY_ARABIC_ALEF = 9,
79 SCRIPT_JUSTIFY_ARABIC_HA = 10,
80 SCRIPT_JUSTIFY_ARABIC_RA = 11,
81 SCRIPT_JUSTIFY_ARABIC_BA = 12,
82 SCRIPT_JUSTIFY_ARABIC_BARA = 13,
83 SCRIPT_JUSTIFY_ARABIC_SEEN = 14,
84 SCRIPT_JUSTIFY_RESERVED4 = 15,
85} SCRIPT_JUSTIFY;
86
Steven Edwards54508df2005-07-27 11:02:52 +000087typedef struct tag_SCRIPT_CONTROL {
88 DWORD uDefaultLanguage :16;
89 DWORD fContextDigits :1;
90 DWORD fInvertPreBoundDir :1;
91 DWORD fInvertPostBoundDir :1;
92 DWORD fLinkStringBefore :1;
93 DWORD fLinkStringAfter :1;
94 DWORD fNeutralOverride :1;
95 DWORD fNumericOverride :1;
96 DWORD fLegacyBidiClass :1;
97 DWORD fReserved :8;
98} SCRIPT_CONTROL;
99
100typedef struct {
101 DWORD langid :16;
102 DWORD fNumeric :1;
103 DWORD fComplex :1;
104 DWORD fNeedsWordBreaking :1;
105 DWORD fNeedsCaretInfo :1;
106 DWORD bCharSet :8;
107 DWORD fControl :1;
108 DWORD fPrivateUseArea :1;
109 DWORD fNeedsCharacterJustify :1;
110 DWORD fInvalidGlyph :1;
111 DWORD fInvalidLogAttr :1;
112 DWORD fCDM :1;
113 DWORD fAmbiguousCharSet :1;
114 DWORD fClusterSizeVaries :1;
115 DWORD fRejectInvalid :1;
116} SCRIPT_PROPERTIES;
117
118typedef struct tag_SCRIPT_STATE {
119 WORD uBidiLevel :5;
120 WORD fOverrideDirection :1;
121 WORD fInhibitSymSwap :1;
122 WORD fCharShape :1;
123 WORD fDigitSubstitute :1;
124 WORD fInhibitLigate :1;
125 WORD fDisplayZWG :1;
126 WORD fArabicNumContext :1;
127 WORD fGcpClusters :1;
128 WORD fReserved :1;
129 WORD fEngineReserved :2;
130} SCRIPT_STATE;
131
132typedef struct tag_SCRIPT_ANALYSIS {
133 WORD eScript :10;
134 WORD fRTL :1;
135 WORD fLayoutRTL :1;
136 WORD fLinkBefore :1;
137 WORD fLinkAfter :1;
138 WORD fLogicalOrder :1;
139 WORD fNoGlyphIndex :1;
140 SCRIPT_STATE s;
141} SCRIPT_ANALYSIS;
142
143typedef struct tag_SCRIPT_ITEM {
144 int iCharPos;
145 SCRIPT_ANALYSIS a;
146} SCRIPT_ITEM;
147
148typedef struct tag_SCRIPT_DIGITSUBSTITUTE {
149 DWORD NationalDigitLanguage :16;
150 DWORD TraditionalDigitLanguage :16;
151 DWORD DigitSubstitute :8;
152 DWORD dwReserved;
153} SCRIPT_DIGITSUBSTITUTE;
154
Oliver Stieberb6711802005-08-01 09:18:53 +0000155typedef struct tag_SCRIPT_FONTPROPERTIES {
156 int cBytes;
157 WORD wgBlank;
158 WORD wgDefault;
159 WORD wgInvalid;
160 WORD wgKashida;
161 int iKashidaWidth;
162} SCRIPT_FONTPROPERTIES;
163
Raphael Junqueira8f554aa2005-11-15 12:02:16 +0000164typedef struct tag_SCRIPT_TABDEF {
165 int cTabStops;
166 int iScale;
167 int *pTabStops;
168 int iTabOrigin;
169} SCRIPT_TABDEF;
170
Vijay Kiran Kamujua1eeaf92005-11-28 11:52:55 +0100171typedef struct tag_SCRIPT_VISATTR {
172 WORD uJustification :4;
173 WORD fClusterStart :1;
174 WORD fDiacritic :1;
175 WORD fZeroWidth :1;
176 WORD fReserved :1;
177 WORD fShapeReserved :8;
178} SCRIPT_VISATTR;
179
180typedef struct tag_SCRIPT_LOGATTR {
181 BYTE fSoftBreak :1;
182 BYTE fWhiteSpace :1;
183 BYTE fCharStop :1;
184 BYTE fWordStop :1;
185 BYTE fInvalid :1;
186 BYTE fReserved :3;
187} SCRIPT_LOGATTR;
188
Oliver Stieberb6711802005-08-01 09:18:53 +0000189typedef void *SCRIPT_CACHE;
Raphael Junqueira8f554aa2005-11-15 12:02:16 +0000190typedef void *SCRIPT_STRING_ANALYSIS;
Oliver Stieberb6711802005-08-01 09:18:53 +0000191
Vijay Kiran Kamujua1eeaf92005-11-28 11:52:55 +0100192#ifndef LSDEFS_DEFINED
193typedef struct tagGOFFSET {
194 LONG du;
195 LONG dv;
196} GOFFSET;
197#endif
Steven Edwards54508df2005-07-27 11:02:52 +0000198
Vijay Kiran Kamujua1eeaf92005-11-28 11:52:55 +0100199/* Function Declarations */
200
Steven Edwards54508df2005-07-27 11:02:52 +0000201HRESULT WINAPI ScriptApplyDigitSubstitution(const SCRIPT_DIGITSUBSTITUTE* psds,
202 SCRIPT_CONTROL* psc, SCRIPT_STATE* pss);
Vijay Kiran Kamujua1eeaf92005-11-28 11:52:55 +0100203HRESULT WINAPI ScriptApplyLogicalWidth(const int *piDx, int cChars, int cGlyphs, const WORD *pwLogClust,
204 const SCRIPT_VISATTR *psva, const int *piAdvance,
205 const SCRIPT_ANALYSIS *psa, ABC *pABC, int *piJustify);
206HRESULT WINAPI ScriptRecordDigitSubstitution(LCID Locale, SCRIPT_DIGITSUBSTITUTE *psds);
Steven Edwards54508df2005-07-27 11:02:52 +0000207HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItems,
208 const SCRIPT_CONTROL *psControl, const SCRIPT_STATE *psState,
209 SCRIPT_ITEM *pItems, int *pcItems);
Vijay Kiran Kamujua1eeaf92005-11-28 11:52:55 +0100210HRESULT WINAPI ScriptGetCMap(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars, int cChars,
211 DWORD dwFlags, WORD *pwOutGlyphs);
Oliver Stieberb6711802005-08-01 09:18:53 +0000212HRESULT WINAPI ScriptGetFontProperties(HDC hdc, SCRIPT_CACHE *psc, SCRIPT_FONTPROPERTIES *sfp);
Vijay Kiran Kamujua1eeaf92005-11-28 11:52:55 +0100213HRESULT WINAPI ScriptGetGlyphABCWidth(HDC hdc, SCRIPT_CACHE *psc, WORD wGlyph, ABC *pABC);
214HRESULT WINAPI ScriptGetLogicalWidths(const SCRIPT_ANALYSIS *psa, int cChars, int cGlyphs,
215 const int *piGlyphWidth, const WORD *pwLogClust,
216 const SCRIPT_VISATTR *psva, int *piDx);
217HRESULT WINAPI ScriptGetProperties(const SCRIPT_PROPERTIES ***ppSp, int *piNumScripts);
Raphael Junqueira8f554aa2005-11-15 12:02:16 +0000218HRESULT WINAPI ScriptStringAnalyse(HDC hdc,
219 const void *pString,
220 int cString,
221 int cGlyphs,
222 int iCharset,
223 DWORD dwFlags,
224 int iReqWidth,
225 SCRIPT_CONTROL *psControl,
226 SCRIPT_STATE *psState,
227 const int *piDx,
228 SCRIPT_TABDEF *pTabdef,
229 const BYTE *pbInClass,
230 SCRIPT_STRING_ANALYSIS *pssa);
Vijay Kiran Kamujua1eeaf92005-11-28 11:52:55 +0100231HRESULT WINAPI ScriptStringValidate(SCRIPT_STRING_ANALYSIS ssa);
Raphael Junqueira8f554aa2005-11-15 12:02:16 +0000232HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *pssa);
Vijay Kiran Kamujua1eeaf92005-11-28 11:52:55 +0100233HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc);
Raphael Junqueira8f554aa2005-11-15 12:02:16 +0000234HRESULT WINAPI ScriptIsComplex(const WCHAR* pwcInChars, int cInChars, DWORD dwFlags);
Vijay Kiran Kamujua1eeaf92005-11-28 11:52:55 +0100235HRESULT WINAPI ScriptJustify(const SCRIPT_VISATTR *psva, const int *piAdvance, int cGlyphs,
236 int iDx, int iMinKashida, int *piJustify);
237HRESULT WINAPI ScriptLayout(int cRuns, const BYTE *pbLevel, int *piVisualToLogical, int *piLogicalToVisual);
238HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars, int cChars, int cMaxGlyphs,
239 SCRIPT_ANALYSIS *psa, WORD *pwOutGlyphs, WORD *pwLogClust, SCRIPT_VISATTR *psva, int *pcGlyphs);
240HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs, int cGlyphs, const SCRIPT_VISATTR *psva,
241 SCRIPT_ANALYSIS *psa, int *piAdvance, GOFFSET *pGoffset, ABC *pABC );
242HRESULT WINAPI ScriptBreak(const WCHAR *pwcChars, int cChars, const SCRIPT_ANALYSIS *psa, SCRIPT_LOGATTR *psla);
243HRESULT WINAPI ScriptCacheGetHeight(HDC hdc, SCRIPT_CACHE *psc, long *tmHeight);
244HRESULT WINAPI ScriptCPtoX(int iCP, BOOL fTrailing, int cChars, int cGlyphs, const WORD *pwLogClust, const SCRIPT_VISATTR *psva,
245 const int *piAdvance, const SCRIPT_ANALYSIS *psa, int *piX);
246HRESULT WINAPI ScriptXtoCP(int iX, int cChars, int cGlyphs, const WORD *pwLogClust, const SCRIPT_VISATTR *psva,
247 const int *piAdvance, const SCRIPT_ANALYSIS *psa, int *piCP, int *piTrailing);
248HRESULT WINAPI ScriptStringCPtoX(SCRIPT_STRING_ANALYSIS ssa, int icp, BOOL fTrailing, int *pX);
249HRESULT WINAPI ScriptStringXtoCP(SCRIPT_STRING_ANALYSIS ssa, int iX, int *piCh , int *piTrailing);
250HRESULT WINAPI ScriptStringGetLogicalWidths(SCRIPT_STRING_ANALYSIS ssa, int *piDx);
251HRESULT WINAPI ScriptStringGetOrder(SCRIPT_STRING_ANALYSIS ssa, UINT *puOrder);
252HRESULT WINAPI ScriptStringOut(SCRIPT_STRING_ANALYSIS ssa, int iX, int iY, UINT uOptions, const RECT *prc,
253 int iMinSel, int iMaxSel, BOOL fDisabled);
254HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UINT fuOptions, const RECT *lprc,
255 const SCRIPT_ANALYSIS *psa, const WCHAR *pwcReserved, int iReserved, const WORD *pwGlyphs,
256 int cGlyphs, const int *piAdvance, const int *piJustify, const GOFFSET *pGoffset);
257const int* WINAPI ScriptString_pcOutChars(SCRIPT_STRING_ANALYSIS ssa);
258const SCRIPT_LOGATTR* WINAPI ScriptString_pLogAttr(SCRIPT_STRING_ANALYSIS ssa);
259const SIZE* WINAPI ScriptString_pSize(SCRIPT_STRING_ANALYSIS ssa);
Steven Edwards54508df2005-07-27 11:02:52 +0000260
Marcus Meissnera7c26122005-11-24 19:23:00 +0100261#ifdef __cplusplus
262} /* extern "C" */
263#endif
264
Steven Edwards54508df2005-07-27 11:02:52 +0000265#endif /* __USP10_H */