OSDN Git Service

Redo the filters based on assumptions discussed in mingw-dvlpr list.
[mingw/mingw-org-wsl.git] / include / usp10.h
1 /**
2  * @file usp10.h
3  * @copy 2012 MinGW.org project
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  * 
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  * 
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 #ifndef _USP10_H
25 #define _USP10_H
26 #pragma GCC system_header
27 #include <_mingw.h>
28
29 #include <windows.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #pragma pack(push,1)
36
37 #define SCRIPT_UNDEFINED 0
38 #define USP_E_SCRIPT_NOT_IN_FONT  MAKE_HRESULT(SEVERITY_ERROR,FACILITY_ITF,0x200)
39 #define SGCM_RTL        0x00000001
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 #define SIC_COMPLEX     1
62 #define SIC_ASCIIDIGIT  2     
63 #define SIC_NEUTRAL     4
64 #define SCRIPT_DIGITSUBSTITUTE_CONTEXT  0
65 #define SCRIPT_DIGITSUBSTITUTE_NONE     1
66 #define SCRIPT_DIGITSUBSTITUTE_NATIONAL 2
67 #define SCRIPT_DIGITSUBSTITUTE_TRADITIONAL 3
68   
69 typedef enum tag_SCRIPT_JUSTIFY {
70   SCRIPT_JUSTIFY_NONE = 0, 
71   SCRIPT_JUSTIFY_ARABIC_BLANK = 1, 
72   SCRIPT_JUSTIFY_CHARACTER = 2, 
73   SCRIPT_JUSTIFY_RESERVED1 = 3, 
74   SCRIPT_JUSTIFY_BLANK = 4, 
75   SCRIPT_JUSTIFY_RESERVED2 = 5, 
76   SCRIPT_JUSTIFY_RESERVED3 = 6, 
77   SCRIPT_JUSTIFY_ARABIC_NORMAL = 7, 
78   SCRIPT_JUSTIFY_ARABIC_KASHIDA = 8, 
79   SCRIPT_JUSTIFY_ARABIC_ALEF = 9, 
80   SCRIPT_JUSTIFY_ARABIC_HA = 10, 
81   SCRIPT_JUSTIFY_ARABIC_RA = 11, 
82   SCRIPT_JUSTIFY_ARABIC_BA = 12, 
83   SCRIPT_JUSTIFY_ARABIC_BARA = 13, 
84   SCRIPT_JUSTIFY_ARABIC_SEEN = 14, 
85   SCRIPT_JUSTIFY_ARABIC_SEEN_M = 15 
86 } SCRIPT_JUSTIFY;
87   
88 typedef struct tagGOFFSET {
89   LONG  du;
90   LONG  dv;
91 } GOFFSET;
92 typedef ULONG OPENTYPE_TAG;
93 typedef struct opentype_feature_record{
94   OPENTYPE_TAG    tagFeature;
95   LONG            lParameter;
96 } OPENTYPE_FEATURE_RECORD;
97 typedef struct tag_SCRIPT_STATE { 
98   WORD uBidiLevel :5; 
99   WORD fOverrideDirection :1; 
100   WORD fInhibitSymSwap :1; 
101   WORD fCharShape :1; 
102   WORD fDigitSubstitute :1; 
103   WORD fInhibitLigate :1; 
104   WORD fDisplayZWG :1; 
105   WORD fArabicNumContext :1; 
106   WORD fGcpClusters :1; 
107   WORD fReserved :1; 
108   WORD fEngineReserved :2; 
109 } SCRIPT_STATE;
110 typedef struct tag_SCRIPT_ANALYSIS {
111   WORD eScript       :10; 
112   WORD fRTL          :1; 
113   WORD fLayoutRTL    :1; 
114   WORD fLinkBefore   :1; 
115   WORD fLinkAfter    :1; 
116   WORD fLogicalOrder :1; 
117   WORD fNoGlyphIndex :1; 
118   SCRIPT_STATE s ; 
119 } SCRIPT_ANALYSIS;
120 typedef void *SCRIPT_CACHE;
121 typedef struct script_charprop {
122     WORD           fCanGlyphAlone : 1;
123     WORD           reserved       : 15;
124 } SCRIPT_CHARPROP;
125 typedef struct tag_SCRIPT_CONTROL { 
126   DWORD uDefaultLanguage :16; 
127   DWORD fContextDigits :1; 
128   DWORD fInvertPreBoundDir :1; 
129   DWORD fInvertPostBoundDir :1; 
130   DWORD fLinkStringBefore :1; 
131   DWORD fLinkStringAfter :1; 
132   DWORD fNeutralOverride :1; 
133   DWORD fNumericOverride :1; 
134   DWORD fLegacyBidiClass :1; 
135   DWORD fReserved :8; 
136 } SCRIPT_CONTROL;
137 typedef struct tag_SCRIPT_DIGITSUBSTITUTE {
138   DWORD NationalDigitLanguage    : 16;
139   DWORD TraditionalDigitLanguage : 16;
140   DWORD DigitSubstitute          :8;
141   DWORD dwReserved;
142 } SCRIPT_DIGITSUBSTITUTE;
143 typedef struct {
144   int   cBytes; 
145   WORD  wgBlank; 
146   WORD  wgDefault; 
147   WORD  wgInvalid; 
148   WORD  wgKashida; 
149   int   iKashidaWidth; 
150 } SCRIPT_FONTPROPERTIES;
151 typedef struct tag_SCRIPT_VISATTR { 
152   WORD uJustification :4; 
153   WORD fClusterStart :1; 
154   WORD fDiacritic :1; 
155   WORD fZeroWidth :1; 
156   WORD fReserved :1; 
157   WORD fShapeReserved :8; 
158 } SCRIPT_VISATTR;
159 typedef struct script_glyphprop { 
160     SCRIPT_VISATTR sva;
161     WORD reserved;
162 } SCRIPT_GLYPHPROP;
163 typedef struct tag_SCRIPT_ITEM { 
164   int iCharPos; 
165   SCRIPT_ANALYSIS a; 
166 } SCRIPT_ITEM;
167 typedef struct tag_SCRIPT_LOGATTR { 
168   BYTE fSoftBreak :1; 
169   BYTE fWhiteSpace :1; 
170   BYTE fCharStop :1; 
171   BYTE fWordStop :1; 
172   BYTE fInvalid :1; 
173   BYTE fReserved :3; 
174 } SCRIPT_LOGATTR;
175 typedef struct {
176   DWORD   langid              :16;  
177   DWORD   fNumeric            :1;
178   DWORD   fComplex            :1;
179   DWORD   fNeedsWordBreaking  :1;   
180   DWORD   fNeedsCaretInfo     :1;
181   DWORD   bCharSet            :8;   
182   DWORD   fControl            :1;   
183   DWORD   fPrivateUseArea     :1;   
184   DWORD   fNeedsCharacterJustify :1;
185   DWORD   fInvalidGlyph       :1;
186   DWORD   fInvalidLogAttr     :1;
187   DWORD   fCDM                :1;
188   DWORD   fAmbiguousCharSet   :1;
189   DWORD   fClusterSizeVaries  :1;
190   DWORD   fRejectInvalid      :1;
191 } SCRIPT_PROPERTIES;
192 typedef void *SCRIPT_STRING_ANALYSIS;
193 typedef struct tag_SCRIPT_TABDEF {
194   int cTabStops;
195   int iScale;
196   int *pTabStops;
197   int iTabOrigin;
198 } SCRIPT_TABDEF;
199 typedef struct textrange_properties{
200     OPENTYPE_FEATURE_RECORD*  potfRecords;
201     int                       cotfRecords;
202 } TEXTRANGE_PROPERTIES;
203
204
205 HRESULT WINAPI ScriptApplyDigitSubstitution(const SCRIPT_DIGITSUBSTITUTE*,SCRIPT_CONTROL*,SCRIPT_STATE*);
206 HRESULT WINAPI ScriptApplyLogicalWidth(const int *,int,int,const WORD *,const SCRIPT_VISATTR *,const int *,const SCRIPT_ANALYSIS *,ABC *,int *);
207 HRESULT WINAPI ScriptBreak(const WCHAR *,int,const SCRIPT_ANALYSIS *,SCRIPT_LOGATTR *);
208 HRESULT WINAPI ScriptCacheGetHeight(HDC,SCRIPT_CACHE *,long *);
209 HRESULT WINAPI ScriptCPtoX(int,BOOL,int,int,const WORD *,const SCRIPT_VISATTR *,const int *,const SCRIPT_ANALYSIS *,int *);
210 HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *);
211 HRESULT WINAPI ScriptGetCMap(HDC,SCRIPT_CACHE *,const WCHAR*,int,DWORD,WORD *);
212 HRESULT WINAPI ScriptGetFontAlternateGlyphs(HDC,SCRIPT_CACHE*,SCRIPT_ANALYSIS*,OPENTYPE_TAG,OPENTYPE_TAG,OPENTYPE_TAG,WORD,int,WORD*,int*);
213 HRESULT WINAPI ScriptGetFontFeatureTags(HDC,SCRIPT_CACHE*,SCRIPT_ANALYSIS*,OPENTYPE_TAG,OPENTYPE_TAG,int,OPENTYPE_TAG*,int*);
214 HRESULT WINAPI ScriptGetFontLanguageTags(HDC,SCRIPT_CACHE*,SCRIPT_ANALYSIS*,OPENTYPE_TAG,int,OPENTYPE_TAG*,int*);
215 HRESULT WINAPI ScriptGetFontProperties(HDC,SCRIPT_CACHE *,SCRIPT_FONTPROPERTIES *);
216 HRESULT WINAPI ScriptGetFontScriptTags(HDC,SCRIPT_CACHE*,SCRIPT_ANALYSIS*,int,OPENTYPE_TAG*,int*);
217 HRESULT WINAPI ScriptGetGlyphABCWidth(HDC,SCRIPT_CACHE *,WORD,ABC *);
218 HRESULT WINAPI ScriptGetLogicalWidths(const SCRIPT_ANALYSIS *,int,int,const int *,const WORD *,const SCRIPT_VISATTR *,int *);
219 HRESULT WINAPI ScriptGetProperties(const SCRIPT_PROPERTIES ***,int *);
220 HRESULT WINAPI ScriptIsComplex(const WCHAR *,int,DWORD);
221 HRESULT WINAPI ScriptItemize(const WCHAR *,int,int,const SCRIPT_CONTROL *,const SCRIPT_STATE *,SCRIPT_ITEM *,int *);
222 HRESULT WINAPI ScriptItemizeOpenType(const WCHAR*,int,int,const SCRIPT_CONTROL*,const SCRIPT_STATE*,SCRIPT_ITEM*,OPENTYPE_TAG*,int*);
223 HRESULT WINAPI ScriptJustify(const SCRIPT_VISATTR *,const int *,int,int,int,int *);
224 HRESULT WINAPI ScriptLayout(int,const BYTE *,int *,int *);
225 HRESULT WINAPI ScriptPlace(HDC,SCRIPT_CACHE *,const WORD *,int,const SCRIPT_VISATTR *,SCRIPT_ANALYSIS *,int *,GOFFSET *,ABC *);
226 HRESULT WINAPI ScriptPlaceOpenType(HDC,SCRIPT_CACHE*,SCRIPT_ANALYSIS*,OPENTYPE_TAG,OPENTYPE_TAG,int*,TEXTRANGE_PROPERTIES**,int,const WCHAR*,const WORD*,const SCRIPT_CHARPROP*,int,const WORD*,const SCRIPT_GLYPHPROP*,int,int*,GOFFSET*,ABC*);
227 HRESULT WINAPI ScriptPositionSingleGlyph(HDC,SCRIPT_CACHE*,SCRIPT_ANALYSIS*,OPENTYPE_TAG,OPENTYPE_TAG,OPENTYPE_TAG,LONG,WORD,int,GOFFSET,int*,GOFFSET*);
228 HRESULT WINAPI ScriptRecordDigitSubstitution(LCID,SCRIPT_DIGITSUBSTITUTE *);
229 HRESULT WINAPI ScriptShape(HDC,SCRIPT_CACHE *,const WCHAR *,int,int,SCRIPT_ANALYSIS *,WORD *,WORD *,SCRIPT_VISATTR *,int *);
230 HRESULT WINAPI ScriptShapeOpenType(HDC,SCRIPT_CACHE*,SCRIPT_ANALYSIS*,OPENTYPE_TAG,OPENTYPE_TAG,int*,TEXTRANGE_PROPERTIES**,int,const WCHAR*,int,int,WORD*,SCRIPT_CHARPROP*,WORD*,SCRIPT_GLYPHPROP*,int*);
231 HRESULT WINAPI ScriptStringAnalyse(HDC,const void *,int,int,int,DWORD,int,SCRIPT_CONTROL *,SCRIPT_STATE *,const int *,SCRIPT_TABDEF *,const BYTE *,SCRIPT_STRING_ANALYSIS *);
232 HRESULT WINAPI ScriptStringCPtoX(SCRIPT_STRING_ANALYSIS,int,BOOL,int *);
233 HRESULT WINAPI ScriptStringFree(SCRIPT_STRING_ANALYSIS *);
234 HRESULT WINAPI ScriptStringGetLogicalWidths(SCRIPT_STRING_ANALYSIS,int *);
235 HRESULT WINAPI ScriptStringGetOrder(SCRIPT_STRING_ANALYSIS,UINT *);
236 HRESULT WINAPI ScriptStringOut(SCRIPT_STRING_ANALYSIS,int,int,UINT,const RECT *,int,int,BOOL);
237 const int*WINAPI ScriptString_pcOutChars(SCRIPT_STRING_ANALYSIS);
238 const SCRIPT_LOGATTR* WINAPI ScriptString_pLogAttr(SCRIPT_STRING_ANALYSIS);
239 const SIZE* WINAPI ScriptString_pSize(SCRIPT_STRING_ANALYSIS);
240 HRESULT WINAPI ScriptStringValidate(SCRIPT_STRING_ANALYSIS);
241 HRESULT WINAPI ScriptStringXtoCP(SCRIPT_STRING_ANALYSIS,int,int *,int *);
242 HRESULT WINAPI ScriptSubstituteSingleGlyph(HDC,SCRIPT_CACHE*,SCRIPT_ANALYSIS*,OPENTYPE_TAG,OPENTYPE_TAG,OPENTYPE_TAG,LONG,WORD,WORD*);
243 HRESULT WINAPI ScriptTextOut(const HDC,SCRIPT_CACHE *,int,int,UINT,const RECT *,const SCRIPT_ANALYSIS *,const WCHAR *,int,const WORD *,int,const int *,const int *,const GOFFSET *);
244 HRESULT WINAPI ScriptXtoCP(int,int,int,const WORD *,const SCRIPT_VISATTR *,const int *,const SCRIPT_ANALYSIS *,int *,int *);
245
246   
247 #pragma pack(pop)
248
249 #ifdef __cplusplus
250 }
251 #endif
252
253 #endif /* ndef _USP10_H_ */