4 * Copyright 1993 Alexandre Julliard
14 #include "wine/wingdi16.h"
18 /* GDI objects magic numbers */
19 #define FIRST_MAGIC 0x4f47
20 #define PEN_MAGIC 0x4f47
21 #define BRUSH_MAGIC 0x4f48
22 #define FONT_MAGIC 0x4f49
23 #define PALETTE_MAGIC 0x4f4a
24 #define BITMAP_MAGIC 0x4f4b
25 #define REGION_MAGIC 0x4f4c
26 #define DC_MAGIC 0x4f4d
27 #define DISABLED_DC_MAGIC 0x4f4e
28 #define META_DC_MAGIC 0x4f4f
29 #define METAFILE_MAGIC 0x4f50
30 #define METAFILE_DC_MAGIC 0x4f51
31 #define ENHMETAFILE_MAGIC 0x4f52
32 #define ENHMETAFILE_DC_MAGIC 0x4f53
33 #define LAST_MAGIC 0x4f53
35 #define MAGIC_DONTCARE 0xffff
37 /* GDI constants for making objects private/system (naming undoc. !) */
38 #define OBJECT_PRIVATE 0x2000
39 #define OBJECT_NOSYSTEM 0x8000
41 #define GDIMAGIC(magic) ((magic) & ~(OBJECT_PRIVATE|OBJECT_NOSYSTEM))
43 typedef struct tagGDIOBJHDR
51 typedef struct tagDeviceCaps
53 WORD version; /* 0: driver version */
54 WORD technology; /* 2: device technology */
55 WORD horzSize; /* 4: width of display in mm */
56 WORD vertSize; /* 6: height of display in mm */
57 WORD horzRes; /* 8: width of display in pixels */
58 WORD vertRes; /* 10: width of display in pixels */
59 WORD bitsPixel; /* 12: bits per pixel */
60 WORD planes; /* 14: color planes */
61 WORD numBrushes; /* 16: device-specific brushes */
62 WORD numPens; /* 18: device-specific pens */
63 WORD numMarkers; /* 20: device-specific markers */
64 WORD numFonts; /* 22: device-specific fonts */
65 WORD numColors; /* 24: size of color table */
66 WORD pdeviceSize; /* 26: size of PDEVICE structure */
67 WORD curveCaps; /* 28: curve capabilities */
68 WORD lineCaps; /* 30: line capabilities */
69 WORD polygonalCaps; /* 32: polygon capabilities */
70 WORD textCaps; /* 34: text capabilities */
71 WORD clipCaps; /* 36: clipping capabilities */
72 WORD rasterCaps; /* 38: raster capabilities */
73 WORD aspectX; /* 40: relative width of device pixel */
74 WORD aspectY; /* 42: relative height of device pixel */
75 WORD aspectXY; /* 44: relative diagonal width of device pixel */
76 WORD pad1[21]; /* 46-86: reserved */
77 WORD logPixelsX; /* 88: pixels / logical X inch */
78 WORD logPixelsY; /* 90: pixels / logical Y inch */
79 WORD pad2[6]; /* 92-102: reserved */
80 WORD sizePalette; /* 104: entries in system palette */
81 WORD numReserved; /* 106: reserved entries */
82 WORD colorRes; /* 108: color resolution */
85 typedef BOOL16 CALLBACK (*DCHOOKPROC)(HDC16,WORD,DWORD,LPARAM);
90 HDC hSelf; /* Handle to this DC */
91 const struct tagDC_FUNCS *funcs; /* DC function table */
92 void *physDev; /* Physical device (driver-specific) */
95 FARPROC16 hookProc; /* the original SEGPTR ... */
96 DCHOOKPROC hookThunk; /* ... and the thunk to call it */
98 INT wndOrgX; /* Window origin */
100 INT wndExtX; /* Window extent */
102 INT vportOrgX; /* Viewport origin */
104 INT vportExtX; /* Viewport extent */
108 const DeviceCaps *devCaps;
110 HRGN16 hClipRgn; /* Clip region (may be 0) */
111 HRGN16 hVisRgn; /* Visible region (must never be 0) */
112 HRGN16 hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
127 COLORREF backgroundColor;
132 WORD textAlign; /* Text alignment from SetTextAlign() */
133 short charExtra; /* Spacing from SetTextCharacterExtra() */
134 short breakTotalExtra; /* Total extra space for justification */
135 short breakCount; /* Break char. count */
136 short breakExtra; /* breakTotalExtra / breakCount */
137 short breakRem; /* breakTotalExtra % breakCount */
143 INT GraphicsMode; /* Graphics mode */
144 INT DCOrgX; /* DC origin */
146 ABORTPROC pAbortProc; /* AbortProc for Printing */
147 INT CursPosX; /* Current position */
150 XFORM xformWorld2Wnd; /* World-to-window transformation */
151 XFORM xformWorld2Vport; /* World-to-viewport transformation */
152 XFORM xformVport2World; /* Inverse of the above transformation */
153 BOOL vport2WorldValid; /* Is xformVport2World valid? */
156 /* Device functions for the Wine driver interface */
158 typedef INT (*DEVICEFONTENUMPROC)(LPENUMLOGFONTEXW,LPNEWTEXTMETRICEXW,DWORD,
161 typedef struct tagDC_FUNCS
163 INT (*pAbortDoc)(DC*);
164 BOOL (*pAbortPath)(DC*);
165 BOOL (*pAngleArc)(DC*,INT,INT,DWORD,FLOAT,FLOAT);
166 BOOL (*pArc)(DC*,INT,INT,INT,INT,INT,INT,INT,INT);
167 BOOL (*pArcTo)(DC*,INT,INT,INT,INT,INT,INT,INT,INT);
168 BOOL (*pBeginPath)(DC*);
169 BOOL (*pBitBlt)(DC*,INT,INT,INT,INT,DC*,INT,INT,DWORD);
170 LONG (*pBitmapBits)(HBITMAP,void*,LONG,WORD);
171 INT (*pChoosePixelFormat)(DC*,const PIXELFORMATDESCRIPTOR *);
172 BOOL (*pChord)(DC*,INT,INT,INT,INT,INT,INT,INT,INT);
173 BOOL (*pCloseFigure)(DC*);
174 BOOL (*pCreateBitmap)(HBITMAP);
175 BOOL (*pCreateDC)(DC*,LPCSTR,LPCSTR,LPCSTR,const DEVMODEA*);
176 HBITMAP (*pCreateDIBSection)(DC *,BITMAPINFO *,UINT,LPVOID *,HANDLE,
178 HBITMAP16 (*pCreateDIBSection16)(DC *,BITMAPINFO *,UINT16,SEGPTR *,HANDLE,
180 BOOL (*pDeleteDC)(DC*);
181 BOOL (*pDeleteObject)(HGDIOBJ);
182 INT (*pDescribePixelFormat)(DC *,INT,UINT,PIXELFORMATDESCRIPTOR *);
183 DWORD (*pDeviceCapabilities)(LPSTR,LPCSTR,LPCSTR,WORD,LPSTR,LPDEVMODEA);
184 BOOL (*pEllipse)(DC*,INT,INT,INT,INT);
186 INT (*pEndPage)(DC*);
187 BOOL (*pEndPath)(DC*);
188 BOOL (*pEnumDeviceFonts)(HDC,LPLOGFONTW,DEVICEFONTENUMPROC,LPARAM);
189 INT (*pEscape)(DC*,INT,INT,SEGPTR,SEGPTR);
190 INT (*pExcludeClipRect)(DC*,INT,INT,INT,INT);
191 INT (*pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,
193 BOOL (*pExtFloodFill)(DC*,INT,INT,COLORREF,UINT);
194 BOOL (*pExtTextOut)(DC*,INT,INT,UINT,const RECT*,LPCWSTR,UINT,
196 BOOL (*pFillPath)(DC*);
197 BOOL (*pFillRgn)(DC*,HRGN,HBRUSH);
198 BOOL (*pFlattenPath)(DC*);
199 BOOL (*pFrameRgn)(DC*,HRGN,HBRUSH,INT,INT);
200 BOOL (*pGetCharWidth)(DC*,UINT,UINT,LPINT);
201 BOOL (*pGetDCOrgEx)(DC*,LPPOINT);
202 BOOL (*pGetDeviceGammaRamp)(DC*,LPVOID);
203 COLORREF (*pGetPixel)(DC*,INT,INT);
204 INT (*pGetPixelFormat)(DC*);
205 BOOL (*pGetTextExtentPoint)(DC*,LPCWSTR,INT,LPSIZE);
206 BOOL (*pGetTextMetrics)(DC*,TEXTMETRICW*);
207 INT (*pIntersectClipRect)(DC*,INT,INT,INT,INT);
208 BOOL (*pInvertRgn)(DC*,HRGN);
209 BOOL (*pLineTo)(DC*,INT,INT);
210 BOOL (*pMoveTo)(DC*,INT,INT);
211 INT (*pOffsetClipRgn)(DC*,INT,INT);
212 BOOL (*pOffsetViewportOrg)(DC*,INT,INT);
213 BOOL (*pOffsetWindowOrg)(DC*,INT,INT);
214 BOOL (*pPaintRgn)(DC*,HRGN);
215 BOOL (*pPatBlt)(DC*,INT,INT,INT,INT,DWORD);
216 BOOL (*pPie)(DC*,INT,INT,INT,INT,INT,INT,INT,INT);
217 BOOL (*pPolyBezier)(DC*,const POINT*,DWORD);
218 BOOL (*pPolyBezierTo)(DC*,const POINT*,DWORD);
219 BOOL (*pPolyDraw)(DC*,const POINT*,const BYTE *,DWORD);
220 BOOL (*pPolyPolygon)(DC*,const POINT*,const INT*,UINT);
221 BOOL (*pPolyPolyline)(DC*,const POINT*,const DWORD*,DWORD);
222 BOOL (*pPolygon)(DC*,const POINT*,INT);
223 BOOL (*pPolyline)(DC*,const POINT*,INT);
224 BOOL (*pPolylineTo)(DC*,const POINT*,INT);
225 UINT (*pRealizePalette)(DC*);
226 BOOL (*pRectangle)(DC*,INT,INT,INT,INT);
227 BOOL (*pRestoreDC)(DC*,INT);
228 BOOL (*pRoundRect)(DC*,INT,INT,INT,INT,INT,INT);
230 BOOL (*pScaleViewportExt)(DC*,INT,INT,INT,INT);
231 BOOL (*pScaleWindowExt)(DC*,INT,INT,INT,INT);
232 BOOL (*pSelectClipPath)(DC*,INT);
233 INT (*pSelectClipRgn)(DC*,HRGN);
234 HANDLE (*pSelectObject)(DC*,HANDLE);
235 HPALETTE (*pSelectPalette)(DC*,HPALETTE,BOOL);
236 COLORREF (*pSetBkColor)(DC*,COLORREF);
237 INT (*pSetBkMode)(DC*,INT);
238 VOID (*pSetDeviceClipping)(DC*);
239 BOOL (*pSetDeviceGammaRamp)(DC*,LPVOID);
240 INT (*pSetDIBitsToDevice)(DC*,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,
241 LPCVOID,const BITMAPINFO*,UINT);
242 INT (*pSetMapMode)(DC*,INT);
243 DWORD (*pSetMapperFlags)(DC*,DWORD);
244 COLORREF (*pSetPixel)(DC*,INT,INT,COLORREF);
245 BOOL (*pSetPixelFormat)(DC*,INT,const PIXELFORMATDESCRIPTOR *);
246 INT (*pSetPolyFillMode)(DC*,INT);
247 INT (*pSetROP2)(DC*,INT);
248 INT (*pSetRelAbs)(DC*,INT);
249 INT (*pSetStretchBltMode)(DC*,INT);
250 UINT (*pSetTextAlign)(DC*,UINT);
251 INT (*pSetTextCharacterExtra)(DC*,INT);
252 DWORD (*pSetTextColor)(DC*,DWORD);
253 INT (*pSetTextJustification)(DC*,INT,INT);
254 BOOL (*pSetViewportExt)(DC*,INT,INT);
255 BOOL (*pSetViewportOrg)(DC*,INT,INT);
256 BOOL (*pSetWindowExt)(DC*,INT,INT);
257 BOOL (*pSetWindowOrg)(DC*,INT,INT);
258 INT (*pStartDoc)(DC*,const DOCINFOA*);
259 INT (*pStartPage)(DC*);
260 BOOL (*pStretchBlt)(DC*,INT,INT,INT,INT,DC*,INT,INT,INT,INT,DWORD);
261 INT (*pStretchDIBits)(DC*,INT,INT,INT,INT,INT,INT,INT,INT,
262 const void *,const BITMAPINFO *,UINT,DWORD);
263 BOOL (*pStrokeAndFillPath)(DC*);
264 BOOL (*pStrokePath)(DC*);
265 BOOL (*pSwapBuffers)(DC*);
266 BOOL (*pWidenPath)(DC*);
269 /* LoadOEMResource types */
275 #define DCHC_INVALIDVISRGN 0x0001
276 #define DCHC_DELETEDC 0x0002
278 #define DCHF_INVALIDATEVISRGN 0x0001
279 #define DCHF_VALIDATEVISRGN 0x0002
282 #define DC_MEMORY 0x0001 /* It is a memory DC */
283 #define DC_SAVED 0x0002 /* It is a saved DC */
284 #define DC_DIRTY 0x0004 /* hVisRgn has to be updated */
285 #define DC_THUNKHOOK 0x0008 /* DC hook is in the 16-bit code */
287 /* Last 32 bytes are reserved for stock object handles */
288 #define GDI_HEAP_SIZE 0xffe0
290 /* First handle possible for stock objects (must be >= GDI_HEAP_SIZE) */
291 #define FIRST_STOCK_HANDLE GDI_HEAP_SIZE
293 /* Stock objects handles */
295 #define NB_STOCK_OBJECTS (DEFAULT_GUI_FONT + 1)
297 #define STOCK_WHITE_BRUSH ((HBRUSH16)(FIRST_STOCK_HANDLE+WHITE_BRUSH))
298 #define STOCK_LTGRAY_BRUSH ((HBRUSH16)(FIRST_STOCK_HANDLE+LTGRAY_BRUSH))
299 #define STOCK_GRAY_BRUSH ((HBRUSH16)(FIRST_STOCK_HANDLE+GRAY_BRUSH))
300 #define STOCK_DKGRAY_BRUSH ((HBRUSH16)(FIRST_STOCK_HANDLE+DKGRAY_BRUSH))
301 #define STOCK_BLACK_BRUSH ((HBRUSH16)(FIRST_STOCK_HANDLE+BLACK_BRUSH))
302 #define STOCK_NULL_BRUSH ((HBRUSH16)(FIRST_STOCK_HANDLE+NULL_BRUSH))
303 #define STOCK_HOLLOW_BRUSH ((HBRUSH16)(FIRST_STOCK_HANDLE+HOLLOW_BRUSH))
304 #define STOCK_WHITE_PEN ((HPEN16)(FIRST_STOCK_HANDLE+WHITE_PEN))
305 #define STOCK_BLACK_PEN ((HPEN16)(FIRST_STOCK_HANDLE+BLACK_PEN))
306 #define STOCK_NULL_PEN ((HPEN16)(FIRST_STOCK_HANDLE+NULL_PEN))
307 #define STOCK_OEM_FIXED_FONT ((HFONT16)(FIRST_STOCK_HANDLE+OEM_FIXED_FONT))
308 #define STOCK_ANSI_FIXED_FONT ((HFONT16)(FIRST_STOCK_HANDLE+ANSI_FIXED_FONT))
309 #define STOCK_ANSI_VAR_FONT ((HFONT16)(FIRST_STOCK_HANDLE+ANSI_VAR_FONT))
310 #define STOCK_SYSTEM_FONT ((HFONT16)(FIRST_STOCK_HANDLE+SYSTEM_FONT))
311 #define STOCK_DEVICE_DEFAULT_FONT ((HFONT16)(FIRST_STOCK_HANDLE+DEVICE_DEFAULT_FONT))
312 #define STOCK_DEFAULT_PALETTE ((HPALETTE16)(FIRST_STOCK_HANDLE+DEFAULT_PALETTE))
313 #define STOCK_SYSTEM_FIXED_FONT ((HFONT16)(FIRST_STOCK_HANDLE+SYSTEM_FIXED_FONT))
314 #define STOCK_DEFAULT_GUI_FONT ((HFONT16)(FIRST_STOCK_HANDLE+DEFAULT_GUI_FONT))
316 #define FIRST_STOCK_FONT STOCK_OEM_FIXED_FONT
317 #define LAST_STOCK_FONT STOCK_DEFAULT_GUI_FONT
319 #define LAST_STOCK_HANDLE ((DWORD)STOCK_DEFAULT_GUI_FONT)
321 extern HBITMAP hPseudoStockBitmap;
323 /* Device <-> logical coords conversion */
325 /* A floating point version of the POINT structure */
326 typedef struct tagFLOAT_POINT
331 /* Rounds a floating point number to integer. The world-to-viewport
332 * transformation process is done in floating point internally. This function
333 * is then used to round these coordinates to integer values.
335 static inline INT WINE_UNUSED GDI_ROUND(FLOAT val)
337 return (int)floor(val + 0.5);
340 /* Performs a viewport-to-world transformation on the specified point (which
341 * is in floating point format). Returns TRUE if successful, else FALSE.
343 static inline BOOL WINE_UNUSED INTERNAL_DPTOLP_FLOAT(DC *dc, FLOAT_POINT *point)
347 /* Check that the viewport-to-world transformation is valid */
348 if (!dc->vport2WorldValid)
351 /* Perform the transformation */
354 point->x = x * dc->xformVport2World.eM11 +
355 y * dc->xformVport2World.eM21 +
356 dc->xformVport2World.eDx;
357 point->y = x * dc->xformVport2World.eM12 +
358 y * dc->xformVport2World.eM22 +
359 dc->xformVport2World.eDy;
364 /* Performs a viewport-to-world transformation on the specified point (which
365 * is in integer format). Returns TRUE if successful, else FALSE.
367 static inline BOOL WINE_UNUSED INTERNAL_DPTOLP(DC *dc, LPPOINT point)
369 FLOAT_POINT floatPoint;
371 /* Perform operation with floating point */
372 floatPoint.x=(FLOAT)point->x;
373 floatPoint.y=(FLOAT)point->y;
374 if (!INTERNAL_DPTOLP_FLOAT(dc, &floatPoint))
377 /* Round to integers */
378 point->x = GDI_ROUND(floatPoint.x);
379 point->y = GDI_ROUND(floatPoint.y);
384 /* Performs a world-to-viewport transformation on the specified point (which
385 * is in floating point format).
387 static inline void WINE_UNUSED INTERNAL_LPTODP_FLOAT(DC *dc, FLOAT_POINT *point)
391 /* Perform the transformation */
394 point->x = x * dc->xformWorld2Vport.eM11 +
395 y * dc->xformWorld2Vport.eM21 +
396 dc->xformWorld2Vport.eDx;
397 point->y = x * dc->xformWorld2Vport.eM12 +
398 y * dc->xformWorld2Vport.eM22 +
399 dc->xformWorld2Vport.eDy;
402 /* Performs a world-to-viewport transformation on the specified point (which
403 * is in integer format).
405 static inline void WINE_UNUSED INTERNAL_LPTODP(DC *dc, LPPOINT point)
407 FLOAT_POINT floatPoint;
409 /* Perform operation with floating point */
410 floatPoint.x=(FLOAT)point->x;
411 floatPoint.y=(FLOAT)point->y;
412 INTERNAL_LPTODP_FLOAT(dc, &floatPoint);
414 /* Round to integers */
415 point->x = GDI_ROUND(floatPoint.x);
416 point->y = GDI_ROUND(floatPoint.y);
420 /* Performs a world-to-viewport transformation on the specified point (which
421 * is in integer format).
423 static inline INT WINE_UNUSED INTERNAL_XWPTODP(DC *dc, INT x, INT y)
425 FLOAT_POINT floatPoint;
427 /* Perform operation with floating point */
428 floatPoint.x=(FLOAT)x;
429 floatPoint.y=(FLOAT)y;
430 INTERNAL_LPTODP_FLOAT(dc, &floatPoint);
432 /* Round to integers */
433 return GDI_ROUND(floatPoint.x);
436 /* Performs a world-to-viewport transformation on the specified point (which
437 * is in integer format).
439 static inline INT WINE_UNUSED INTERNAL_YWPTODP(DC *dc, INT x, INT y)
441 FLOAT_POINT floatPoint;
443 /* Perform operation with floating point */
444 floatPoint.x=(FLOAT)x;
445 floatPoint.y=(FLOAT)y;
446 INTERNAL_LPTODP_FLOAT(dc, &floatPoint);
448 /* Round to integers */
449 return GDI_ROUND(floatPoint.y);
453 /* Performs a viewport-to-world transformation on the specified point (which
454 * is in integer format).
456 static inline INT WINE_UNUSED INTERNAL_XDPTOWP(DC *dc, INT x, INT y)
458 FLOAT_POINT floatPoint;
460 /* Perform operation with floating point */
461 floatPoint.x=(FLOAT)x;
462 floatPoint.y=(FLOAT)y;
463 INTERNAL_DPTOLP_FLOAT(dc, &floatPoint);
465 /* Round to integers */
466 return GDI_ROUND(floatPoint.x);
469 /* Performs a viewport-to-world transformation on the specified point (which
470 * is in integer format).
472 static inline INT WINE_UNUSED INTERNAL_YDPTOWP(DC *dc, INT x, INT y)
474 FLOAT_POINT floatPoint;
476 /* Perform operation with floating point */
477 floatPoint.x=(FLOAT)x;
478 floatPoint.y=(FLOAT)y;
479 INTERNAL_DPTOLP_FLOAT(dc, &floatPoint);
481 /* Round to integers */
482 return GDI_ROUND(floatPoint.y);
486 #define XDPTOLP(dc,x) \
487 (MulDiv(((x)-(dc)->vportOrgX), (dc)->wndExtX, (dc)->vportExtX) + (dc)->wndOrgX)
488 #define YDPTOLP(dc,y) \
489 (MulDiv(((y)-(dc)->vportOrgY), (dc)->wndExtY, (dc)->vportExtY) + (dc)->wndOrgY)
490 #define XLPTODP(dc,x) \
491 (MulDiv(((x)-(dc)->wndOrgX), (dc)->vportExtX, (dc)->wndExtX) + (dc)->vportOrgX)
492 #define YLPTODP(dc,y) \
493 (MulDiv(((y)-(dc)->wndOrgY), (dc)->vportExtY, (dc)->wndExtY) + (dc)->vportOrgY)
497 /* World -> Device size conversion */
499 /* Performs a world-to-viewport transformation on the specified width (which
500 * is in floating point format).
502 static inline void WINE_UNUSED INTERNAL_XWSTODS_FLOAT(DC *dc, FLOAT *width)
504 /* Perform the transformation */
505 *width = *width * dc->xformWorld2Vport.eM11;
508 /* Performs a world-to-viewport transformation on the specified width (which
509 * is in integer format).
511 static inline INT WINE_UNUSED INTERNAL_XWSTODS(DC *dc, INT width)
515 /* Perform operation with floating point */
516 floatWidth = (FLOAT)width;
517 INTERNAL_XWSTODS_FLOAT(dc, &floatWidth);
519 /* Round to integers */
520 return GDI_ROUND(floatWidth);
524 /* Performs a world-to-viewport transformation on the specified size (which
525 * is in floating point format).
527 static inline void WINE_UNUSED INTERNAL_YWSTODS_FLOAT(DC *dc, FLOAT *height)
529 /* Perform the transformation */
530 *height = *height * dc->xformWorld2Vport.eM22;
533 /* Performs a world-to-viewport transformation on the specified size (which
534 * is in integer format).
536 static inline INT WINE_UNUSED INTERNAL_YWSTODS(DC *dc, INT height)
540 /* Perform operation with floating point */
541 floatHeight = (FLOAT)height;
542 INTERNAL_XWSTODS_FLOAT(dc, &floatHeight);
544 /* Round to integers */
545 return GDI_ROUND(floatHeight);
549 /* Device <-> logical size conversion */
551 #define XDSTOLS(dc,x) \
552 MulDiv((x), (dc)->wndExtX, (dc)->vportExtX)
553 #define YDSTOLS(dc,y) \
554 MulDiv((y), (dc)->wndExtY, (dc)->vportExtY)
555 #define XLSTODS(dc,x) \
556 MulDiv((x), (dc)->vportExtX, (dc)->wndExtX)
557 #define YLSTODS(dc,y) \
558 MulDiv((y), (dc)->vportExtY, (dc)->wndExtY)
562 extern BOOL GDI_Init(void);
563 extern void *GDI_AllocObject( WORD, WORD, HGDIOBJ * );
564 extern void *GDI_ReallocObject( WORD, HGDIOBJ, void *obj );
565 extern BOOL GDI_FreeObject( HGDIOBJ, void *obj );
566 extern void *GDI_GetObjPtr( HGDIOBJ, WORD );
567 extern void GDI_ReleaseObj( HGDIOBJ );
569 extern BOOL DRIVER_RegisterDriver( LPCSTR name, const DC_FUNCTIONS *funcs );
570 extern const DC_FUNCTIONS *DRIVER_FindDriver( LPCSTR name );
571 extern BOOL DRIVER_UnregisterDriver( LPCSTR name );
572 extern BOOL DRIVER_GetDriverName( LPCSTR device, LPSTR driver, DWORD size );
574 extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut );
576 extern DC * DC_AllocDC( const DC_FUNCTIONS *funcs );
577 extern DC * DC_GetDCPtr( HDC hdc );
578 extern DC * DC_GetDCUpdate( HDC hdc );
579 extern void DC_InitDC( DC * dc );
580 extern void DC_UpdateXforms( DC * dc );
583 #define CLIP_INTERSECT 0x0001
584 #define CLIP_EXCLUDE 0x0002
585 #define CLIP_KEEPRGN 0x0004
587 /* objects/clipping.c */
588 INT CLIPPING_IntersectClipRect( DC * dc, INT left, INT top,
589 INT right, INT bottom, UINT flags );
590 INT CLIPPING_IntersectVisRect( DC * dc, INT left, INT top,
591 INT right, INT bottom, BOOL exclude );
592 extern void CLIPPING_UpdateGCRegion( DC * dc );
594 #endif /* __WINE_GDI_H */