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
26 #include "wine/wingdi16.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 MEMORY_DC_MAGIC 0x4f54
45 #define LAST_MAGIC 0x4f54
47 #define MAGIC_DONTCARE 0xffff
49 /* GDI constants for making objects private/system (naming undoc. !) */
50 #define OBJECT_PRIVATE 0x2000
51 #define OBJECT_NOSYSTEM 0x8000
53 #define GDIMAGIC(magic) ((magic) & ~(OBJECT_PRIVATE|OBJECT_NOSYSTEM))
57 HGDIOBJ (*pSelectObject
)( HGDIOBJ handle
, void *obj
, HDC hdc
);
58 INT (*pGetObject16
)( HGDIOBJ handle
, void *obj
, INT count
, LPVOID buffer
);
59 INT (*pGetObjectA
)( HGDIOBJ handle
, void *obj
, INT count
, LPVOID buffer
);
60 INT (*pGetObjectW
)( HGDIOBJ handle
, void *obj
, INT count
, LPVOID buffer
);
61 BOOL (*pUnrealizeObject
)( HGDIOBJ handle
, void *obj
);
62 BOOL (*pDeleteObject
)( HGDIOBJ handle
, void *obj
);
65 typedef struct tagGDIOBJHDR
70 const struct gdi_obj_funcs
*funcs
;
74 /* It should not be necessary to access the contents of the GdiPath
75 * structure directly; if you find that the exported functions don't
76 * allow you to do what you want, then please place a new exported
77 * function that does this job in path.c.
79 typedef enum tagGdiPathState
86 typedef struct tagGdiPath
91 int numEntriesUsed
, numEntriesAllocated
;
95 typedef struct tagGdiFont
*GdiFont
;
97 typedef struct { int opaque
; } *PHYSDEV
; /* PHYSDEV is an opaque pointer */
102 HDC hSelf
; /* Handle to this DC */
103 const struct tagDC_FUNCS
*funcs
; /* DC function table */
104 PHYSDEV physDev
; /* Physical device (driver-specific) */
107 FARPROC16 hookProc
; /* the original SEGPTR ... */
108 DCHOOKPROC hookThunk
; /* ... and the thunk to call it */
110 INT wndOrgX
; /* Window origin */
112 INT wndExtX
; /* Window extent */
114 INT vportOrgX
; /* Viewport origin */
116 INT vportExtX
; /* Viewport extent */
120 HRGN hClipRgn
; /* Clip region (may be 0) */
121 HRGN hVisRgn
; /* Visible region (must never be 0) */
122 HRGN hGCClipRgn
; /* GC clip region (ClipRgn AND VisRgn) */
138 COLORREF backgroundColor
;
143 WORD textAlign
; /* Text alignment from SetTextAlign() */
144 short charExtra
; /* Spacing from SetTextCharacterExtra() */
145 short breakTotalExtra
; /* Total extra space for justification */
146 short breakCount
; /* Break char. count */
147 short breakExtra
; /* breakTotalExtra / breakCount */
148 short breakRem
; /* breakTotalExtra % breakCount */
154 INT GraphicsMode
; /* Graphics mode */
155 ABORTPROC pAbortProc
; /* AbortProc for Printing */
156 ABORTPROC16 pAbortProc16
;
157 INT CursPosX
; /* Current position */
160 XFORM xformWorld2Wnd
; /* World-to-window transformation */
161 XFORM xformWorld2Vport
; /* World-to-viewport transformation */
162 XFORM xformVport2World
; /* Inverse of the above transformation */
163 BOOL vport2WorldValid
; /* Is xformVport2World valid? */
166 /* Device functions for the Wine driver interface */
168 typedef INT (*DEVICEFONTENUMPROC
)(LPENUMLOGFONTEXW
,NEWTEXTMETRICEXW
*,DWORD
,
171 typedef struct tagDC_FUNCS
173 INT (*pAbortDoc
)(PHYSDEV
);
174 BOOL (*pAbortPath
)(PHYSDEV
);
175 BOOL (*pAngleArc
)(PHYSDEV
,INT
,INT
,DWORD
,FLOAT
,FLOAT
);
176 BOOL (*pArc
)(PHYSDEV
,INT
,INT
,INT
,INT
,INT
,INT
,INT
,INT
);
177 BOOL (*pArcTo
)(PHYSDEV
,INT
,INT
,INT
,INT
,INT
,INT
,INT
,INT
);
178 BOOL (*pBeginPath
)(PHYSDEV
);
179 BOOL (*pBitBlt
)(PHYSDEV
,INT
,INT
,INT
,INT
,PHYSDEV
,INT
,INT
,DWORD
);
180 INT (*pChoosePixelFormat
)(PHYSDEV
,const PIXELFORMATDESCRIPTOR
*);
181 BOOL (*pChord
)(PHYSDEV
,INT
,INT
,INT
,INT
,INT
,INT
,INT
,INT
);
182 BOOL (*pCloseFigure
)(PHYSDEV
);
183 BOOL (*pCreateBitmap
)(PHYSDEV
,HBITMAP
);
184 BOOL (*pCreateDC
)(DC
*,PHYSDEV
*,LPCSTR
,LPCSTR
,LPCSTR
,const DEVMODEA
*);
185 HBITMAP (*pCreateDIBSection
)(PHYSDEV
,BITMAPINFO
*,UINT
,LPVOID
*,HANDLE
,DWORD
,DWORD
);
186 BOOL (*pDeleteBitmap
)(HBITMAP
);
187 BOOL (*pDeleteDC
)(PHYSDEV
);
188 INT (*pDescribePixelFormat
)(PHYSDEV
,INT
,UINT
,PIXELFORMATDESCRIPTOR
*);
189 DWORD (*pDeviceCapabilities
)(LPSTR
,LPCSTR
,LPCSTR
,WORD
,LPSTR
,LPDEVMODEA
);
190 BOOL (*pEllipse
)(PHYSDEV
,INT
,INT
,INT
,INT
);
191 INT (*pEndDoc
)(PHYSDEV
);
192 INT (*pEndPage
)(PHYSDEV
);
193 BOOL (*pEndPath
)(PHYSDEV
);
194 BOOL (*pEnumDeviceFonts
)(PHYSDEV
,LPLOGFONTW
,DEVICEFONTENUMPROC
,LPARAM
);
195 INT (*pExcludeClipRect
)(PHYSDEV
,INT
,INT
,INT
,INT
);
196 INT (*pExtDeviceMode
)(LPSTR
,HWND
,LPDEVMODEA
,LPSTR
,LPSTR
,LPDEVMODEA
,LPSTR
,DWORD
);
197 INT (*pExtEscape
)(PHYSDEV
,INT
,INT
,LPCVOID
,INT
,LPVOID
);
198 BOOL (*pExtFloodFill
)(PHYSDEV
,INT
,INT
,COLORREF
,UINT
);
199 INT (*pExtSelectClipRgn
)(PHYSDEV
,HRGN
,INT
);
200 BOOL (*pExtTextOut
)(PHYSDEV
,INT
,INT
,UINT
,const RECT
*,LPCWSTR
,UINT
,const INT
*);
201 BOOL (*pFillPath
)(PHYSDEV
);
202 BOOL (*pFillRgn
)(PHYSDEV
,HRGN
,HBRUSH
);
203 BOOL (*pFlattenPath
)(PHYSDEV
);
204 BOOL (*pFrameRgn
)(PHYSDEV
,HRGN
,HBRUSH
,INT
,INT
);
205 BOOL (*pGdiComment
)(PHYSDEV
,UINT
,CONST BYTE
*);
206 LONG (*pGetBitmapBits
)(HBITMAP
,void*,LONG
);
207 BOOL (*pGetCharWidth
)(PHYSDEV
,UINT
,UINT
,LPINT
);
208 BOOL (*pGetDCOrgEx
)(PHYSDEV
,LPPOINT
);
209 UINT (*pGetDIBColorTable
)(PHYSDEV
,UINT
,UINT
,RGBQUAD
*);
210 INT (*pGetDIBits
)(PHYSDEV
,HBITMAP
,UINT
,UINT
,LPVOID
,BITMAPINFO
*,UINT
);
211 INT (*pGetDeviceCaps
)(PHYSDEV
,INT
);
212 BOOL (*pGetDeviceGammaRamp
)(PHYSDEV
,LPVOID
);
213 COLORREF (*pGetNearestColor
)(PHYSDEV
,COLORREF
);
214 COLORREF (*pGetPixel
)(PHYSDEV
,INT
,INT
);
215 INT (*pGetPixelFormat
)(PHYSDEV
);
216 UINT (*pGetSystemPaletteEntries
)(PHYSDEV
,UINT
,UINT
,LPPALETTEENTRY
);
217 BOOL (*pGetTextExtentPoint
)(PHYSDEV
,LPCWSTR
,INT
,LPSIZE
);
218 BOOL (*pGetTextMetrics
)(PHYSDEV
,TEXTMETRICW
*);
219 INT (*pIntersectClipRect
)(PHYSDEV
,INT
,INT
,INT
,INT
);
220 BOOL (*pInvertRgn
)(PHYSDEV
,HRGN
);
221 BOOL (*pLineTo
)(PHYSDEV
,INT
,INT
);
222 BOOL (*pMoveTo
)(PHYSDEV
,INT
,INT
);
223 INT (*pOffsetClipRgn
)(PHYSDEV
,INT
,INT
);
224 INT (*pOffsetViewportOrg
)(PHYSDEV
,INT
,INT
);
225 INT (*pOffsetWindowOrg
)(PHYSDEV
,INT
,INT
);
226 BOOL (*pPaintRgn
)(PHYSDEV
,HRGN
);
227 BOOL (*pPatBlt
)(PHYSDEV
,INT
,INT
,INT
,INT
,DWORD
);
228 BOOL (*pPie
)(PHYSDEV
,INT
,INT
,INT
,INT
,INT
,INT
,INT
,INT
);
229 BOOL (*pPolyBezier
)(PHYSDEV
,const POINT
*,DWORD
);
230 BOOL (*pPolyBezierTo
)(PHYSDEV
,const POINT
*,DWORD
);
231 BOOL (*pPolyDraw
)(PHYSDEV
,const POINT
*,const BYTE
*,DWORD
);
232 BOOL (*pPolyPolygon
)(PHYSDEV
,const POINT
*,const INT
*,UINT
);
233 BOOL (*pPolyPolyline
)(PHYSDEV
,const POINT
*,const DWORD
*,DWORD
);
234 BOOL (*pPolygon
)(PHYSDEV
,const POINT
*,INT
);
235 BOOL (*pPolyline
)(PHYSDEV
,const POINT
*,INT
);
236 BOOL (*pPolylineTo
)(PHYSDEV
,const POINT
*,INT
);
237 UINT (*pRealizeDefaultPalette
)(PHYSDEV
);
238 UINT (*pRealizePalette
)(PHYSDEV
,HPALETTE
,BOOL
);
239 BOOL (*pRectangle
)(PHYSDEV
,INT
,INT
,INT
,INT
);
240 HDC (*pResetDC
)(PHYSDEV
,const DEVMODEA
*);
241 BOOL (*pRestoreDC
)(PHYSDEV
,INT
);
242 BOOL (*pRoundRect
)(PHYSDEV
,INT
,INT
,INT
,INT
,INT
,INT
);
243 INT (*pSaveDC
)(PHYSDEV
);
244 INT (*pScaleViewportExt
)(PHYSDEV
,INT
,INT
,INT
,INT
);
245 INT (*pScaleWindowExt
)(PHYSDEV
,INT
,INT
,INT
,INT
);
246 HBITMAP (*pSelectBitmap
)(PHYSDEV
,HBITMAP
);
247 HBRUSH (*pSelectBrush
)(PHYSDEV
,HBRUSH
);
248 BOOL (*pSelectClipPath
)(PHYSDEV
,INT
);
249 HFONT (*pSelectFont
)(PHYSDEV
,HFONT
);
250 HPALETTE (*pSelectPalette
)(PHYSDEV
,HPALETTE
,BOOL
);
251 HPEN (*pSelectPen
)(PHYSDEV
,HPEN
);
252 LONG (*pSetBitmapBits
)(HBITMAP
,const void*,LONG
);
253 COLORREF (*pSetBkColor
)(PHYSDEV
,COLORREF
);
254 INT (*pSetBkMode
)(PHYSDEV
,INT
);
255 DWORD (*pSetDCOrg
)(PHYSDEV
,INT
,INT
);
256 UINT (*pSetDIBColorTable
)(PHYSDEV
,UINT
,UINT
,const RGBQUAD
*);
257 INT (*pSetDIBits
)(PHYSDEV
,HBITMAP
,UINT
,UINT
,LPCVOID
,const BITMAPINFO
*,UINT
);
258 INT (*pSetDIBitsToDevice
)(PHYSDEV
,INT
,INT
,DWORD
,DWORD
,INT
,INT
,UINT
,UINT
,LPCVOID
,
259 const BITMAPINFO
*,UINT
);
260 VOID (*pSetDeviceClipping
)(PHYSDEV
,HRGN
);
261 BOOL (*pSetDeviceGammaRamp
)(PHYSDEV
,LPVOID
);
262 INT (*pSetMapMode
)(PHYSDEV
,INT
);
263 DWORD (*pSetMapperFlags
)(PHYSDEV
,DWORD
);
264 COLORREF (*pSetPixel
)(PHYSDEV
,INT
,INT
,COLORREF
);
265 BOOL (*pSetPixelFormat
)(PHYSDEV
,INT
,const PIXELFORMATDESCRIPTOR
*);
266 INT (*pSetPolyFillMode
)(PHYSDEV
,INT
);
267 INT (*pSetROP2
)(PHYSDEV
,INT
);
268 INT (*pSetRelAbs
)(PHYSDEV
,INT
);
269 INT (*pSetStretchBltMode
)(PHYSDEV
,INT
);
270 UINT (*pSetTextAlign
)(PHYSDEV
,UINT
);
271 INT (*pSetTextCharacterExtra
)(PHYSDEV
,INT
);
272 DWORD (*pSetTextColor
)(PHYSDEV
,DWORD
);
273 INT (*pSetTextJustification
)(PHYSDEV
,INT
,INT
);
274 INT (*pSetViewportExt
)(PHYSDEV
,INT
,INT
);
275 INT (*pSetViewportOrg
)(PHYSDEV
,INT
,INT
);
276 INT (*pSetWindowExt
)(PHYSDEV
,INT
,INT
);
277 INT (*pSetWindowOrg
)(PHYSDEV
,INT
,INT
);
278 INT (*pStartDoc
)(PHYSDEV
,const DOCINFOA
*);
279 INT (*pStartPage
)(PHYSDEV
);
280 BOOL (*pStretchBlt
)(PHYSDEV
,INT
,INT
,INT
,INT
,PHYSDEV
,INT
,INT
,INT
,INT
,DWORD
);
281 INT (*pStretchDIBits
)(PHYSDEV
,INT
,INT
,INT
,INT
,INT
,INT
,INT
,INT
,const void *,
282 const BITMAPINFO
*,UINT
,DWORD
);
283 BOOL (*pStrokeAndFillPath
)(PHYSDEV
);
284 BOOL (*pStrokePath
)(PHYSDEV
);
285 BOOL (*pSwapBuffers
)(PHYSDEV
);
286 BOOL (*pWidenPath
)(PHYSDEV
);
289 /* Certain functions will do no further processing if the driver returns this.
290 Used by mfdrv for example. */
291 #define GDI_NO_MORE_WORK 2
294 #define DCHC_INVALIDVISRGN 0x0001
295 #define DCHC_DELETEDC 0x0002
297 #define DCHF_INVALIDATEVISRGN 0x0001
298 #define DCHF_VALIDATEVISRGN 0x0002
301 #define DC_SAVED 0x0002 /* It is a saved DC */
302 #define DC_DIRTY 0x0004 /* hVisRgn has to be updated */
303 #define DC_THUNKHOOK 0x0008 /* DC hook is in the 16-bit code */
305 #define GDI_HEAP_SIZE 0xffe0
307 /* extra stock object: default 1x1 bitmap for memory DCs */
308 #define DEFAULT_BITMAP (STOCK_LAST+1)
310 /* Metafile defines */
312 #define META_EOF 0x0000
313 /* values of mtType in METAHEADER. Note however that the disk image of a disk
314 based metafile has mtType == 1 */
315 #define METAFILE_MEMORY 1
316 #define METAFILE_DISK 2
318 /* Rounds a floating point number to integer. The world-to-viewport
319 * transformation process is done in floating point internally. This function
320 * is then used to round these coordinates to integer values.
322 static inline INT WINE_UNUSED
GDI_ROUND(FLOAT val
)
324 return (int)floor(val
+ 0.5);
327 /* World -> Device size conversion */
329 /* Performs a world-to-viewport transformation on the specified width (which
330 * is in floating point format).
332 static inline void WINE_UNUSED
INTERNAL_XWSTODS_FLOAT(DC
*dc
, FLOAT
*width
)
334 /* Perform the transformation */
335 *width
= *width
* dc
->xformWorld2Vport
.eM11
;
338 /* Performs a world-to-viewport transformation on the specified width (which
339 * is in integer format).
341 static inline INT WINE_UNUSED
INTERNAL_XWSTODS(DC
*dc
, INT width
)
345 /* Perform operation with floating point */
346 floatWidth
= (FLOAT
)width
;
347 INTERNAL_XWSTODS_FLOAT(dc
, &floatWidth
);
349 /* Round to integers */
350 return GDI_ROUND(floatWidth
);
354 /* Performs a world-to-viewport transformation on the specified size (which
355 * is in floating point format).
357 static inline void WINE_UNUSED
INTERNAL_YWSTODS_FLOAT(DC
*dc
, FLOAT
*height
)
359 /* Perform the transformation */
360 *height
= *height
* dc
->xformWorld2Vport
.eM22
;
363 /* Performs a world-to-viewport transformation on the specified size (which
364 * is in integer format).
366 static inline INT WINE_UNUSED
INTERNAL_YWSTODS(DC
*dc
, INT height
)
370 /* Perform operation with floating point */
371 floatHeight
= (FLOAT
)height
;
372 INTERNAL_YWSTODS_FLOAT(dc
, &floatHeight
);
374 /* Round to integers */
375 return GDI_ROUND(floatHeight
);
379 /* Device -> World size conversion */
381 /* Performs a device to world transformation on the specified width (which
382 * is in floating point format).
384 static inline void INTERNAL_XDSTOWS_FLOAT(DC
*dc
, FLOAT
*width
)
386 /* Perform the transformation */
387 *width
= *width
* dc
->xformVport2World
.eM11
;
390 /* Performs a device to world transformation on the specified width (which
391 * is in integer format).
393 static inline INT
INTERNAL_XDSTOWS(DC
*dc
, INT width
)
397 /* Perform operation with floating point */
398 floatWidth
= (FLOAT
)width
;
399 INTERNAL_XDSTOWS_FLOAT(dc
, &floatWidth
);
401 /* Round to integers */
402 return GDI_ROUND(floatWidth
);
406 /* Performs a device to world transformation on the specified size (which
407 * is in floating point format).
409 static inline void INTERNAL_YDSTOWS_FLOAT(DC
*dc
, FLOAT
*height
)
411 /* Perform the transformation */
412 *height
= *height
* dc
->xformVport2World
.eM22
;
415 /* Performs a device to world transformation on the specified size (which
416 * is in integer format).
418 static inline INT
INTERNAL_YDSTOWS(DC
*dc
, INT height
)
422 /* Perform operation with floating point */
423 floatHeight
= (FLOAT
)height
;
424 INTERNAL_YDSTOWS_FLOAT(dc
, &floatHeight
);
426 /* Round to integers */
427 return GDI_ROUND(floatHeight
);
431 /* Device <-> logical size conversion */
433 #define XDSTOLS(dc,x) \
434 MulDiv((x), (dc)->wndExtX, (dc)->vportExtX)
435 #define YDSTOLS(dc,y) \
436 MulDiv((y), (dc)->wndExtY, (dc)->vportExtY)
437 #define XLSTODS(dc,x) \
438 MulDiv((x), (dc)->vportExtX, (dc)->wndExtX)
439 #define YLSTODS(dc,y) \
440 MulDiv((y), (dc)->vportExtY, (dc)->wndExtY)
444 extern BOOL
GDI_Init(void);
445 extern void *GDI_AllocObject( WORD
, WORD
, HGDIOBJ
*, const struct gdi_obj_funcs
*funcs
);
446 extern void *GDI_ReallocObject( WORD
, HGDIOBJ
, void *obj
);
447 extern BOOL
GDI_FreeObject( HGDIOBJ
, void *obj
);
448 extern void *GDI_GetObjPtr( HGDIOBJ
, WORD
);
449 extern void GDI_ReleaseObj( HGDIOBJ
);
450 extern void GDI_CheckNotLock(void);
452 extern const DC_FUNCTIONS
*DRIVER_load_driver( LPCSTR name
);
453 extern const DC_FUNCTIONS
*DRIVER_get_driver( const DC_FUNCTIONS
*funcs
);
454 extern void DRIVER_release_driver( const DC_FUNCTIONS
*funcs
);
455 extern BOOL
DRIVER_GetDriverName( LPCSTR device
, LPSTR driver
, DWORD size
);
457 extern POINT
*GDI_Bezier( const POINT
*Points
, INT count
, INT
*nPtsOut
);
459 extern DC
* DC_AllocDC( const DC_FUNCTIONS
*funcs
, WORD magic
);
460 extern DC
* DC_GetDCPtr( HDC hdc
);
461 extern DC
* DC_GetDCUpdate( HDC hdc
);
462 extern void DC_InitDC( DC
* dc
);
463 extern void DC_UpdateXforms( DC
* dc
);
466 extern void CLIPPING_UpdateGCRegion( DC
* dc
);
469 extern HENHMETAFILE
EMF_Create_HENHMETAFILE(ENHMETAHEADER
*emh
, BOOL on_disk
);
472 extern INT
WineEngAddFontResourceEx(LPCWSTR
, DWORD
, PVOID
);
473 extern GdiFont
WineEngCreateFontInstance(DC
*, HFONT
);
474 extern BOOL
WineEngDestroyFontInstance(HFONT handle
);
475 extern DWORD
WineEngEnumFonts(LPLOGFONTW
, DEVICEFONTENUMPROC
, LPARAM
);
476 extern BOOL
WineEngGetCharWidth(GdiFont
, UINT
, UINT
, LPINT
);
477 extern DWORD
WineEngGetFontData(GdiFont
, DWORD
, DWORD
, LPVOID
, DWORD
);
478 extern DWORD
WineEngGetGlyphIndices(GdiFont font
, LPCWSTR lpstr
, INT count
,
479 LPWORD pgi
, DWORD flags
);
480 extern DWORD
WineEngGetGlyphOutline(GdiFont
, UINT glyph
, UINT format
,
481 LPGLYPHMETRICS
, DWORD buflen
, LPVOID buf
,
483 extern UINT
WineEngGetOutlineTextMetrics(GdiFont
, UINT
, LPOUTLINETEXTMETRICW
);
484 extern BOOL
WineEngGetTextExtentPoint(GdiFont
, LPCWSTR
, INT
, LPSIZE
);
485 extern BOOL
WineEngGetTextExtentPointI(GdiFont
, const WORD
*, INT
, LPSIZE
);
486 extern INT
WineEngGetTextFace(GdiFont
, INT
, LPWSTR
);
487 extern BOOL
WineEngGetTextMetrics(GdiFont
, LPTEXTMETRICW
);
488 extern BOOL
WineEngInit(void);
489 extern BOOL
WineEngRemoveFontResourceEx(LPCWSTR
, DWORD
, PVOID
);
492 extern HMETAFILE
MF_Create_HMETAFILE(METAHEADER
*mh
);
493 extern HMETAFILE16
MF_Create_HMETAFILE16(METAHEADER
*mh
);
494 extern METAHEADER
*MF_CreateMetaHeaderDisk(METAHEADER
*mr
, LPCSTR filename
);
497 extern BOOL
REGION_FrameRgn( HRGN dest
, HRGN src
, INT x
, INT y
);
500 extern HPALETTE WINAPI
GDISelectPalette( HDC hdc
, HPALETTE hpal
, WORD wBkg
);
501 extern UINT WINAPI
GDIRealizePalette( HDC hdc
);
505 #define PATH_IsPathOpen(path) ((path).state==PATH_Open)
506 /* Returns TRUE if the specified path is in the open state, i.e. in the
507 * state where points will be added to the path, or FALSE otherwise. This
508 * function is implemented as a macro for performance reasons.
511 extern void PATH_InitGdiPath(GdiPath
*pPath
);
512 extern void PATH_DestroyGdiPath(GdiPath
*pPath
);
513 extern BOOL
PATH_AssignGdiPath(GdiPath
*pPathDest
, const GdiPath
*pPathSrc
);
515 extern BOOL
PATH_MoveTo(DC
*dc
);
516 extern BOOL
PATH_LineTo(DC
*dc
, INT x
, INT y
);
517 extern BOOL
PATH_Rectangle(DC
*dc
, INT x1
, INT y1
, INT x2
, INT y2
);
518 extern BOOL
PATH_Ellipse(DC
*dc
, INT x1
, INT y1
, INT x2
, INT y2
);
519 extern BOOL
PATH_Arc(DC
*dc
, INT x1
, INT y1
, INT x2
, INT y2
,
520 INT xStart
, INT yStart
, INT xEnd
, INT yEnd
, INT lines
);
521 extern BOOL
PATH_PolyBezierTo(DC
*dc
, const POINT
*pt
, DWORD cbCount
);
522 extern BOOL
PATH_PolyBezier(DC
*dc
, const POINT
*pt
, DWORD cbCount
);
523 extern BOOL
PATH_PolylineTo(DC
*dc
, const POINT
*pt
, DWORD cbCount
);
524 extern BOOL
PATH_Polyline(DC
*dc
, const POINT
*pt
, DWORD cbCount
);
525 extern BOOL
PATH_Polygon(DC
*dc
, const POINT
*pt
, DWORD cbCount
);
526 extern BOOL
PATH_PolyPolyline(DC
*dc
, const POINT
*pt
, const DWORD
*counts
, DWORD polylines
);
527 extern BOOL
PATH_PolyPolygon(DC
*dc
, const POINT
*pt
, const INT
*counts
, UINT polygons
);
528 extern BOOL
PATH_RoundRect(DC
*dc
, INT x1
, INT y1
, INT x2
, INT y2
, INT ell_width
, INT ell_height
);
529 extern BOOL
PATH_AddEntry(GdiPath
*pPath
, const POINT
*pPoint
, BYTE flags
);
532 extern LPWSTR
FONT_mbtowc(HDC
, LPCSTR
, INT
, INT
*, UINT
*);
534 #define WINE_GGO_GRAY16_BITMAP 0x7f
536 #endif /* __WINE_GDI_H */