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