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