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
28 #include <wine/wingdi16.h>
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
49 #define MAGIC_DONTCARE 0xffff
51 /* GDI constants for making objects private/system (naming undoc. !) */
52 #define OBJECT_PRIVATE 0x2000
53 #define OBJECT_NOSYSTEM 0x8000
55 #define GDIMAGIC(magic) ((magic) & ~(OBJECT_PRIVATE|OBJECT_NOSYSTEM))
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 );
67 typedef struct tagGDIOBJHDR
72 const struct gdi_obj_funcs *funcs;
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.
81 typedef enum tagGdiPathState
88 typedef struct tagGdiPath
93 int numEntriesUsed, numEntriesAllocated;
97 typedef struct tagGdiFont *GdiFont;
99 typedef struct { int opaque; } *PHYSDEV; /* PHYSDEV is an opaque pointer */
104 HDC hSelf; /* Handle to this DC */
105 const struct tagDC_FUNCS *funcs; /* DC function table */
106 PHYSDEV physDev; /* Physical device (driver-specific) */
109 FARPROC16 hookProc; /* the original SEGPTR ... */
110 DCHOOKPROC hookThunk; /* ... and the thunk to call it */
112 INT wndOrgX; /* Window origin */
114 INT wndExtX; /* Window extent */
116 INT vportOrgX; /* Viewport origin */
118 INT vportExtX; /* Viewport extent */
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) */
140 COLORREF backgroundColor;
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 */
156 INT GraphicsMode; /* Graphics mode */
157 ABORTPROC pAbortProc; /* AbortProc for Printing */
158 ABORTPROC16 pAbortProc16;
159 INT CursPosX; /* Current position */
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? */
168 /* Device functions for the Wine driver interface */
170 typedef INT (*DEVICEFONTENUMPROC)(LPENUMLOGFONTEXW,NEWTEXTMETRICEXW *,DWORD,
173 typedef struct tagDC_FUNCS
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 INT (*pSetArcDirection)(PHYSDEV,INT);
256 LONG (*pSetBitmapBits)(HBITMAP,const void*,LONG);
257 COLORREF (*pSetBkColor)(PHYSDEV,COLORREF);
258 INT (*pSetBkMode)(PHYSDEV,INT);
259 DWORD (*pSetDCOrg)(PHYSDEV,INT,INT);
260 UINT (*pSetDIBColorTable)(PHYSDEV,UINT,UINT,const RGBQUAD*);
261 INT (*pSetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT);
262 INT (*pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID,
263 const BITMAPINFO*,UINT);
264 VOID (*pSetDeviceClipping)(PHYSDEV,HRGN);
265 BOOL (*pSetDeviceGammaRamp)(PHYSDEV,LPVOID);
266 INT (*pSetMapMode)(PHYSDEV,INT);
267 DWORD (*pSetMapperFlags)(PHYSDEV,DWORD);
268 COLORREF (*pSetPixel)(PHYSDEV,INT,INT,COLORREF);
269 BOOL (*pSetPixelFormat)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR *);
270 INT (*pSetPolyFillMode)(PHYSDEV,INT);
271 INT (*pSetROP2)(PHYSDEV,INT);
272 INT (*pSetRelAbs)(PHYSDEV,INT);
273 INT (*pSetStretchBltMode)(PHYSDEV,INT);
274 UINT (*pSetTextAlign)(PHYSDEV,UINT);
275 INT (*pSetTextCharacterExtra)(PHYSDEV,INT);
276 DWORD (*pSetTextColor)(PHYSDEV,DWORD);
277 INT (*pSetTextJustification)(PHYSDEV,INT,INT);
278 INT (*pSetViewportExt)(PHYSDEV,INT,INT);
279 INT (*pSetViewportOrg)(PHYSDEV,INT,INT);
280 INT (*pSetWindowExt)(PHYSDEV,INT,INT);
281 INT (*pSetWindowOrg)(PHYSDEV,INT,INT);
282 BOOL (*pSetWorldTransform)(PHYSDEV,const XFORM*);
283 INT (*pStartDoc)(PHYSDEV,const DOCINFOA*);
284 INT (*pStartPage)(PHYSDEV);
285 BOOL (*pStretchBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,DWORD);
286 INT (*pStretchDIBits)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT,const void *,
287 const BITMAPINFO*,UINT,DWORD);
288 BOOL (*pStrokeAndFillPath)(PHYSDEV);
289 BOOL (*pStrokePath)(PHYSDEV);
290 BOOL (*pSwapBuffers)(PHYSDEV);
291 BOOL (*pWidenPath)(PHYSDEV);
294 /* Certain functions will do no further processing if the driver returns this.
295 Used by mfdrv for example. */
296 #define GDI_NO_MORE_WORK 2
299 #define DCHC_INVALIDVISRGN 0x0001
300 #define DCHC_DELETEDC 0x0002
302 #define DCHF_INVALIDATEVISRGN 0x0001
303 #define DCHF_VALIDATEVISRGN 0x0002
306 #define DC_SAVED 0x0002 /* It is a saved DC */
307 #define DC_DIRTY 0x0004 /* hVisRgn has to be updated */
308 #define DC_THUNKHOOK 0x0008 /* DC hook is in the 16-bit code */
310 #define GDI_HEAP_SIZE 0xffe0
312 /* extra stock object: default 1x1 bitmap for memory DCs */
313 #define DEFAULT_BITMAP (STOCK_LAST+1)
315 /* Metafile defines */
317 #define META_EOF 0x0000
318 /* values of mtType in METAHEADER. Note however that the disk image of a disk
319 based metafile has mtType == 1 */
320 #define METAFILE_MEMORY 1
321 #define METAFILE_DISK 2
323 /* Rounds a floating point number to integer. The world-to-viewport
324 * transformation process is done in floating point internally. This function
325 * is then used to round these coordinates to integer values.
327 static inline INT WINE_UNUSED GDI_ROUND(FLOAT val)
329 return (int)floor(val + 0.5);
332 /* World -> Device size conversion */
334 /* Performs a world-to-viewport transformation on the specified width (which
335 * is in floating point format).
337 static inline void WINE_UNUSED INTERNAL_XWSTODS_FLOAT(DC *dc, FLOAT *width)
339 /* Perform the transformation */
340 *width = *width * dc->xformWorld2Vport.eM11;
343 /* Performs a world-to-viewport transformation on the specified width (which
344 * is in integer format).
346 static inline INT WINE_UNUSED INTERNAL_XWSTODS(DC *dc, INT width)
350 /* Perform operation with floating point */
351 floatWidth = (FLOAT)width;
352 INTERNAL_XWSTODS_FLOAT(dc, &floatWidth);
354 /* Round to integers */
355 return GDI_ROUND(floatWidth);
359 /* Performs a world-to-viewport transformation on the specified size (which
360 * is in floating point format).
362 static inline void WINE_UNUSED INTERNAL_YWSTODS_FLOAT(DC *dc, FLOAT *height)
364 /* Perform the transformation */
365 *height = *height * dc->xformWorld2Vport.eM22;
368 /* Performs a world-to-viewport transformation on the specified size (which
369 * is in integer format).
371 static inline INT WINE_UNUSED INTERNAL_YWSTODS(DC *dc, INT height)
375 /* Perform operation with floating point */
376 floatHeight = (FLOAT)height;
377 INTERNAL_YWSTODS_FLOAT(dc, &floatHeight);
379 /* Round to integers */
380 return GDI_ROUND(floatHeight);
384 /* Device -> World size conversion */
386 /* Performs a device to world transformation on the specified width (which
387 * is in floating point format).
389 static inline void INTERNAL_XDSTOWS_FLOAT(DC *dc, FLOAT *width)
391 /* Perform the transformation */
392 *width = *width * dc->xformVport2World.eM11;
395 /* Performs a device to world transformation on the specified width (which
396 * is in integer format).
398 static inline INT INTERNAL_XDSTOWS(DC *dc, INT width)
402 /* Perform operation with floating point */
403 floatWidth = (FLOAT)width;
404 INTERNAL_XDSTOWS_FLOAT(dc, &floatWidth);
406 /* Round to integers */
407 return GDI_ROUND(floatWidth);
411 /* Performs a device to world transformation on the specified size (which
412 * is in floating point format).
414 static inline void INTERNAL_YDSTOWS_FLOAT(DC *dc, FLOAT *height)
416 /* Perform the transformation */
417 *height = *height * dc->xformVport2World.eM22;
420 /* Performs a device to world transformation on the specified size (which
421 * is in integer format).
423 static inline INT INTERNAL_YDSTOWS(DC *dc, INT height)
427 /* Perform operation with floating point */
428 floatHeight = (FLOAT)height;
429 INTERNAL_YDSTOWS_FLOAT(dc, &floatHeight);
431 /* Round to integers */
432 return GDI_ROUND(floatHeight);
436 /* Device <-> logical size conversion */
438 #define XDSTOLS(dc,x) \
439 MulDiv((x), (dc)->wndExtX, (dc)->vportExtX)
440 #define YDSTOLS(dc,y) \
441 MulDiv((y), (dc)->wndExtY, (dc)->vportExtY)
442 #define XLSTODS(dc,x) \
443 MulDiv((x), (dc)->vportExtX, (dc)->wndExtX)
444 #define YLSTODS(dc,y) \
445 MulDiv((y), (dc)->vportExtY, (dc)->wndExtY)
449 extern BOOL GDI_Init(void);
450 extern void *GDI_AllocObject( WORD, WORD, HGDIOBJ *, const struct gdi_obj_funcs *funcs );
451 extern void *GDI_ReallocObject( WORD, HGDIOBJ, void *obj );
452 extern BOOL GDI_FreeObject( HGDIOBJ, void *obj );
453 extern void *GDI_GetObjPtr( HGDIOBJ, WORD );
454 extern void GDI_ReleaseObj( HGDIOBJ );
455 extern void GDI_CheckNotLock(void);
457 extern const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name );
458 extern const DC_FUNCTIONS *DRIVER_get_driver( const DC_FUNCTIONS *funcs );
459 extern void DRIVER_release_driver( const DC_FUNCTIONS *funcs );
460 extern BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size );
462 extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut );
464 extern DC * DC_AllocDC( const DC_FUNCTIONS *funcs, WORD magic );
465 extern DC * DC_GetDCPtr( HDC hdc );
466 extern DC * DC_GetDCUpdate( HDC hdc );
467 extern void DC_InitDC( DC * dc );
468 extern void DC_UpdateXforms( DC * dc );
472 /* Wine_GCPW Flags */
474 * LOOSE means that the paragraph dir is only set if there is no strong character.
475 * FORCE means override the characters in the paragraph.
477 #define WINE_GCPW_FORCE_LTR 0
478 #define WINE_GCPW_FORCE_RTL 1
479 #define WINE_GCPW_LOOSE_LTR 2
480 #define WINE_GCPW_LOOSE_RTL 3
481 #define WINE_GCPW_DIR_MASK 3
482 extern BOOL BIDI_Reorder( LPCWSTR lpString, INT uCount, DWORD dwFlags, DWORD dwWineGCP_Flags,
483 LPWSTR lpOutString, INT uCountOut, UINT *lpOrder );
484 extern BOOL BidiAvail;
487 extern void CLIPPING_UpdateGCRegion( DC * dc );
490 extern HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk );
493 extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID);
494 extern GdiFont WineEngCreateFontInstance(DC*, HFONT);
495 extern BOOL WineEngDestroyFontInstance(HFONT handle);
496 extern DWORD WineEngEnumFonts(LPLOGFONTW, DEVICEFONTENUMPROC, LPARAM);
497 extern BOOL WineEngGetCharWidth(GdiFont, UINT, UINT, LPINT);
498 extern DWORD WineEngGetFontData(GdiFont, DWORD, DWORD, LPVOID, DWORD);
499 extern DWORD WineEngGetGlyphIndices(GdiFont font, LPCWSTR lpstr, INT count,
500 LPWORD pgi, DWORD flags);
501 extern DWORD WineEngGetGlyphOutline(GdiFont, UINT glyph, UINT format,
502 LPGLYPHMETRICS, DWORD buflen, LPVOID buf,
504 extern UINT WineEngGetOutlineTextMetrics(GdiFont, UINT, LPOUTLINETEXTMETRICW);
505 extern UINT WineEngGetTextCharsetInfo(GdiFont font, LPFONTSIGNATURE fs, DWORD flags);
506 extern BOOL WineEngGetTextExtentPoint(GdiFont, LPCWSTR, INT, LPSIZE);
507 extern BOOL WineEngGetTextExtentPointI(GdiFont, const WORD *, INT, LPSIZE);
508 extern INT WineEngGetTextFace(GdiFont, INT, LPWSTR);
509 extern BOOL WineEngGetTextMetrics(GdiFont, LPTEXTMETRICW);
510 extern BOOL WineEngInit(void);
511 extern BOOL WineEngRemoveFontResourceEx(LPCWSTR, DWORD, PVOID);
514 extern HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh);
515 extern HMETAFILE16 MF_Create_HMETAFILE16(METAHEADER *mh);
516 extern METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mr, LPCSTR filename);
519 extern BOOL REGION_FrameRgn( HRGN dest, HRGN src, INT x, INT y );
522 extern HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg);
523 extern UINT WINAPI GDIRealizePalette( HDC hdc );
527 #define PATH_IsPathOpen(path) ((path).state==PATH_Open)
528 /* Returns TRUE if the specified path is in the open state, i.e. in the
529 * state where points will be added to the path, or FALSE otherwise. This
530 * function is implemented as a macro for performance reasons.
533 extern void PATH_InitGdiPath(GdiPath *pPath);
534 extern void PATH_DestroyGdiPath(GdiPath *pPath);
535 extern BOOL PATH_AssignGdiPath(GdiPath *pPathDest, const GdiPath *pPathSrc);
537 extern BOOL PATH_MoveTo(DC *dc);
538 extern BOOL PATH_LineTo(DC *dc, INT x, INT y);
539 extern BOOL PATH_Rectangle(DC *dc, INT x1, INT y1, INT x2, INT y2);
540 extern BOOL PATH_Ellipse(DC *dc, INT x1, INT y1, INT x2, INT y2);
541 extern BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
542 INT xStart, INT yStart, INT xEnd, INT yEnd, INT lines);
543 extern BOOL PATH_PolyBezierTo(DC *dc, const POINT *pt, DWORD cbCount);
544 extern BOOL PATH_PolyBezier(DC *dc, const POINT *pt, DWORD cbCount);
545 extern BOOL PATH_PolylineTo(DC *dc, const POINT *pt, DWORD cbCount);
546 extern BOOL PATH_Polyline(DC *dc, const POINT *pt, DWORD cbCount);
547 extern BOOL PATH_Polygon(DC *dc, const POINT *pt, DWORD cbCount);
548 extern BOOL PATH_PolyPolyline(DC *dc, const POINT *pt, const DWORD *counts, DWORD polylines);
549 extern BOOL PATH_PolyPolygon(DC *dc, const POINT *pt, const INT *counts, UINT polygons);
550 extern BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height);
551 extern BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags);
554 extern LPWSTR FONT_mbtowc(HDC, LPCSTR, INT, INT*, UINT*);
556 #define WINE_GGO_GRAY16_BITMAP 0x7f
558 #endif /* __WINE_GDI_H */