riched20: Fix one more memory leak.
[wine] / dlls / gdi32 / gdi_private.h
1 /*
2  * GDI definitions
3  *
4  * Copyright 1993 Alexandre Julliard
5  *
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.
10  *
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.
15  *
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #ifndef __WINE_GDI_PRIVATE_H
22 #define __WINE_GDI_PRIVATE_H
23
24 /* Metafile defines */
25 #define META_EOF 0x0000
26 /* values of mtType in METAHEADER.  Note however that the disk image of a disk
27    based metafile has mtType == 1 */
28 #define METAFILE_MEMORY 1
29 #define METAFILE_DISK   2
30 #define MFHEADERSIZE (sizeof(METAHEADER))
31 #define MFVERSION 0x300
32
33 typedef struct {
34     EMR   emr;
35     INT   nBreakExtra;
36     INT   nBreakCount;
37 } EMRSETTEXTJUSTIFICATION, *PEMRSETTEXTJUSTIFICATION;
38
39 /* extra stock object: default 1x1 bitmap for memory DCs */
40 #define DEFAULT_BITMAP (STOCK_LAST+1)
41
42 struct gdi_obj_funcs
43 {
44     HGDIOBJ (*pSelectObject)( HGDIOBJ handle, void *obj, HDC hdc );
45     INT     (*pGetObject16)( HGDIOBJ handle, void *obj, INT count, LPVOID buffer );
46     INT     (*pGetObjectA)( HGDIOBJ handle, void *obj, INT count, LPVOID buffer );
47     INT     (*pGetObjectW)( HGDIOBJ handle, void *obj, INT count, LPVOID buffer );
48     BOOL    (*pUnrealizeObject)( HGDIOBJ handle, void *obj );
49     BOOL    (*pDeleteObject)( HGDIOBJ handle, void *obj );
50 };
51
52 struct hdc_list
53 {
54     HDC hdc;
55     struct hdc_list *next;
56 };
57
58 /* Device functions for the Wine driver interface */
59
60 typedef struct { int opaque; } *PHYSDEV;  /* PHYSDEV is an opaque pointer */
61
62 typedef struct tagDC_FUNCS
63 {
64     INT      (*pAbortDoc)(PHYSDEV);
65     BOOL     (*pAbortPath)(PHYSDEV);
66     BOOL     (*pAlphaBlend)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,BLENDFUNCTION);
67     BOOL     (*pAngleArc)(PHYSDEV,INT,INT,DWORD,FLOAT,FLOAT);
68     BOOL     (*pArc)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
69     BOOL     (*pArcTo)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
70     BOOL     (*pBeginPath)(PHYSDEV);
71     BOOL     (*pBitBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,DWORD);
72     INT      (*pChoosePixelFormat)(PHYSDEV,const PIXELFORMATDESCRIPTOR *);
73     BOOL     (*pChord)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
74     BOOL     (*pCloseFigure)(PHYSDEV);
75     BOOL     (*pCreateBitmap)(PHYSDEV,HBITMAP,LPVOID);
76     BOOL     (*pCreateDC)(HDC,PHYSDEV *,LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODEW*);
77     HBITMAP  (*pCreateDIBSection)(PHYSDEV,HBITMAP,const BITMAPINFO *,UINT);
78     BOOL     (*pDeleteBitmap)(HBITMAP);
79     BOOL     (*pDeleteDC)(PHYSDEV);
80     BOOL     (*pDeleteObject)(PHYSDEV,HGDIOBJ);
81     INT      (*pDescribePixelFormat)(PHYSDEV,INT,UINT,PIXELFORMATDESCRIPTOR *);
82     DWORD    (*pDeviceCapabilities)(LPSTR,LPCSTR,LPCSTR,WORD,LPSTR,LPDEVMODEA);
83     BOOL     (*pEllipse)(PHYSDEV,INT,INT,INT,INT);
84     INT      (*pEndDoc)(PHYSDEV);
85     INT      (*pEndPage)(PHYSDEV);
86     BOOL     (*pEndPath)(PHYSDEV);
87     BOOL     (*pEnumDeviceFonts)(PHYSDEV,LPLOGFONTW,FONTENUMPROCW,LPARAM);
88     INT      (*pExcludeClipRect)(PHYSDEV,INT,INT,INT,INT);
89     INT      (*pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD);
90     INT      (*pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID);
91     BOOL     (*pExtFloodFill)(PHYSDEV,INT,INT,COLORREF,UINT);
92     INT      (*pExtSelectClipRgn)(PHYSDEV,HRGN,INT);
93     BOOL     (*pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*);
94     BOOL     (*pFillPath)(PHYSDEV);
95     BOOL     (*pFillRgn)(PHYSDEV,HRGN,HBRUSH);
96     BOOL     (*pFlattenPath)(PHYSDEV);
97     BOOL     (*pFrameRgn)(PHYSDEV,HRGN,HBRUSH,INT,INT);
98     BOOL     (*pGdiComment)(PHYSDEV,UINT,CONST BYTE*);
99     LONG     (*pGetBitmapBits)(HBITMAP,void*,LONG);
100     BOOL     (*pGetCharWidth)(PHYSDEV,UINT,UINT,LPINT);
101     BOOL     (*pGetDCOrgEx)(PHYSDEV,LPPOINT);
102     UINT     (*pGetDIBColorTable)(PHYSDEV,UINT,UINT,RGBQUAD*);
103     INT      (*pGetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPVOID,BITMAPINFO*,UINT);
104     INT      (*pGetDeviceCaps)(PHYSDEV,INT);
105     BOOL     (*pGetDeviceGammaRamp)(PHYSDEV,LPVOID);
106     COLORREF (*pGetNearestColor)(PHYSDEV,COLORREF);
107     COLORREF (*pGetPixel)(PHYSDEV,INT,INT);
108     INT      (*pGetPixelFormat)(PHYSDEV);
109     UINT     (*pGetSystemPaletteEntries)(PHYSDEV,UINT,UINT,LPPALETTEENTRY);
110     BOOL     (*pGetTextExtentExPoint)(PHYSDEV,LPCWSTR,INT,INT,LPINT,LPINT,LPSIZE);
111     BOOL     (*pGetTextMetrics)(PHYSDEV,TEXTMETRICW*);
112     INT      (*pIntersectClipRect)(PHYSDEV,INT,INT,INT,INT);
113     BOOL     (*pInvertRgn)(PHYSDEV,HRGN);
114     BOOL     (*pLineTo)(PHYSDEV,INT,INT);
115     BOOL     (*pModifyWorldTransform)(PHYSDEV,const XFORM*,INT);
116     BOOL     (*pMoveTo)(PHYSDEV,INT,INT);
117     INT      (*pOffsetClipRgn)(PHYSDEV,INT,INT);
118     INT      (*pOffsetViewportOrg)(PHYSDEV,INT,INT);
119     INT      (*pOffsetWindowOrg)(PHYSDEV,INT,INT);
120     BOOL     (*pPaintRgn)(PHYSDEV,HRGN);
121     BOOL     (*pPatBlt)(PHYSDEV,INT,INT,INT,INT,DWORD);
122     BOOL     (*pPie)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
123     BOOL     (*pPolyBezier)(PHYSDEV,const POINT*,DWORD);
124     BOOL     (*pPolyBezierTo)(PHYSDEV,const POINT*,DWORD);
125     BOOL     (*pPolyDraw)(PHYSDEV,const POINT*,const BYTE *,DWORD);
126     BOOL     (*pPolyPolygon)(PHYSDEV,const POINT*,const INT*,UINT);
127     BOOL     (*pPolyPolyline)(PHYSDEV,const POINT*,const DWORD*,DWORD);
128     BOOL     (*pPolygon)(PHYSDEV,const POINT*,INT);
129     BOOL     (*pPolyline)(PHYSDEV,const POINT*,INT);
130     BOOL     (*pPolylineTo)(PHYSDEV,const POINT*,INT);
131     UINT     (*pRealizeDefaultPalette)(PHYSDEV);
132     UINT     (*pRealizePalette)(PHYSDEV,HPALETTE,BOOL);
133     BOOL     (*pRectangle)(PHYSDEV,INT,INT,INT,INT);
134     HDC      (*pResetDC)(PHYSDEV,const DEVMODEW*);
135     BOOL     (*pRestoreDC)(PHYSDEV,INT);
136     BOOL     (*pRoundRect)(PHYSDEV,INT,INT,INT,INT,INT,INT);
137     INT      (*pSaveDC)(PHYSDEV);
138     INT      (*pScaleViewportExt)(PHYSDEV,INT,INT,INT,INT);
139     INT      (*pScaleWindowExt)(PHYSDEV,INT,INT,INT,INT);
140     HBITMAP  (*pSelectBitmap)(PHYSDEV,HBITMAP);
141     HBRUSH   (*pSelectBrush)(PHYSDEV,HBRUSH);
142     BOOL     (*pSelectClipPath)(PHYSDEV,INT);
143     HFONT    (*pSelectFont)(PHYSDEV,HFONT,HANDLE);
144     HPALETTE (*pSelectPalette)(PHYSDEV,HPALETTE,BOOL);
145     HPEN     (*pSelectPen)(PHYSDEV,HPEN);
146     INT      (*pSetArcDirection)(PHYSDEV,INT);
147     LONG     (*pSetBitmapBits)(HBITMAP,const void*,LONG);
148     COLORREF (*pSetBkColor)(PHYSDEV,COLORREF);
149     INT      (*pSetBkMode)(PHYSDEV,INT);
150     COLORREF (*pSetDCBrushColor)(PHYSDEV, COLORREF);
151     DWORD    (*pSetDCOrg)(PHYSDEV,INT,INT);
152     COLORREF (*pSetDCPenColor)(PHYSDEV, COLORREF);
153     UINT     (*pSetDIBColorTable)(PHYSDEV,UINT,UINT,const RGBQUAD*);
154     INT      (*pSetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT);
155     INT      (*pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID,
156                                    const BITMAPINFO*,UINT);
157     VOID     (*pSetDeviceClipping)(PHYSDEV,HRGN,HRGN);
158     BOOL     (*pSetDeviceGammaRamp)(PHYSDEV,LPVOID);
159     INT      (*pSetMapMode)(PHYSDEV,INT);
160     DWORD    (*pSetMapperFlags)(PHYSDEV,DWORD);
161     COLORREF (*pSetPixel)(PHYSDEV,INT,INT,COLORREF);
162     BOOL     (*pSetPixelFormat)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR *);
163     INT      (*pSetPolyFillMode)(PHYSDEV,INT);
164     INT      (*pSetROP2)(PHYSDEV,INT);
165     INT      (*pSetRelAbs)(PHYSDEV,INT);
166     INT      (*pSetStretchBltMode)(PHYSDEV,INT);
167     UINT     (*pSetTextAlign)(PHYSDEV,UINT);
168     INT      (*pSetTextCharacterExtra)(PHYSDEV,INT);
169     DWORD    (*pSetTextColor)(PHYSDEV,DWORD);
170     INT      (*pSetTextJustification)(PHYSDEV,INT,INT);
171     INT      (*pSetViewportExt)(PHYSDEV,INT,INT);
172     INT      (*pSetViewportOrg)(PHYSDEV,INT,INT);
173     INT      (*pSetWindowExt)(PHYSDEV,INT,INT);
174     INT      (*pSetWindowOrg)(PHYSDEV,INT,INT);
175     BOOL     (*pSetWorldTransform)(PHYSDEV,const XFORM*);
176     INT      (*pStartDoc)(PHYSDEV,const DOCINFOW*);
177     INT      (*pStartPage)(PHYSDEV);
178     BOOL     (*pStretchBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,DWORD);
179     INT      (*pStretchDIBits)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT,const void *,
180                                const BITMAPINFO*,UINT,DWORD);
181     BOOL     (*pStrokeAndFillPath)(PHYSDEV);
182     BOOL     (*pStrokePath)(PHYSDEV);
183     BOOL     (*pSwapBuffers)(PHYSDEV);
184     BOOL     (*pWidenPath)(PHYSDEV);
185
186     /* OpenGL32 */
187     HGLRC    (*pwglCreateContext)(PHYSDEV);
188     BOOL     (*pwglDeleteContext)(HGLRC);
189     PROC     (*pwglGetProcAddress)(LPCSTR);
190     HDC      (*pwglGetPbufferDCARB)(PHYSDEV, void*);
191     BOOL     (*pwglMakeCurrent)(PHYSDEV, HGLRC);
192     BOOL     (*pwglMakeContextCurrentARB)(PHYSDEV, PHYSDEV, HGLRC);
193     BOOL     (*pwglShareLists)(HGLRC hglrc1, HGLRC hglrc2);
194     BOOL     (*pwglUseFontBitmapsA)(PHYSDEV, DWORD, DWORD, DWORD);
195     BOOL     (*pwglUseFontBitmapsW)(PHYSDEV, DWORD, DWORD, DWORD);
196 } DC_FUNCTIONS;
197
198 /* It should not be necessary to access the contents of the GdiPath
199  * structure directly; if you find that the exported functions don't
200  * allow you to do what you want, then please place a new exported
201  * function that does this job in path.c.
202  */
203 typedef enum tagGdiPathState
204 {
205    PATH_Null,
206    PATH_Open,
207    PATH_Closed
208 } GdiPathState;
209
210 typedef struct tagGdiPath
211 {
212    GdiPathState state;
213    POINT      *pPoints;
214    BYTE         *pFlags;
215    int          numEntriesUsed, numEntriesAllocated;
216    BOOL       newStroke;
217 } GdiPath;
218
219 typedef struct tagGdiFont GdiFont;
220
221 struct saved_visrgn
222 {
223     struct saved_visrgn *next;
224     HRGN                 hrgn;
225 };
226
227 typedef struct tagDC
228 {
229     GDIOBJHDR    header;
230     HDC          hSelf;            /* Handle to this DC */
231     const struct tagDC_FUNCS *funcs; /* DC function table */
232     PHYSDEV      physDev;         /* Physical device (driver-specific) */
233     INT          saveLevel;
234     HDC          saved_dc;
235     DWORD        dwHookData;
236     FARPROC16    hookProc;         /* the original SEGPTR ... */
237     DCHOOKPROC   hookThunk;        /* ... and the thunk to call it */
238
239     INT          wndOrgX;          /* Window origin */
240     INT          wndOrgY;
241     INT          wndExtX;          /* Window extent */
242     INT          wndExtY;
243     INT          vportOrgX;        /* Viewport origin */
244     INT          vportOrgY;
245     INT          vportExtX;        /* Viewport extent */
246     INT          vportExtY;
247     FLOAT        miterLimit;
248
249     int           flags;
250     DWORD         layout;
251     HRGN          hClipRgn;      /* Clip region (may be 0) */
252     HRGN          hMetaRgn;      /* Meta region (may be 0) */
253     HRGN          hMetaClipRgn;  /* Intersection of meta and clip regions (may be 0) */
254     HRGN          hVisRgn;       /* Visible region (must never be 0) */
255     HPEN          hPen;
256     HBRUSH        hBrush;
257     HFONT         hFont;
258     HBITMAP       hBitmap;
259     HANDLE        hDevice;
260     HPALETTE      hPalette;
261
262     GdiFont      *gdiFont;
263     GdiPath       path;
264
265     WORD          ROPmode;
266     WORD          polyFillMode;
267     WORD          stretchBltMode;
268     WORD          relAbsMode;
269     WORD          backgroundMode;
270     COLORREF      backgroundColor;
271     COLORREF      textColor;
272     COLORREF      dcBrushColor;
273     COLORREF      dcPenColor;
274     short         brushOrgX;
275     short         brushOrgY;
276
277     WORD          textAlign;         /* Text alignment from SetTextAlign() */
278     INT           charExtra;         /* Spacing from SetTextCharacterExtra() */
279     INT           breakExtra;        /* breakTotalExtra / breakCount */
280     INT           breakRem;          /* breakTotalExtra % breakCount */
281     INT           MapMode;
282     INT           GraphicsMode;      /* Graphics mode */
283     ABORTPROC     pAbortProc;        /* AbortProc for Printing */
284     ABORTPROC16   pAbortProc16;
285     INT           CursPosX;          /* Current position */
286     INT           CursPosY;
287     INT           ArcDirection;
288     XFORM         xformWorld2Wnd;    /* World-to-window transformation */
289     XFORM         xformWorld2Vport;  /* World-to-viewport transformation */
290     XFORM         xformVport2World;  /* Inverse of the above transformation */
291     BOOL          vport2WorldValid;  /* Is xformVport2World valid? */
292     RECT          BoundsRect;        /* Current bounding rect */
293
294     struct saved_visrgn *saved_visrgn;
295 } DC;
296
297   /* DC flags */
298 #define DC_SAVED         0x0002   /* It is a saved DC */
299 #define DC_DIRTY         0x0004   /* hVisRgn has to be updated */
300 #define DC_BOUNDS_ENABLE 0x0008   /* Bounding rectangle tracking is enabled */
301 #define DC_BOUNDS_SET    0x0010   /* Bounding rectangle has been set */
302
303 /* Certain functions will do no further processing if the driver returns this.
304    Used by mfdrv for example. */
305 #define GDI_NO_MORE_WORK 2
306
307 /* Rounds a floating point number to integer. The world-to-viewport
308  * transformation process is done in floating point internally. This function
309  * is then used to round these coordinates to integer values.
310  */
311 static inline INT GDI_ROUND(FLOAT val)
312 {
313    return (int)floor(val + 0.5);
314 }
315
316 /* bitmap object */
317
318 typedef struct tagBITMAPOBJ
319 {
320     GDIOBJHDR           header;
321     BITMAP              bitmap;
322     SIZE                size;   /* For SetBitmapDimension() */
323     const DC_FUNCTIONS *funcs; /* DC function table */
324     /* For device-independent bitmaps: */
325     DIBSECTION         *dib;
326     SEGPTR              segptr_bits;  /* segptr to DIB bits */
327 } BITMAPOBJ;
328
329 /* bidi.c */
330
331 /* Wine_GCPW Flags */
332 /* Directionality -
333  * LOOSE means that the paragraph dir is only set if there is no strong character.
334  * FORCE means override the characters in the paragraph.
335  */
336 #define WINE_GCPW_FORCE_LTR 0
337 #define WINE_GCPW_FORCE_RTL 1
338 #define WINE_GCPW_LOOSE_LTR 2
339 #define WINE_GCPW_LOOSE_RTL 3
340 #define WINE_GCPW_DIR_MASK 3
341 extern BOOL BIDI_Reorder( LPCWSTR lpString, INT uCount, DWORD dwFlags, DWORD dwWineGCP_Flags,
342                           LPWSTR lpOutString, INT uCountOut, UINT *lpOrder );
343 extern BOOL BidiAvail;
344
345 /* bitmap.c */
346 extern HBITMAP BITMAP_CopyBitmap( HBITMAP hbitmap );
347 extern BOOL BITMAP_SetOwnerDC( HBITMAP hbitmap, DC *dc );
348 extern INT BITMAP_GetWidthBytes( INT bmWidth, INT bpp );
349
350 /* clipping.c */
351 extern void CLIPPING_UpdateGCRegion( DC * dc );
352
353 /* dc.c */
354 extern DC * DC_AllocDC( const DC_FUNCTIONS *funcs, WORD magic );
355 extern DC * DC_GetDCUpdate( HDC hdc );
356 extern DC * DC_GetDCPtr( HDC hdc );
357 extern void DC_InitDC( DC * dc );
358 extern void DC_UpdateXforms( DC * dc );
359
360 /* dib.c */
361 extern int DIB_GetDIBWidthBytes( int width, int depth );
362 extern int DIB_GetDIBImageBytes( int width, int height, int depth );
363 extern int DIB_BitmapInfoSize( const BITMAPINFO * info, WORD coloruse );
364
365 /* driver.c */
366 extern const DC_FUNCTIONS *DRIVER_load_driver( LPCWSTR name );
367 extern const DC_FUNCTIONS *DRIVER_get_driver( const DC_FUNCTIONS *funcs );
368 extern void DRIVER_release_driver( const DC_FUNCTIONS *funcs );
369 extern BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size );
370
371 /* enhmetafile.c */
372 extern HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk );
373
374 /* freetype.c */
375 extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID);
376 extern GdiFont* WineEngCreateFontInstance(DC*, HFONT);
377 extern BOOL WineEngDestroyFontInstance(HFONT handle);
378 extern DWORD WineEngEnumFonts(LPLOGFONTW, FONTENUMPROCW, LPARAM);
379 extern BOOL WineEngGetCharABCWidths(GdiFont *font, UINT firstChar,
380                                     UINT lastChar, LPABC buffer);
381 extern BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar,
382                                     UINT count, LPWORD pgi, LPABC buffer);
383 extern BOOL WineEngGetCharWidth(GdiFont*, UINT, UINT, LPINT);
384 extern DWORD WineEngGetFontData(GdiFont*, DWORD, DWORD, LPVOID, DWORD);
385 extern DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count,
386                                     LPWORD pgi, DWORD flags);
387 extern DWORD WineEngGetGlyphOutline(GdiFont*, UINT glyph, UINT format,
388                                     LPGLYPHMETRICS, DWORD buflen, LPVOID buf,
389                                     const MAT2*);
390 extern DWORD WineEngGetKerningPairs(GdiFont*, DWORD, KERNINGPAIR *);
391 extern BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph);
392 extern UINT WineEngGetOutlineTextMetrics(GdiFont*, UINT, LPOUTLINETEXTMETRICW);
393 extern UINT WineEngGetTextCharsetInfo(GdiFont *font, LPFONTSIGNATURE fs, DWORD flags);
394 extern BOOL WineEngGetTextExtentExPoint(GdiFont*, LPCWSTR, INT, INT, LPINT, LPINT, LPSIZE);
395 extern BOOL WineEngGetTextExtentPointI(GdiFont*, const WORD *, INT, LPSIZE);
396 extern INT  WineEngGetTextFace(GdiFont*, INT, LPWSTR);
397 extern BOOL WineEngGetTextMetrics(GdiFont*, LPTEXTMETRICW);
398 extern BOOL WineEngInit(void);
399 extern BOOL WineEngRemoveFontResourceEx(LPCWSTR, DWORD, PVOID);
400
401 /* gdiobj.c */
402 extern BOOL GDI_Init(void);
403 extern void *GDI_AllocObject( WORD, WORD, HGDIOBJ *, const struct gdi_obj_funcs *funcs );
404 extern void *GDI_ReallocObject( WORD, HGDIOBJ, void *obj );
405 extern BOOL GDI_FreeObject( HGDIOBJ, void *obj );
406 extern void GDI_CheckNotLock(void);
407 extern BOOL GDI_hdc_using_object(HGDIOBJ obj, HDC hdc);
408 extern BOOL GDI_hdc_not_using_object(HGDIOBJ obj, HDC hdc);
409
410 /* metafile.c */
411 extern HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh);
412 extern HMETAFILE16 MF_Create_HMETAFILE16(METAHEADER *mh);
413 extern METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mr, LPCVOID filename, BOOL unicode );
414 extern METAHEADER *MF_ReadMetaFile(HANDLE hfile);
415 extern METAHEADER *MF_LoadDiskBasedMetaFile(METAHEADER *mh);
416 extern BOOL MF_PlayMetaFile( HDC hdc, METAHEADER *mh);
417
418 /* path.c */
419
420 #define PATH_IsPathOpen(path) ((path).state==PATH_Open)
421 /* Returns TRUE if the specified path is in the open state, i.e. in the
422  * state where points will be added to the path, or FALSE otherwise. This
423  * function is implemented as a macro for performance reasons.
424  */
425
426 extern void PATH_InitGdiPath(GdiPath *pPath);
427 extern void PATH_DestroyGdiPath(GdiPath *pPath);
428 extern BOOL PATH_AssignGdiPath(GdiPath *pPathDest, const GdiPath *pPathSrc);
429
430 extern BOOL PATH_MoveTo(DC *dc);
431 extern BOOL PATH_LineTo(DC *dc, INT x, INT y);
432 extern BOOL PATH_Rectangle(DC *dc, INT x1, INT y1, INT x2, INT y2);
433 extern BOOL PATH_ExtTextOut(DC *dc, INT x, INT y, UINT flags, const RECT *lprc,
434                             LPCWSTR str, UINT count, const INT *dx);
435 extern BOOL PATH_Ellipse(DC *dc, INT x1, INT y1, INT x2, INT y2);
436 extern BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2,
437                      INT xStart, INT yStart, INT xEnd, INT yEnd, INT lines);
438 extern BOOL PATH_PolyBezierTo(DC *dc, const POINT *pt, DWORD cbCount);
439 extern BOOL PATH_PolyBezier(DC *dc, const POINT *pt, DWORD cbCount);
440 extern BOOL PATH_PolylineTo(DC *dc, const POINT *pt, DWORD cbCount);
441 extern BOOL PATH_Polyline(DC *dc, const POINT *pt, DWORD cbCount);
442 extern BOOL PATH_Polygon(DC *dc, const POINT *pt, DWORD cbCount);
443 extern BOOL PATH_PolyPolyline(DC *dc, const POINT *pt, const DWORD *counts, DWORD polylines);
444 extern BOOL PATH_PolyPolygon(DC *dc, const POINT *pt, const INT *counts, UINT polygons);
445 extern BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height);
446 extern BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags);
447
448 /* painting.c */
449 extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut );
450
451 /* palette.c */
452 extern HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg);
453 extern UINT WINAPI GDIRealizePalette( HDC hdc );
454 extern HPALETTE PALETTE_Init(void);
455
456 /* region.c */
457 extern BOOL REGION_FrameRgn( HRGN dest, HRGN src, INT x, INT y );
458
459 /* Undocumented value for DIB's iUsage: Indicates a mono DIB w/o pal enties */
460 #define DIB_PAL_MONO 2
461 #endif /* __WINE_GDI_PRIVATE_H */
462
463 BOOL WINAPI FontIsLinked(HDC);