Fix the case of product and company names.
[wine] / include / gdi.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_H
22 #define __WINE_GDI_H
23
24 #include <stdarg.h>
25 #include <windef.h>
26 #include <winbase.h>
27 #include <wingdi.h>
28 #include <wine/wingdi16.h>
29 #include <math.h>
30
31   /* GDI objects magic numbers */
32 #define FIRST_MAGIC           0x4f47
33 #define PEN_MAGIC             0x4f47
34 #define BRUSH_MAGIC           0x4f48
35 #define FONT_MAGIC            0x4f49
36 #define PALETTE_MAGIC         0x4f4a
37 #define BITMAP_MAGIC          0x4f4b
38 #define REGION_MAGIC          0x4f4c
39 #define DC_MAGIC              0x4f4d
40 #define DISABLED_DC_MAGIC     0x4f4e
41 #define META_DC_MAGIC         0x4f4f
42 #define METAFILE_MAGIC        0x4f50
43 #define METAFILE_DC_MAGIC     0x4f51
44 #define ENHMETAFILE_MAGIC     0x4f52
45 #define ENHMETAFILE_DC_MAGIC  0x4f53
46 #define MEMORY_DC_MAGIC       0x4f54
47 #define LAST_MAGIC            0x4f54
48
49 #define MAGIC_DONTCARE        0xffff
50
51 /* GDI constants for making objects private/system (naming undoc. !) */
52 #define OBJECT_PRIVATE        0x2000
53 #define OBJECT_NOSYSTEM       0x8000
54
55 #define GDIMAGIC(magic) ((magic) & ~(OBJECT_PRIVATE|OBJECT_NOSYSTEM))
56
57 struct gdi_obj_funcs
58 {
59     HGDIOBJ (*pSelectObject)( HGDIOBJ handle, void *obj, HDC hdc );
60     INT     (*pGetObject16)( HGDIOBJ handle, void *obj, INT count, LPVOID buffer );
61     INT     (*pGetObjectA)( HGDIOBJ handle, void *obj, INT count, LPVOID buffer );
62     INT     (*pGetObjectW)( HGDIOBJ handle, void *obj, INT count, LPVOID buffer );
63     BOOL    (*pUnrealizeObject)( HGDIOBJ handle, void *obj );
64     BOOL    (*pDeleteObject)( HGDIOBJ handle, void *obj );
65 };
66
67 typedef struct tagGDIOBJHDR
68 {
69     HANDLE16    hNext;
70     WORD        wMagic;
71     DWORD       dwCount;
72     const struct gdi_obj_funcs *funcs;
73 } GDIOBJHDR;
74
75
76 /* It should not be necessary to access the contents of the GdiPath
77  * structure directly; if you find that the exported functions don't
78  * allow you to do what you want, then please place a new exported
79  * function that does this job in path.c.
80  */
81 typedef enum tagGdiPathState
82 {
83    PATH_Null,
84    PATH_Open,
85    PATH_Closed
86 } GdiPathState;
87
88 typedef struct tagGdiPath
89 {
90    GdiPathState state;
91    POINT      *pPoints;
92    BYTE         *pFlags;
93    int          numEntriesUsed, numEntriesAllocated;
94    BOOL       newStroke;
95 } GdiPath;
96
97 typedef struct tagGdiFont *GdiFont;
98
99 typedef struct { int opaque; } *PHYSDEV;  /* PHYSDEV is an opaque pointer */
100
101 typedef struct tagDC
102 {
103     GDIOBJHDR    header;
104     HDC          hSelf;            /* Handle to this DC */
105     const struct tagDC_FUNCS *funcs; /* DC function table */
106     PHYSDEV      physDev;         /* Physical device (driver-specific) */
107     INT          saveLevel;
108     DWORD        dwHookData;
109     FARPROC16    hookProc;         /* the original SEGPTR ... */
110     DCHOOKPROC   hookThunk;        /* ... and the thunk to call it */
111
112     INT          wndOrgX;          /* Window origin */
113     INT          wndOrgY;
114     INT          wndExtX;          /* Window extent */
115     INT          wndExtY;
116     INT          vportOrgX;        /* Viewport origin */
117     INT          vportOrgY;
118     INT          vportExtX;        /* Viewport extent */
119     INT          vportExtY;
120
121     int           flags;
122     HRGN          hClipRgn;     /* Clip region (may be 0) */
123     HRGN          hVisRgn;      /* Visible region (must never be 0) */
124     HRGN          hGCClipRgn;   /* GC clip region (ClipRgn AND VisRgn) */
125     HPEN          hPen;
126     HBRUSH        hBrush;
127     HFONT         hFont;
128     HBITMAP       hBitmap;
129     HANDLE        hDevice;
130     HPALETTE      hPalette;
131
132     GdiFont       gdiFont;
133     GdiPath       path;
134
135     WORD          ROPmode;
136     WORD          polyFillMode;
137     WORD          stretchBltMode;
138     WORD          relAbsMode;
139     WORD          backgroundMode;
140     COLORREF      backgroundColor;
141     COLORREF      textColor;
142     short         brushOrgX;
143     short         brushOrgY;
144
145     WORD          textAlign;         /* Text alignment from SetTextAlign() */
146     short         charExtra;         /* Spacing from SetTextCharacterExtra() */
147     short         breakTotalExtra;   /* Total extra space for justification */
148     short         breakCount;        /* Break char. count */
149     short         breakExtra;        /* breakTotalExtra / breakCount */
150     short         breakRem;          /* breakTotalExtra % breakCount */
151
152     RECT          totalExtent;
153     BYTE          bitsPerPixel;
154
155     INT           MapMode;
156     INT           GraphicsMode;      /* Graphics mode */
157     ABORTPROC     pAbortProc;        /* AbortProc for Printing */
158     ABORTPROC16   pAbortProc16;
159     INT           CursPosX;          /* Current position */
160     INT           CursPosY;
161     INT           ArcDirection;
162     XFORM         xformWorld2Wnd;    /* World-to-window transformation */
163     XFORM         xformWorld2Vport;  /* World-to-viewport transformation */
164     XFORM         xformVport2World;  /* Inverse of the above transformation */
165     BOOL          vport2WorldValid;  /* Is xformVport2World valid? */
166 } DC;
167
168 /* Device functions for the Wine driver interface */
169
170 typedef INT (*DEVICEFONTENUMPROC)(LPENUMLOGFONTEXW,NEWTEXTMETRICEXW *,DWORD,
171                                   LPARAM);
172
173 typedef struct tagDC_FUNCS
174 {
175     INT      (*pAbortDoc)(PHYSDEV);
176     BOOL     (*pAbortPath)(PHYSDEV);
177     BOOL     (*pAngleArc)(PHYSDEV,INT,INT,DWORD,FLOAT,FLOAT);
178     BOOL     (*pArc)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
179     BOOL     (*pArcTo)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
180     BOOL     (*pBeginPath)(PHYSDEV);
181     BOOL     (*pBitBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,DWORD);
182     INT      (*pChoosePixelFormat)(PHYSDEV,const PIXELFORMATDESCRIPTOR *);
183     BOOL     (*pChord)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
184     BOOL     (*pCloseFigure)(PHYSDEV);
185     BOOL     (*pCreateBitmap)(PHYSDEV,HBITMAP);
186     BOOL     (*pCreateDC)(DC *,PHYSDEV *,LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODEW*);
187     HBITMAP  (*pCreateDIBSection)(PHYSDEV,BITMAPINFO *,UINT,LPVOID *,HANDLE,DWORD,DWORD);
188     BOOL     (*pDeleteBitmap)(HBITMAP);
189     BOOL     (*pDeleteDC)(PHYSDEV);
190     INT      (*pDescribePixelFormat)(PHYSDEV,INT,UINT,PIXELFORMATDESCRIPTOR *);
191     DWORD    (*pDeviceCapabilities)(LPSTR,LPCSTR,LPCSTR,WORD,LPSTR,LPDEVMODEA);
192     BOOL     (*pEllipse)(PHYSDEV,INT,INT,INT,INT);
193     INT      (*pEndDoc)(PHYSDEV);
194     INT      (*pEndPage)(PHYSDEV);
195     BOOL     (*pEndPath)(PHYSDEV);
196     BOOL     (*pEnumDeviceFonts)(PHYSDEV,LPLOGFONTW,DEVICEFONTENUMPROC,LPARAM);
197     INT      (*pExcludeClipRect)(PHYSDEV,INT,INT,INT,INT);
198     INT      (*pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD);
199     INT      (*pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID);
200     BOOL     (*pExtFloodFill)(PHYSDEV,INT,INT,COLORREF,UINT);
201     INT      (*pExtSelectClipRgn)(PHYSDEV,HRGN,INT);
202     BOOL     (*pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*);
203     BOOL     (*pFillPath)(PHYSDEV);
204     BOOL     (*pFillRgn)(PHYSDEV,HRGN,HBRUSH);
205     BOOL     (*pFlattenPath)(PHYSDEV);
206     BOOL     (*pFrameRgn)(PHYSDEV,HRGN,HBRUSH,INT,INT);
207     BOOL     (*pGdiComment)(PHYSDEV,UINT,CONST BYTE*);
208     LONG     (*pGetBitmapBits)(HBITMAP,void*,LONG);
209     BOOL     (*pGetCharWidth)(PHYSDEV,UINT,UINT,LPINT);
210     BOOL     (*pGetDCOrgEx)(PHYSDEV,LPPOINT);
211     UINT     (*pGetDIBColorTable)(PHYSDEV,UINT,UINT,RGBQUAD*);
212     INT      (*pGetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPVOID,BITMAPINFO*,UINT);
213     INT      (*pGetDeviceCaps)(PHYSDEV,INT);
214     BOOL     (*pGetDeviceGammaRamp)(PHYSDEV,LPVOID);
215     COLORREF (*pGetNearestColor)(PHYSDEV,COLORREF);
216     COLORREF (*pGetPixel)(PHYSDEV,INT,INT);
217     INT      (*pGetPixelFormat)(PHYSDEV);
218     UINT     (*pGetSystemPaletteEntries)(PHYSDEV,UINT,UINT,LPPALETTEENTRY);
219     BOOL     (*pGetTextExtentPoint)(PHYSDEV,LPCWSTR,INT,LPSIZE);
220     BOOL     (*pGetTextMetrics)(PHYSDEV,TEXTMETRICW*);
221     INT      (*pIntersectClipRect)(PHYSDEV,INT,INT,INT,INT);
222     BOOL     (*pInvertRgn)(PHYSDEV,HRGN);
223     BOOL     (*pLineTo)(PHYSDEV,INT,INT);
224     BOOL     (*pModifyWorldTransform)(PHYSDEV,const XFORM*,INT);
225     BOOL     (*pMoveTo)(PHYSDEV,INT,INT);
226     INT      (*pOffsetClipRgn)(PHYSDEV,INT,INT);
227     INT      (*pOffsetViewportOrg)(PHYSDEV,INT,INT);
228     INT      (*pOffsetWindowOrg)(PHYSDEV,INT,INT);
229     BOOL     (*pPaintRgn)(PHYSDEV,HRGN);
230     BOOL     (*pPatBlt)(PHYSDEV,INT,INT,INT,INT,DWORD);
231     BOOL     (*pPie)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
232     BOOL     (*pPolyBezier)(PHYSDEV,const POINT*,DWORD);
233     BOOL     (*pPolyBezierTo)(PHYSDEV,const POINT*,DWORD);
234     BOOL     (*pPolyDraw)(PHYSDEV,const POINT*,const BYTE *,DWORD);
235     BOOL     (*pPolyPolygon)(PHYSDEV,const POINT*,const INT*,UINT);
236     BOOL     (*pPolyPolyline)(PHYSDEV,const POINT*,const DWORD*,DWORD);
237     BOOL     (*pPolygon)(PHYSDEV,const POINT*,INT);
238     BOOL     (*pPolyline)(PHYSDEV,const POINT*,INT);
239     BOOL     (*pPolylineTo)(PHYSDEV,const POINT*,INT);
240     UINT     (*pRealizeDefaultPalette)(PHYSDEV);
241     UINT     (*pRealizePalette)(PHYSDEV,HPALETTE,BOOL);
242     BOOL     (*pRectangle)(PHYSDEV,INT,INT,INT,INT);
243     HDC      (*pResetDC)(PHYSDEV,const DEVMODEA*);
244     BOOL     (*pRestoreDC)(PHYSDEV,INT);
245     BOOL     (*pRoundRect)(PHYSDEV,INT,INT,INT,INT,INT,INT);
246     INT      (*pSaveDC)(PHYSDEV);
247     INT      (*pScaleViewportExt)(PHYSDEV,INT,INT,INT,INT);
248     INT      (*pScaleWindowExt)(PHYSDEV,INT,INT,INT,INT);
249     HBITMAP  (*pSelectBitmap)(PHYSDEV,HBITMAP);
250     HBRUSH   (*pSelectBrush)(PHYSDEV,HBRUSH);
251     BOOL     (*pSelectClipPath)(PHYSDEV,INT);
252     HFONT    (*pSelectFont)(PHYSDEV,HFONT);
253     HPALETTE (*pSelectPalette)(PHYSDEV,HPALETTE,BOOL);
254     HPEN     (*pSelectPen)(PHYSDEV,HPEN);
255     LONG     (*pSetBitmapBits)(HBITMAP,const void*,LONG);
256     COLORREF (*pSetBkColor)(PHYSDEV,COLORREF);
257     INT      (*pSetBkMode)(PHYSDEV,INT);
258     DWORD    (*pSetDCOrg)(PHYSDEV,INT,INT);
259     UINT     (*pSetDIBColorTable)(PHYSDEV,UINT,UINT,const RGBQUAD*);
260     INT      (*pSetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT);
261     INT      (*pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID,
262                                    const BITMAPINFO*,UINT);
263     VOID     (*pSetDeviceClipping)(PHYSDEV,HRGN);
264     BOOL     (*pSetDeviceGammaRamp)(PHYSDEV,LPVOID);
265     INT      (*pSetMapMode)(PHYSDEV,INT);
266     DWORD    (*pSetMapperFlags)(PHYSDEV,DWORD);
267     COLORREF (*pSetPixel)(PHYSDEV,INT,INT,COLORREF);
268     BOOL     (*pSetPixelFormat)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR *);
269     INT      (*pSetPolyFillMode)(PHYSDEV,INT);
270     INT      (*pSetROP2)(PHYSDEV,INT);
271     INT      (*pSetRelAbs)(PHYSDEV,INT);
272     INT      (*pSetStretchBltMode)(PHYSDEV,INT);
273     UINT     (*pSetTextAlign)(PHYSDEV,UINT);
274     INT      (*pSetTextCharacterExtra)(PHYSDEV,INT);
275     DWORD    (*pSetTextColor)(PHYSDEV,DWORD);
276     INT      (*pSetTextJustification)(PHYSDEV,INT,INT);
277     INT      (*pSetViewportExt)(PHYSDEV,INT,INT);
278     INT      (*pSetViewportOrg)(PHYSDEV,INT,INT);
279     INT      (*pSetWindowExt)(PHYSDEV,INT,INT);
280     INT      (*pSetWindowOrg)(PHYSDEV,INT,INT);
281     BOOL     (*pSetWorldTransform)(PHYSDEV,const XFORM*);
282     INT      (*pStartDoc)(PHYSDEV,const DOCINFOA*);
283     INT      (*pStartPage)(PHYSDEV);
284     BOOL     (*pStretchBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,DWORD);
285     INT      (*pStretchDIBits)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT,const void *,
286                                const BITMAPINFO*,UINT,DWORD);
287     BOOL     (*pStrokeAndFillPath)(PHYSDEV);
288     BOOL     (*pStrokePath)(PHYSDEV);
289     BOOL     (*pSwapBuffers)(PHYSDEV);
290     BOOL     (*pWidenPath)(PHYSDEV);
291 } DC_FUNCTIONS;
292
293 /* Certain functions will do no further processing if the driver returns this.
294    Used by mfdrv for example. */
295 #define GDI_NO_MORE_WORK 2
296
297   /* DC hook codes */
298 #define DCHC_INVALIDVISRGN      0x0001
299 #define DCHC_DELETEDC           0x0002
300
301 #define DCHF_INVALIDATEVISRGN   0x0001
302 #define DCHF_VALIDATEVISRGN     0x0002
303
304   /* DC flags */
305 #define DC_SAVED      0x0002   /* It is a saved DC */
306 #define DC_DIRTY      0x0004   /* hVisRgn has to be updated */
307 #define DC_THUNKHOOK  0x0008   /* DC hook is in the 16-bit code */
308
309 #define GDI_HEAP_SIZE 0xffe0
310
311 /* extra stock object: default 1x1 bitmap for memory DCs */
312 #define DEFAULT_BITMAP (STOCK_LAST+1)
313
314 /* Metafile defines */
315
316 #define META_EOF 0x0000
317 /* values of mtType in METAHEADER.  Note however that the disk image of a disk
318    based metafile has mtType == 1 */
319 #define METAFILE_MEMORY 1
320 #define METAFILE_DISK   2
321
322 /* Rounds a floating point number to integer. The world-to-viewport
323  * transformation process is done in floating point internally. This function
324  * is then used to round these coordinates to integer values.
325  */
326 static inline INT WINE_UNUSED GDI_ROUND(FLOAT val)
327 {
328    return (int)floor(val + 0.5);
329 }
330
331   /* World -> Device size conversion */
332
333 /* Performs a world-to-viewport transformation on the specified width (which
334  * is in floating point format).
335  */
336 static inline void WINE_UNUSED INTERNAL_XWSTODS_FLOAT(DC *dc, FLOAT *width)
337 {
338     /* Perform the transformation */
339     *width = *width * dc->xformWorld2Vport.eM11;
340 }
341
342 /* Performs a world-to-viewport transformation on the specified width (which
343  * is in integer format).
344  */
345 static inline INT WINE_UNUSED INTERNAL_XWSTODS(DC *dc, INT width)
346 {
347     FLOAT floatWidth;
348
349     /* Perform operation with floating point */
350     floatWidth = (FLOAT)width;
351     INTERNAL_XWSTODS_FLOAT(dc, &floatWidth);
352
353     /* Round to integers */
354     return GDI_ROUND(floatWidth);
355 }
356
357
358 /* Performs a world-to-viewport transformation on the specified size (which
359  * is in floating point format).
360  */
361 static inline void WINE_UNUSED INTERNAL_YWSTODS_FLOAT(DC *dc, FLOAT *height)
362 {
363     /* Perform the transformation */
364     *height = *height * dc->xformWorld2Vport.eM22;
365 }
366
367 /* Performs a world-to-viewport transformation on the specified size (which
368  * is in integer format).
369  */
370 static inline INT WINE_UNUSED INTERNAL_YWSTODS(DC *dc, INT height)
371 {
372     FLOAT floatHeight;
373
374     /* Perform operation with floating point */
375     floatHeight = (FLOAT)height;
376     INTERNAL_YWSTODS_FLOAT(dc, &floatHeight);
377
378     /* Round to integers */
379     return GDI_ROUND(floatHeight);
380 }
381
382
383   /* Device -> World size conversion */
384
385 /* Performs a device to world transformation on the specified width (which
386  * is in floating point format).
387  */
388 static inline void INTERNAL_XDSTOWS_FLOAT(DC *dc, FLOAT *width)
389 {
390     /* Perform the transformation */
391     *width = *width * dc->xformVport2World.eM11;
392 }
393
394 /* Performs a device to world transformation on the specified width (which
395  * is in integer format).
396  */
397 static inline INT INTERNAL_XDSTOWS(DC *dc, INT width)
398 {
399     FLOAT floatWidth;
400
401     /* Perform operation with floating point */
402     floatWidth = (FLOAT)width;
403     INTERNAL_XDSTOWS_FLOAT(dc, &floatWidth);
404
405     /* Round to integers */
406     return GDI_ROUND(floatWidth);
407 }
408
409
410 /* Performs a device to world transformation on the specified size (which
411  * is in floating point format).
412  */
413 static inline void INTERNAL_YDSTOWS_FLOAT(DC *dc, FLOAT *height)
414 {
415     /* Perform the transformation */
416     *height = *height * dc->xformVport2World.eM22;
417 }
418
419 /* Performs a device to world transformation on the specified size (which
420  * is in integer format).
421  */
422 static inline INT INTERNAL_YDSTOWS(DC *dc, INT height)
423 {
424     FLOAT floatHeight;
425
426     /* Perform operation with floating point */
427     floatHeight = (FLOAT)height;
428     INTERNAL_YDSTOWS_FLOAT(dc, &floatHeight);
429
430     /* Round to integers */
431     return GDI_ROUND(floatHeight);
432 }
433
434
435   /* Device <-> logical size conversion */
436
437 #define XDSTOLS(dc,x) \
438     MulDiv((x), (dc)->wndExtX, (dc)->vportExtX)
439 #define YDSTOLS(dc,y) \
440     MulDiv((y), (dc)->wndExtY, (dc)->vportExtY)
441 #define XLSTODS(dc,x) \
442     MulDiv((x), (dc)->vportExtX, (dc)->wndExtX)
443 #define YLSTODS(dc,y) \
444     MulDiv((y), (dc)->vportExtY, (dc)->wndExtY)
445
446   /* GDI local heap */
447
448 extern BOOL GDI_Init(void);
449 extern void *GDI_AllocObject( WORD, WORD, HGDIOBJ *, const struct gdi_obj_funcs *funcs );
450 extern void *GDI_ReallocObject( WORD, HGDIOBJ, void *obj );
451 extern BOOL GDI_FreeObject( HGDIOBJ, void *obj );
452 extern void *GDI_GetObjPtr( HGDIOBJ, WORD );
453 extern void GDI_ReleaseObj( HGDIOBJ );
454 extern void GDI_CheckNotLock(void);
455
456 extern const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name );
457 extern const DC_FUNCTIONS *DRIVER_get_driver( const DC_FUNCTIONS *funcs );
458 extern void DRIVER_release_driver( const DC_FUNCTIONS *funcs );
459 extern BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size );
460
461 extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut );
462
463 extern DC * DC_AllocDC( const DC_FUNCTIONS *funcs, WORD magic );
464 extern DC * DC_GetDCPtr( HDC hdc );
465 extern DC * DC_GetDCUpdate( HDC hdc );
466 extern void DC_InitDC( DC * dc );
467 extern void DC_UpdateXforms( DC * dc );
468
469 /* bidi.c */
470
471 /* Wine_GCPW Flags */
472 /* Directionality -
473  * LOOSE means that the paragraph dir is only set if there is no strong character.
474  * FORCE means override the characters in the paragraph.
475  */
476 #define WINE_GCPW_FORCE_LTR 0
477 #define WINE_GCPW_FORCE_RTL 1
478 #define WINE_GCPW_LOOSE_LTR 2
479 #define WINE_GCPW_LOOSE_RTL 3
480 #define WINE_GCPW_DIR_MASK 3
481 extern BOOL BIDI_Reorder( LPCWSTR lpString, INT uCount, DWORD dwFlags, DWORD dwWineGCP_Flags,
482                           LPWSTR lpOutString, INT uCountOut, UINT *lpOrder );
483 extern BOOL BidiAvail;
484
485 /* clipping.c */
486 extern void CLIPPING_UpdateGCRegion( DC * dc );
487
488 /* enhmetafile.c */
489 extern HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk );
490
491 /* freetype.c */
492 extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID);
493 extern GdiFont WineEngCreateFontInstance(DC*, HFONT);
494 extern BOOL WineEngDestroyFontInstance(HFONT handle);
495 extern DWORD WineEngEnumFonts(LPLOGFONTW, DEVICEFONTENUMPROC, LPARAM);
496 extern BOOL WineEngGetCharWidth(GdiFont, UINT, UINT, LPINT);
497 extern DWORD WineEngGetFontData(GdiFont, DWORD, DWORD, LPVOID, DWORD);
498 extern DWORD WineEngGetGlyphIndices(GdiFont font, LPCWSTR lpstr, INT count,
499                                     LPWORD pgi, DWORD flags);
500 extern DWORD WineEngGetGlyphOutline(GdiFont, UINT glyph, UINT format,
501                                     LPGLYPHMETRICS, DWORD buflen, LPVOID buf,
502                                     const MAT2*);
503 extern UINT WineEngGetOutlineTextMetrics(GdiFont, UINT, LPOUTLINETEXTMETRICW);
504 extern UINT WineEngGetTextCharsetInfo(GdiFont font, LPFONTSIGNATURE fs, DWORD flags);
505 extern BOOL WineEngGetTextExtentPoint(GdiFont, LPCWSTR, INT, LPSIZE);
506 extern BOOL WineEngGetTextExtentPointI(GdiFont, const WORD *, INT, LPSIZE);
507 extern INT  WineEngGetTextFace(GdiFont, INT, LPWSTR);
508 extern BOOL WineEngGetTextMetrics(GdiFont, LPTEXTMETRICW);
509 extern BOOL WineEngInit(void);
510 extern BOOL WineEngRemoveFontResourceEx(LPCWSTR, DWORD, PVOID);
511
512 /* metafile.c */
513 extern HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh);
514 extern HMETAFILE16 MF_Create_HMETAFILE16(METAHEADER *mh);
515 extern METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mr, LPCSTR filename);
516
517 /* region.c */
518 extern BOOL REGION_FrameRgn( HRGN dest, HRGN src, INT x, INT y );
519
520 /* palette.c */
521 extern HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg);
522 extern UINT WINAPI GDIRealizePalette( HDC hdc );
523
524 /* path.c */
525
526 #define PATH_IsPathOpen(path) ((path).state==PATH_Open)
527 /* Returns TRUE if the specified path is in the open state, i.e. in the
528  * state where points will be added to the path, or FALSE otherwise. This
529  * function is implemented as a macro for performance reasons.
530  */
531
532 extern void PATH_InitGdiPath(GdiPath *pPath);
533 extern void PATH_DestroyGdiPath(GdiPath *pPath);
534 extern BOOL PATH_AssignGdiPath(GdiPath *pPathDest, const GdiPath *pPathSrc);
535
536 extern BOOL PATH_MoveTo(DC *dc);
537 extern BOOL PATH_LineTo(DC *dc, INT x, INT y);
538 extern BOOL PATH_Rectangle(DC *dc, INT x1, INT y1, INT x2, INT y2);
539 extern BOOL PATH_Ellipse(DC *dc, INT x1, INT y1, INT x2, INT y2);
540 extern BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
541                      INT xStart, INT yStart, INT xEnd, INT yEnd, INT lines);
542 extern BOOL PATH_PolyBezierTo(DC *dc, const POINT *pt, DWORD cbCount);
543 extern BOOL PATH_PolyBezier(DC *dc, const POINT *pt, DWORD cbCount);
544 extern BOOL PATH_PolylineTo(DC *dc, const POINT *pt, DWORD cbCount);
545 extern BOOL PATH_Polyline(DC *dc, const POINT *pt, DWORD cbCount);
546 extern BOOL PATH_Polygon(DC *dc, const POINT *pt, DWORD cbCount);
547 extern BOOL PATH_PolyPolyline(DC *dc, const POINT *pt, const DWORD *counts, DWORD polylines);
548 extern BOOL PATH_PolyPolygon(DC *dc, const POINT *pt, const INT *counts, UINT polygons);
549 extern BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height);
550 extern BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags);
551
552 /* text.c */
553 extern LPWSTR FONT_mbtowc(HDC, LPCSTR, INT, INT*, UINT*);
554
555 #define WINE_GGO_GRAY16_BITMAP 0x7f
556
557 #endif  /* __WINE_GDI_H */