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"
30 /* GDI objects magic numbers */
31 #define FIRST_MAGIC 0x4f47
32 #define PEN_MAGIC 0x4f47
33 #define BRUSH_MAGIC 0x4f48
34 #define FONT_MAGIC 0x4f49
35 #define PALETTE_MAGIC 0x4f4a
36 #define BITMAP_MAGIC 0x4f4b
37 #define REGION_MAGIC 0x4f4c
38 #define DC_MAGIC 0x4f4d
39 #define DISABLED_DC_MAGIC 0x4f4e
40 #define META_DC_MAGIC 0x4f4f
41 #define METAFILE_MAGIC 0x4f50
42 #define METAFILE_DC_MAGIC 0x4f51
43 #define ENHMETAFILE_MAGIC 0x4f52
44 #define ENHMETAFILE_DC_MAGIC 0x4f53
45 #define LAST_MAGIC 0x4f53
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 typedef struct tagGdiFont *GdiFont;
76 typedef struct { int opaque; } *PHYSDEV; /* PHYSDEV is an opaque pointer */
81 HDC hSelf; /* Handle to this DC */
82 const struct tagDC_FUNCS *funcs; /* DC function table */
83 PHYSDEV physDev; /* Physical device (driver-specific) */
86 FARPROC16 hookProc; /* the original SEGPTR ... */
87 DCHOOKPROC hookThunk; /* ... and the thunk to call it */
89 INT wndOrgX; /* Window origin */
91 INT wndExtX; /* Window extent */
93 INT vportOrgX; /* Viewport origin */
95 INT vportExtX; /* Viewport extent */
99 HRGN16 hClipRgn; /* Clip region (may be 0) */
100 HRGN16 hVisRgn; /* Visible region (must never be 0) */
101 HRGN16 hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
117 COLORREF backgroundColor;
122 WORD textAlign; /* Text alignment from SetTextAlign() */
123 short charExtra; /* Spacing from SetTextCharacterExtra() */
124 short breakTotalExtra; /* Total extra space for justification */
125 short breakCount; /* Break char. count */
126 short breakExtra; /* breakTotalExtra / breakCount */
127 short breakRem; /* breakTotalExtra % breakCount */
133 INT GraphicsMode; /* Graphics mode */
134 INT DCOrgX; /* DC origin */
136 ABORTPROC pAbortProc; /* AbortProc for Printing */
137 ABORTPROC16 pAbortProc16;
138 INT CursPosX; /* Current position */
141 XFORM xformWorld2Wnd; /* World-to-window transformation */
142 XFORM xformWorld2Vport; /* World-to-viewport transformation */
143 XFORM xformVport2World; /* Inverse of the above transformation */
144 BOOL vport2WorldValid; /* Is xformVport2World valid? */
147 /* Device functions for the Wine driver interface */
149 typedef INT (*DEVICEFONTENUMPROC)(LPENUMLOGFONTEXW,LPNEWTEXTMETRICEXW,DWORD,
152 typedef struct tagDC_FUNCS
154 INT (*pAbortDoc)(PHYSDEV);
155 BOOL (*pAbortPath)(PHYSDEV);
156 BOOL (*pAngleArc)(PHYSDEV,INT,INT,DWORD,FLOAT,FLOAT);
157 BOOL (*pArc)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
158 BOOL (*pArcTo)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
159 BOOL (*pBeginPath)(PHYSDEV);
160 BOOL (*pBitBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,DWORD);
161 INT (*pChoosePixelFormat)(PHYSDEV,const PIXELFORMATDESCRIPTOR *);
162 BOOL (*pChord)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
163 BOOL (*pCloseFigure)(PHYSDEV);
164 BOOL (*pCreateBitmap)(PHYSDEV,HBITMAP);
165 BOOL (*pCreateDC)(DC *,LPCSTR,LPCSTR,LPCSTR,const DEVMODEA*);
166 HBITMAP (*pCreateDIBSection)(PHYSDEV,BITMAPINFO *,UINT,LPVOID *,HANDLE,DWORD,DWORD);
167 BOOL (*pDeleteBitmap)(HBITMAP);
168 BOOL (*pDeleteDC)(PHYSDEV);
169 INT (*pDescribePixelFormat)(PHYSDEV,INT,UINT,PIXELFORMATDESCRIPTOR *);
170 DWORD (*pDeviceCapabilities)(LPSTR,LPCSTR,LPCSTR,WORD,LPSTR,LPDEVMODEA);
171 BOOL (*pEllipse)(PHYSDEV,INT,INT,INT,INT);
172 INT (*pEndDoc)(PHYSDEV);
173 INT (*pEndPage)(PHYSDEV);
174 BOOL (*pEndPath)(PHYSDEV);
175 BOOL (*pEnumDeviceFonts)(PHYSDEV,LPLOGFONTW,DEVICEFONTENUMPROC,LPARAM);
176 INT (*pExcludeClipRect)(PHYSDEV,INT,INT,INT,INT);
177 INT (*pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD);
178 INT (*pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID);
179 BOOL (*pExtFloodFill)(PHYSDEV,INT,INT,COLORREF,UINT);
180 INT (*pExtSelectClipRgn)(PHYSDEV,HRGN,INT);
181 BOOL (*pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*);
182 BOOL (*pFillPath)(PHYSDEV);
183 BOOL (*pFillRgn)(PHYSDEV,HRGN,HBRUSH);
184 BOOL (*pFlattenPath)(PHYSDEV);
185 BOOL (*pFrameRgn)(PHYSDEV,HRGN,HBRUSH,INT,INT);
186 LONG (*pGetBitmapBits)(HBITMAP,void*,LONG);
187 BOOL (*pGetCharWidth)(PHYSDEV,UINT,UINT,LPINT);
188 BOOL (*pGetDCOrgEx)(PHYSDEV,LPPOINT);
189 UINT (*pGetDIBColorTable)(PHYSDEV,UINT,UINT,RGBQUAD*);
190 INT (*pGetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPVOID,BITMAPINFO*,UINT);
191 INT (*pGetDeviceCaps)(PHYSDEV,INT);
192 BOOL (*pGetDeviceGammaRamp)(PHYSDEV,LPVOID);
193 COLORREF (*pGetNearestColor)(PHYSDEV,COLORREF);
194 COLORREF (*pGetPixel)(PHYSDEV,INT,INT);
195 INT (*pGetPixelFormat)(PHYSDEV);
196 UINT (*pGetSystemPaletteEntries)(PHYSDEV,UINT,UINT,LPPALETTEENTRY);
197 BOOL (*pGetTextExtentPoint)(PHYSDEV,LPCWSTR,INT,LPSIZE);
198 BOOL (*pGetTextMetrics)(PHYSDEV,TEXTMETRICW*);
199 INT (*pIntersectClipRect)(PHYSDEV,INT,INT,INT,INT);
200 BOOL (*pInvertRgn)(PHYSDEV,HRGN);
201 BOOL (*pLineTo)(PHYSDEV,INT,INT);
202 BOOL (*pMoveTo)(PHYSDEV,INT,INT);
203 INT (*pOffsetClipRgn)(PHYSDEV,INT,INT);
204 BOOL (*pOffsetViewportOrg)(PHYSDEV,INT,INT);
205 BOOL (*pOffsetWindowOrg)(PHYSDEV,INT,INT);
206 BOOL (*pPaintRgn)(PHYSDEV,HRGN);
207 BOOL (*pPatBlt)(PHYSDEV,INT,INT,INT,INT,DWORD);
208 BOOL (*pPie)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
209 BOOL (*pPolyBezier)(PHYSDEV,const POINT*,DWORD);
210 BOOL (*pPolyBezierTo)(PHYSDEV,const POINT*,DWORD);
211 BOOL (*pPolyDraw)(PHYSDEV,const POINT*,const BYTE *,DWORD);
212 BOOL (*pPolyPolygon)(PHYSDEV,const POINT*,const INT*,UINT);
213 BOOL (*pPolyPolyline)(PHYSDEV,const POINT*,const DWORD*,DWORD);
214 BOOL (*pPolygon)(PHYSDEV,const POINT*,INT);
215 BOOL (*pPolyline)(PHYSDEV,const POINT*,INT);
216 BOOL (*pPolylineTo)(PHYSDEV,const POINT*,INT);
217 UINT (*pRealizeDefaultPalette)(PHYSDEV);
218 UINT (*pRealizePalette)(PHYSDEV,HPALETTE,BOOL);
219 BOOL (*pRectangle)(PHYSDEV,INT,INT,INT,INT);
220 HDC (*pResetDC)(PHYSDEV,const DEVMODEA*);
221 BOOL (*pRestoreDC)(PHYSDEV,INT);
222 BOOL (*pRoundRect)(PHYSDEV,INT,INT,INT,INT,INT,INT);
223 INT (*pSaveDC)(PHYSDEV);
224 BOOL (*pScaleViewportExt)(PHYSDEV,INT,INT,INT,INT);
225 BOOL (*pScaleWindowExt)(PHYSDEV,INT,INT,INT,INT);
226 HBITMAP (*pSelectBitmap)(PHYSDEV,HBITMAP);
227 HBRUSH (*pSelectBrush)(PHYSDEV,HBRUSH);
228 BOOL (*pSelectClipPath)(PHYSDEV,INT);
229 HFONT (*pSelectFont)(PHYSDEV,HFONT);
230 HPALETTE (*pSelectPalette)(PHYSDEV,HPALETTE,BOOL);
231 HPEN (*pSelectPen)(PHYSDEV,HPEN);
232 LONG (*pSetBitmapBits)(HBITMAP,const void*,LONG);
233 COLORREF (*pSetBkColor)(PHYSDEV,COLORREF);
234 INT (*pSetBkMode)(PHYSDEV,INT);
235 UINT (*pSetDIBColorTable)(PHYSDEV,UINT,UINT,const RGBQUAD*);
236 INT (*pSetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT);
237 INT (*pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID,
238 const BITMAPINFO*,UINT);
239 VOID (*pSetDeviceClipping)(PHYSDEV,HRGN);
240 BOOL (*pSetDeviceGammaRamp)(PHYSDEV,LPVOID);
241 INT (*pSetMapMode)(PHYSDEV,INT);
242 DWORD (*pSetMapperFlags)(PHYSDEV,DWORD);
243 COLORREF (*pSetPixel)(PHYSDEV,INT,INT,COLORREF);
244 BOOL (*pSetPixelFormat)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR *);
245 INT (*pSetPolyFillMode)(PHYSDEV,INT);
246 INT (*pSetROP2)(PHYSDEV,INT);
247 INT (*pSetRelAbs)(PHYSDEV,INT);
248 INT (*pSetStretchBltMode)(PHYSDEV,INT);
249 UINT (*pSetTextAlign)(PHYSDEV,UINT);
250 INT (*pSetTextCharacterExtra)(PHYSDEV,INT);
251 DWORD (*pSetTextColor)(PHYSDEV,DWORD);
252 INT (*pSetTextJustification)(PHYSDEV,INT,INT);
253 BOOL (*pSetViewportExt)(PHYSDEV,INT,INT);
254 BOOL (*pSetViewportOrg)(PHYSDEV,INT,INT);
255 BOOL (*pSetWindowExt)(PHYSDEV,INT,INT);
256 BOOL (*pSetWindowOrg)(PHYSDEV,INT,INT);
257 INT (*pStartDoc)(PHYSDEV,const DOCINFOA*);
258 INT (*pStartPage)(PHYSDEV);
259 BOOL (*pStretchBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,DWORD);
260 INT (*pStretchDIBits)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT,const void *,
261 const BITMAPINFO*,UINT,DWORD);
262 BOOL (*pStrokeAndFillPath)(PHYSDEV);
263 BOOL (*pStrokePath)(PHYSDEV);
264 BOOL (*pSwapBuffers)(PHYSDEV);
265 BOOL (*pWidenPath)(PHYSDEV);
269 #define DCHC_INVALIDVISRGN 0x0001
270 #define DCHC_DELETEDC 0x0002
272 #define DCHF_INVALIDATEVISRGN 0x0001
273 #define DCHF_VALIDATEVISRGN 0x0002
276 #define DC_MEMORY 0x0001 /* It is a memory DC */
277 #define DC_SAVED 0x0002 /* It is a saved DC */
278 #define DC_DIRTY 0x0004 /* hVisRgn has to be updated */
279 #define DC_THUNKHOOK 0x0008 /* DC hook is in the 16-bit code */
281 #define GDI_HEAP_SIZE 0xffe0
283 /* extra stock object: default 1x1 bitmap for memory DCs */
284 #define DEFAULT_BITMAP (STOCK_LAST+1)
286 /* Metafile defines */
288 #define META_EOF 0x0000
289 /* values of mtType in METAHEADER. Note however that the disk image of a disk
290 based metafile has mtType == 1 */
291 #define METAFILE_MEMORY 1
292 #define METAFILE_DISK 2
294 /* Device <-> logical coords conversion */
296 /* A floating point version of the POINT structure */
297 typedef struct tagFLOAT_POINT
302 /* Rounds a floating point number to integer. The world-to-viewport
303 * transformation process is done in floating point internally. This function
304 * is then used to round these coordinates to integer values.
306 static inline INT WINE_UNUSED GDI_ROUND(FLOAT val)
308 return (int)floor(val + 0.5);
311 /* Performs a viewport-to-world transformation on the specified point (which
312 * is in floating point format). Returns TRUE if successful, else FALSE.
314 static inline BOOL WINE_UNUSED INTERNAL_DPTOLP_FLOAT(DC *dc, FLOAT_POINT *point)
318 /* Check that the viewport-to-world transformation is valid */
319 if (!dc->vport2WorldValid)
322 /* Perform the transformation */
325 point->x = x * dc->xformVport2World.eM11 +
326 y * dc->xformVport2World.eM21 +
327 dc->xformVport2World.eDx;
328 point->y = x * dc->xformVport2World.eM12 +
329 y * dc->xformVport2World.eM22 +
330 dc->xformVport2World.eDy;
335 /* Performs a viewport-to-world transformation on the specified point (which
336 * is in integer format). Returns TRUE if successful, else FALSE.
338 static inline BOOL WINE_UNUSED INTERNAL_DPTOLP(DC *dc, LPPOINT point)
340 FLOAT_POINT floatPoint;
342 /* Perform operation with floating point */
343 floatPoint.x=(FLOAT)point->x;
344 floatPoint.y=(FLOAT)point->y;
345 if (!INTERNAL_DPTOLP_FLOAT(dc, &floatPoint))
348 /* Round to integers */
349 point->x = GDI_ROUND(floatPoint.x);
350 point->y = GDI_ROUND(floatPoint.y);
355 /* Performs a world-to-viewport transformation on the specified point (which
356 * is in floating point format).
358 static inline void WINE_UNUSED INTERNAL_LPTODP_FLOAT(DC *dc, FLOAT_POINT *point)
362 /* Perform the transformation */
365 point->x = x * dc->xformWorld2Vport.eM11 +
366 y * dc->xformWorld2Vport.eM21 +
367 dc->xformWorld2Vport.eDx;
368 point->y = x * dc->xformWorld2Vport.eM12 +
369 y * dc->xformWorld2Vport.eM22 +
370 dc->xformWorld2Vport.eDy;
373 /* Performs a world-to-viewport transformation on the specified point (which
374 * is in integer format).
376 static inline void WINE_UNUSED INTERNAL_LPTODP(DC *dc, LPPOINT point)
378 FLOAT_POINT floatPoint;
380 /* Perform operation with floating point */
381 floatPoint.x=(FLOAT)point->x;
382 floatPoint.y=(FLOAT)point->y;
383 INTERNAL_LPTODP_FLOAT(dc, &floatPoint);
385 /* Round to integers */
386 point->x = GDI_ROUND(floatPoint.x);
387 point->y = GDI_ROUND(floatPoint.y);
391 /* Performs a world-to-viewport transformation on the specified point (which
392 * is in integer format).
394 static inline INT WINE_UNUSED INTERNAL_XWPTODP(DC *dc, INT x, INT y)
396 FLOAT_POINT floatPoint;
398 /* Perform operation with floating point */
399 floatPoint.x=(FLOAT)x;
400 floatPoint.y=(FLOAT)y;
401 INTERNAL_LPTODP_FLOAT(dc, &floatPoint);
403 /* Round to integers */
404 return GDI_ROUND(floatPoint.x);
407 /* Performs a world-to-viewport transformation on the specified point (which
408 * is in integer format).
410 static inline INT WINE_UNUSED INTERNAL_YWPTODP(DC *dc, INT x, INT y)
412 FLOAT_POINT floatPoint;
414 /* Perform operation with floating point */
415 floatPoint.x=(FLOAT)x;
416 floatPoint.y=(FLOAT)y;
417 INTERNAL_LPTODP_FLOAT(dc, &floatPoint);
419 /* Round to integers */
420 return GDI_ROUND(floatPoint.y);
424 /* Performs a viewport-to-world transformation on the specified point (which
425 * is in integer format).
427 static inline INT WINE_UNUSED INTERNAL_XDPTOWP(DC *dc, INT x, INT y)
429 FLOAT_POINT floatPoint;
431 /* Perform operation with floating point */
432 floatPoint.x=(FLOAT)x;
433 floatPoint.y=(FLOAT)y;
434 INTERNAL_DPTOLP_FLOAT(dc, &floatPoint);
436 /* Round to integers */
437 return GDI_ROUND(floatPoint.x);
440 /* Performs a viewport-to-world transformation on the specified point (which
441 * is in integer format).
443 static inline INT WINE_UNUSED INTERNAL_YDPTOWP(DC *dc, INT x, INT y)
445 FLOAT_POINT floatPoint;
447 /* Perform operation with floating point */
448 floatPoint.x=(FLOAT)x;
449 floatPoint.y=(FLOAT)y;
450 INTERNAL_DPTOLP_FLOAT(dc, &floatPoint);
452 /* Round to integers */
453 return GDI_ROUND(floatPoint.y);
457 #define XDPTOLP(dc,x) \
458 (MulDiv(((x)-(dc)->vportOrgX), (dc)->wndExtX, (dc)->vportExtX) + (dc)->wndOrgX)
459 #define YDPTOLP(dc,y) \
460 (MulDiv(((y)-(dc)->vportOrgY), (dc)->wndExtY, (dc)->vportExtY) + (dc)->wndOrgY)
461 #define XLPTODP(dc,x) \
462 (MulDiv(((x)-(dc)->wndOrgX), (dc)->vportExtX, (dc)->wndExtX) + (dc)->vportOrgX)
463 #define YLPTODP(dc,y) \
464 (MulDiv(((y)-(dc)->wndOrgY), (dc)->vportExtY, (dc)->wndExtY) + (dc)->vportOrgY)
468 /* World -> Device size conversion */
470 /* Performs a world-to-viewport transformation on the specified width (which
471 * is in floating point format).
473 static inline void WINE_UNUSED INTERNAL_XWSTODS_FLOAT(DC *dc, FLOAT *width)
475 /* Perform the transformation */
476 *width = *width * dc->xformWorld2Vport.eM11;
479 /* Performs a world-to-viewport transformation on the specified width (which
480 * is in integer format).
482 static inline INT WINE_UNUSED INTERNAL_XWSTODS(DC *dc, INT width)
486 /* Perform operation with floating point */
487 floatWidth = (FLOAT)width;
488 INTERNAL_XWSTODS_FLOAT(dc, &floatWidth);
490 /* Round to integers */
491 return GDI_ROUND(floatWidth);
495 /* Performs a world-to-viewport transformation on the specified size (which
496 * is in floating point format).
498 static inline void WINE_UNUSED INTERNAL_YWSTODS_FLOAT(DC *dc, FLOAT *height)
500 /* Perform the transformation */
501 *height = *height * dc->xformWorld2Vport.eM22;
504 /* Performs a world-to-viewport transformation on the specified size (which
505 * is in integer format).
507 static inline INT WINE_UNUSED INTERNAL_YWSTODS(DC *dc, INT height)
511 /* Perform operation with floating point */
512 floatHeight = (FLOAT)height;
513 INTERNAL_YWSTODS_FLOAT(dc, &floatHeight);
515 /* Round to integers */
516 return GDI_ROUND(floatHeight);
520 /* Device -> World size conversion */
522 /* Performs a device to world transformation on the specified width (which
523 * is in floating point format).
525 static inline void INTERNAL_XDSTOWS_FLOAT(DC *dc, FLOAT *width)
527 /* Perform the transformation */
528 *width = *width * dc->xformVport2World.eM11;
531 /* Performs a device to world transformation on the specified width (which
532 * is in integer format).
534 static inline INT INTERNAL_XDSTOWS(DC *dc, INT width)
538 /* Perform operation with floating point */
539 floatWidth = (FLOAT)width;
540 INTERNAL_XDSTOWS_FLOAT(dc, &floatWidth);
542 /* Round to integers */
543 return GDI_ROUND(floatWidth);
547 /* Performs a device to world transformation on the specified size (which
548 * is in floating point format).
550 static inline void INTERNAL_YDSTOWS_FLOAT(DC *dc, FLOAT *height)
552 /* Perform the transformation */
553 *height = *height * dc->xformVport2World.eM22;
556 /* Performs a device to world transformation on the specified size (which
557 * is in integer format).
559 static inline INT INTERNAL_YDSTOWS(DC *dc, INT height)
563 /* Perform operation with floating point */
564 floatHeight = (FLOAT)height;
565 INTERNAL_YDSTOWS_FLOAT(dc, &floatHeight);
567 /* Round to integers */
568 return GDI_ROUND(floatHeight);
572 /* Device <-> logical size conversion */
574 #define XDSTOLS(dc,x) \
575 MulDiv((x), (dc)->wndExtX, (dc)->vportExtX)
576 #define YDSTOLS(dc,y) \
577 MulDiv((y), (dc)->wndExtY, (dc)->vportExtY)
578 #define XLSTODS(dc,x) \
579 MulDiv((x), (dc)->vportExtX, (dc)->wndExtX)
580 #define YLSTODS(dc,y) \
581 MulDiv((y), (dc)->vportExtY, (dc)->wndExtY)
585 extern BOOL GDI_Init(void);
586 extern void *GDI_AllocObject( WORD, WORD, HGDIOBJ *, const struct gdi_obj_funcs *funcs );
587 extern void *GDI_ReallocObject( WORD, HGDIOBJ, void *obj );
588 extern BOOL GDI_FreeObject( HGDIOBJ, void *obj );
589 extern void *GDI_GetObjPtr( HGDIOBJ, WORD );
590 extern void GDI_ReleaseObj( HGDIOBJ );
591 extern void GDI_CheckNotLock(void);
593 extern const DC_FUNCTIONS *DRIVER_load_driver( LPCSTR name );
594 extern const DC_FUNCTIONS *DRIVER_get_driver( const DC_FUNCTIONS *funcs );
595 extern void DRIVER_release_driver( const DC_FUNCTIONS *funcs );
596 extern BOOL DRIVER_GetDriverName( LPCSTR device, LPSTR driver, DWORD size );
598 extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut );
600 extern DC * DC_AllocDC( const DC_FUNCTIONS *funcs );
601 extern DC * DC_GetDCPtr( HDC hdc );
602 extern DC * DC_GetDCUpdate( HDC hdc );
603 extern void DC_InitDC( DC * dc );
604 extern void DC_UpdateXforms( DC * dc );
607 extern void CLIPPING_UpdateGCRegion( DC * dc );
610 extern HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk );
613 extern HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh);
614 extern HMETAFILE16 MF_Create_HMETAFILE16(METAHEADER *mh);
615 extern METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mr, LPCSTR filename);
618 extern HRGN REGION_CropRgn( HRGN hDst, HRGN hSrc, const RECT *lpRect, const POINT *lpPt );
619 extern BOOL REGION_FrameRgn( HRGN dest, HRGN src, INT x, INT y );
621 #define WINE_GGO_GRAY16_BITMAP 0x7f
623 #endif /* __WINE_GDI_H */