Pass the breakExtra value in the ExtTextOut driver call, since there
[wine] / dlls / gdi / gdi_private.h
1 /*
2  * GDI definitions
3  *
4  * Copyright 1993 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WINE_GDI_PRIVATE_H
22 #define __WINE_GDI_PRIVATE_H
23
24 /* Metafile defines */
25 #define META_EOF 0x0000
26 /* values of mtType in METAHEADER.  Note however that the disk image of a disk
27    based metafile has mtType == 1 */
28 #define METAFILE_MEMORY 1
29 #define METAFILE_DISK   2
30
31 struct gdi_obj_funcs
32 {
33     HGDIOBJ (*pSelectObject)( HGDIOBJ handle, void *obj, HDC hdc );
34     INT     (*pGetObject16)( HGDIOBJ handle, void *obj, INT count, LPVOID buffer );
35     INT     (*pGetObjectA)( HGDIOBJ handle, void *obj, INT count, LPVOID buffer );
36     INT     (*pGetObjectW)( HGDIOBJ handle, void *obj, INT count, LPVOID buffer );
37     BOOL    (*pUnrealizeObject)( HGDIOBJ handle, void *obj );
38     BOOL    (*pDeleteObject)( HGDIOBJ handle, void *obj );
39 };
40
41 struct hdc_list
42 {
43     HDC hdc;
44     struct hdc_list *next;
45 };
46
47 /* Device functions for the Wine driver interface */
48
49 typedef struct tagDC_FUNCS
50 {
51     INT      (*pAbortDoc)(PHYSDEV);
52     BOOL     (*pAbortPath)(PHYSDEV);
53     BOOL     (*pAngleArc)(PHYSDEV,INT,INT,DWORD,FLOAT,FLOAT);
54     BOOL     (*pArc)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
55     BOOL     (*pArcTo)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
56     BOOL     (*pBeginPath)(PHYSDEV);
57     BOOL     (*pBitBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,DWORD);
58     INT      (*pChoosePixelFormat)(PHYSDEV,const PIXELFORMATDESCRIPTOR *);
59     BOOL     (*pChord)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
60     BOOL     (*pCloseFigure)(PHYSDEV);
61     BOOL     (*pCreateBitmap)(PHYSDEV,HBITMAP);
62     BOOL     (*pCreateDC)(DC *,PHYSDEV *,LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODEW*);
63     HBITMAP  (*pCreateDIBSection)(PHYSDEV,BITMAPINFO *,UINT,LPVOID *,HANDLE,DWORD,DWORD);
64     BOOL     (*pDeleteBitmap)(HBITMAP);
65     BOOL     (*pDeleteDC)(PHYSDEV);
66     BOOL     (*pDeleteObject)(PHYSDEV,HGDIOBJ);
67     INT      (*pDescribePixelFormat)(PHYSDEV,INT,UINT,PIXELFORMATDESCRIPTOR *);
68     DWORD    (*pDeviceCapabilities)(LPSTR,LPCSTR,LPCSTR,WORD,LPSTR,LPDEVMODEA);
69     BOOL     (*pEllipse)(PHYSDEV,INT,INT,INT,INT);
70     INT      (*pEndDoc)(PHYSDEV);
71     INT      (*pEndPage)(PHYSDEV);
72     BOOL     (*pEndPath)(PHYSDEV);
73     BOOL     (*pEnumDeviceFonts)(PHYSDEV,LPLOGFONTW,FONTENUMPROCW,LPARAM);
74     INT      (*pExcludeClipRect)(PHYSDEV,INT,INT,INT,INT);
75     INT      (*pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD);
76     INT      (*pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID);
77     BOOL     (*pExtFloodFill)(PHYSDEV,INT,INT,COLORREF,UINT);
78     INT      (*pExtSelectClipRgn)(PHYSDEV,HRGN,INT);
79     BOOL     (*pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*,INT);
80     BOOL     (*pFillPath)(PHYSDEV);
81     BOOL     (*pFillRgn)(PHYSDEV,HRGN,HBRUSH);
82     BOOL     (*pFlattenPath)(PHYSDEV);
83     BOOL     (*pFrameRgn)(PHYSDEV,HRGN,HBRUSH,INT,INT);
84     BOOL     (*pGdiComment)(PHYSDEV,UINT,CONST BYTE*);
85     LONG     (*pGetBitmapBits)(HBITMAP,void*,LONG);
86     BOOL     (*pGetCharWidth)(PHYSDEV,UINT,UINT,LPINT);
87     BOOL     (*pGetDCOrgEx)(PHYSDEV,LPPOINT);
88     UINT     (*pGetDIBColorTable)(PHYSDEV,UINT,UINT,RGBQUAD*);
89     INT      (*pGetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPVOID,BITMAPINFO*,UINT);
90     INT      (*pGetDeviceCaps)(PHYSDEV,INT);
91     BOOL     (*pGetDeviceGammaRamp)(PHYSDEV,LPVOID);
92     COLORREF (*pGetNearestColor)(PHYSDEV,COLORREF);
93     COLORREF (*pGetPixel)(PHYSDEV,INT,INT);
94     INT      (*pGetPixelFormat)(PHYSDEV);
95     UINT     (*pGetSystemPaletteEntries)(PHYSDEV,UINT,UINT,LPPALETTEENTRY);
96     BOOL     (*pGetTextExtentPoint)(PHYSDEV,LPCWSTR,INT,LPSIZE);
97     BOOL     (*pGetTextMetrics)(PHYSDEV,TEXTMETRICW*);
98     INT      (*pIntersectClipRect)(PHYSDEV,INT,INT,INT,INT);
99     BOOL     (*pInvertRgn)(PHYSDEV,HRGN);
100     BOOL     (*pLineTo)(PHYSDEV,INT,INT);
101     BOOL     (*pModifyWorldTransform)(PHYSDEV,const XFORM*,INT);
102     BOOL     (*pMoveTo)(PHYSDEV,INT,INT);
103     INT      (*pOffsetClipRgn)(PHYSDEV,INT,INT);
104     INT      (*pOffsetViewportOrg)(PHYSDEV,INT,INT);
105     INT      (*pOffsetWindowOrg)(PHYSDEV,INT,INT);
106     BOOL     (*pPaintRgn)(PHYSDEV,HRGN);
107     BOOL     (*pPatBlt)(PHYSDEV,INT,INT,INT,INT,DWORD);
108     BOOL     (*pPie)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
109     BOOL     (*pPolyBezier)(PHYSDEV,const POINT*,DWORD);
110     BOOL     (*pPolyBezierTo)(PHYSDEV,const POINT*,DWORD);
111     BOOL     (*pPolyDraw)(PHYSDEV,const POINT*,const BYTE *,DWORD);
112     BOOL     (*pPolyPolygon)(PHYSDEV,const POINT*,const INT*,UINT);
113     BOOL     (*pPolyPolyline)(PHYSDEV,const POINT*,const DWORD*,DWORD);
114     BOOL     (*pPolygon)(PHYSDEV,const POINT*,INT);
115     BOOL     (*pPolyline)(PHYSDEV,const POINT*,INT);
116     BOOL     (*pPolylineTo)(PHYSDEV,const POINT*,INT);
117     UINT     (*pRealizeDefaultPalette)(PHYSDEV);
118     UINT     (*pRealizePalette)(PHYSDEV,HPALETTE,BOOL);
119     BOOL     (*pRectangle)(PHYSDEV,INT,INT,INT,INT);
120     HDC      (*pResetDC)(PHYSDEV,const DEVMODEW*);
121     BOOL     (*pRestoreDC)(PHYSDEV,INT);
122     BOOL     (*pRoundRect)(PHYSDEV,INT,INT,INT,INT,INT,INT);
123     INT      (*pSaveDC)(PHYSDEV);
124     INT      (*pScaleViewportExt)(PHYSDEV,INT,INT,INT,INT);
125     INT      (*pScaleWindowExt)(PHYSDEV,INT,INT,INT,INT);
126     HBITMAP  (*pSelectBitmap)(PHYSDEV,HBITMAP);
127     HBRUSH   (*pSelectBrush)(PHYSDEV,HBRUSH);
128     BOOL     (*pSelectClipPath)(PHYSDEV,INT);
129     HFONT    (*pSelectFont)(PHYSDEV,HFONT);
130     HPALETTE (*pSelectPalette)(PHYSDEV,HPALETTE,BOOL);
131     HPEN     (*pSelectPen)(PHYSDEV,HPEN);
132     INT      (*pSetArcDirection)(PHYSDEV,INT);
133     LONG     (*pSetBitmapBits)(HBITMAP,const void*,LONG);
134     COLORREF (*pSetBkColor)(PHYSDEV,COLORREF);
135     INT      (*pSetBkMode)(PHYSDEV,INT);
136     COLORREF (*pSetDCBrushColor)(PHYSDEV, COLORREF);
137     DWORD    (*pSetDCOrg)(PHYSDEV,INT,INT);
138     COLORREF (*pSetDCPenColor)(PHYSDEV, COLORREF);
139     UINT     (*pSetDIBColorTable)(PHYSDEV,UINT,UINT,const RGBQUAD*);
140     INT      (*pSetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT);
141     INT      (*pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID,
142                                    const BITMAPINFO*,UINT);
143     VOID     (*pSetDeviceClipping)(PHYSDEV,HRGN,HRGN);
144     BOOL     (*pSetDeviceGammaRamp)(PHYSDEV,LPVOID);
145     INT      (*pSetMapMode)(PHYSDEV,INT);
146     DWORD    (*pSetMapperFlags)(PHYSDEV,DWORD);
147     COLORREF (*pSetPixel)(PHYSDEV,INT,INT,COLORREF);
148     BOOL     (*pSetPixelFormat)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR *);
149     INT      (*pSetPolyFillMode)(PHYSDEV,INT);
150     INT      (*pSetROP2)(PHYSDEV,INT);
151     INT      (*pSetRelAbs)(PHYSDEV,INT);
152     INT      (*pSetStretchBltMode)(PHYSDEV,INT);
153     UINT     (*pSetTextAlign)(PHYSDEV,UINT);
154     INT      (*pSetTextCharacterExtra)(PHYSDEV,INT);
155     DWORD    (*pSetTextColor)(PHYSDEV,DWORD);
156     INT      (*pSetTextJustification)(PHYSDEV,INT,INT);
157     INT      (*pSetViewportExt)(PHYSDEV,INT,INT);
158     INT      (*pSetViewportOrg)(PHYSDEV,INT,INT);
159     INT      (*pSetWindowExt)(PHYSDEV,INT,INT);
160     INT      (*pSetWindowOrg)(PHYSDEV,INT,INT);
161     BOOL     (*pSetWorldTransform)(PHYSDEV,const XFORM*);
162     INT      (*pStartDoc)(PHYSDEV,const DOCINFOA*);
163     INT      (*pStartPage)(PHYSDEV);
164     BOOL     (*pStretchBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,DWORD);
165     INT      (*pStretchDIBits)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT,const void *,
166                                const BITMAPINFO*,UINT,DWORD);
167     BOOL     (*pStrokeAndFillPath)(PHYSDEV);
168     BOOL     (*pStrokePath)(PHYSDEV);
169     BOOL     (*pSwapBuffers)(PHYSDEV);
170     BOOL     (*pWidenPath)(PHYSDEV);
171 } DC_FUNCTIONS;
172
173   /* DC flags */
174 #define DC_SAVED         0x0002   /* It is a saved DC */
175 #define DC_DIRTY         0x0004   /* hVisRgn has to be updated */
176 #define DC_BOUNDS_ENABLE 0x0008   /* Bounding rectangle tracking is enabled */
177 #define DC_BOUNDS_SET    0x0010   /* Bounding rectangle has been set */
178
179 /* Certain functions will do no further processing if the driver returns this.
180    Used by mfdrv for example. */
181 #define GDI_NO_MORE_WORK 2
182
183 /* bidi.c */
184
185 /* Wine_GCPW Flags */
186 /* Directionality -
187  * LOOSE means that the paragraph dir is only set if there is no strong character.
188  * FORCE means override the characters in the paragraph.
189  */
190 #define WINE_GCPW_FORCE_LTR 0
191 #define WINE_GCPW_FORCE_RTL 1
192 #define WINE_GCPW_LOOSE_LTR 2
193 #define WINE_GCPW_LOOSE_RTL 3
194 #define WINE_GCPW_DIR_MASK 3
195 extern BOOL BIDI_Reorder( LPCWSTR lpString, INT uCount, DWORD dwFlags, DWORD dwWineGCP_Flags,
196                           LPWSTR lpOutString, INT uCountOut, UINT *lpOrder );
197 extern BOOL BidiAvail;
198
199 /* clipping.c */
200 extern void CLIPPING_UpdateGCRegion( DC * dc );
201
202 /* dc.c */
203 extern DC * DC_AllocDC( const DC_FUNCTIONS *funcs, WORD magic );
204 extern DC * DC_GetDCUpdate( HDC hdc );
205 extern DC * DC_GetDCPtr( HDC hdc );
206 extern void DC_InitDC( DC * dc );
207 extern void DC_UpdateXforms( DC * dc );
208
209 /* driver.c */
210 extern const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name );
211 extern const DC_FUNCTIONS *DRIVER_get_driver( const DC_FUNCTIONS *funcs );
212 extern void DRIVER_release_driver( const DC_FUNCTIONS *funcs );
213 extern BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size );
214
215 /* enhmetafile.c */
216 extern HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk );
217
218 /* freetype.c */
219 extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID);
220 extern GdiFont WineEngCreateFontInstance(DC*, HFONT);
221 extern BOOL WineEngDestroyFontInstance(HFONT handle);
222 extern DWORD WineEngEnumFonts(LPLOGFONTW, FONTENUMPROCW, LPARAM);
223 extern BOOL WineEngGetCharABCWidths(GdiFont font, UINT firstChar,
224                                     UINT lastChar, LPABC buffer);
225 extern BOOL WineEngGetCharWidth(GdiFont, UINT, UINT, LPINT);
226 extern DWORD WineEngGetFontData(GdiFont, DWORD, DWORD, LPVOID, DWORD);
227 extern DWORD WineEngGetGlyphIndices(GdiFont font, LPCWSTR lpstr, INT count,
228                                     LPWORD pgi, DWORD flags);
229 extern DWORD WineEngGetGlyphOutline(GdiFont, UINT glyph, UINT format,
230                                     LPGLYPHMETRICS, DWORD buflen, LPVOID buf,
231                                     const MAT2*);
232 extern UINT WineEngGetOutlineTextMetrics(GdiFont, UINT, LPOUTLINETEXTMETRICW);
233 extern UINT WineEngGetTextCharsetInfo(GdiFont font, LPFONTSIGNATURE fs, DWORD flags);
234 extern BOOL WineEngGetTextExtentPoint(GdiFont, LPCWSTR, INT, LPSIZE);
235 extern BOOL WineEngGetTextExtentPointI(GdiFont, const WORD *, INT, LPSIZE);
236 extern INT  WineEngGetTextFace(GdiFont, INT, LPWSTR);
237 extern BOOL WineEngGetTextMetrics(GdiFont, LPTEXTMETRICW);
238 extern BOOL WineEngInit(void);
239 extern BOOL WineEngRemoveFontResourceEx(LPCWSTR, DWORD, PVOID);
240
241 /* gdiobj.c */
242 extern BOOL GDI_Init(void);
243 extern void *GDI_AllocObject( WORD, WORD, HGDIOBJ *, const struct gdi_obj_funcs *funcs );
244 extern void *GDI_ReallocObject( WORD, HGDIOBJ, void *obj );
245 extern BOOL GDI_FreeObject( HGDIOBJ, void *obj );
246 extern void GDI_CheckNotLock(void);
247 extern BOOL GDI_hdc_using_object(HGDIOBJ obj, HDC hdc);
248 extern BOOL GDI_hdc_not_using_object(HGDIOBJ obj, HDC hdc);
249
250 /* metafile.c */
251 extern HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh);
252 extern HMETAFILE16 MF_Create_HMETAFILE16(METAHEADER *mh);
253 extern METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mr, LPCSTR filename);
254
255 /* path.c */
256
257 #define PATH_IsPathOpen(path) ((path).state==PATH_Open)
258 /* Returns TRUE if the specified path is in the open state, i.e. in the
259  * state where points will be added to the path, or FALSE otherwise. This
260  * function is implemented as a macro for performance reasons.
261  */
262
263 extern void PATH_InitGdiPath(GdiPath *pPath);
264 extern void PATH_DestroyGdiPath(GdiPath *pPath);
265 extern BOOL PATH_AssignGdiPath(GdiPath *pPathDest, const GdiPath *pPathSrc);
266
267 extern BOOL PATH_MoveTo(DC *dc);
268 extern BOOL PATH_LineTo(DC *dc, INT x, INT y);
269 extern BOOL PATH_Rectangle(DC *dc, INT x1, INT y1, INT x2, INT y2);
270 extern BOOL PATH_Ellipse(DC *dc, INT x1, INT y1, INT x2, INT y2);
271 extern BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
272                      INT xStart, INT yStart, INT xEnd, INT yEnd, INT lines);
273 extern BOOL PATH_PolyBezierTo(DC *dc, const POINT *pt, DWORD cbCount);
274 extern BOOL PATH_PolyBezier(DC *dc, const POINT *pt, DWORD cbCount);
275 extern BOOL PATH_PolylineTo(DC *dc, const POINT *pt, DWORD cbCount);
276 extern BOOL PATH_Polyline(DC *dc, const POINT *pt, DWORD cbCount);
277 extern BOOL PATH_Polygon(DC *dc, const POINT *pt, DWORD cbCount);
278 extern BOOL PATH_PolyPolyline(DC *dc, const POINT *pt, const DWORD *counts, DWORD polylines);
279 extern BOOL PATH_PolyPolygon(DC *dc, const POINT *pt, const INT *counts, UINT polygons);
280 extern BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height);
281 extern BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags);
282
283 /* painting.c */
284 extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut );
285
286 /* palette.c */
287 extern HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg);
288 extern UINT WINAPI GDIRealizePalette( HDC hdc );
289
290 /* region.c */
291 extern BOOL REGION_FrameRgn( HRGN dest, HRGN src, INT x, INT y );
292
293 /* text.c */
294 extern LPWSTR FONT_mbtowc(HDC, LPCSTR, INT, INT*, UINT*);
295
296 #endif /* __WINE_GDI_PRIVATE_H */