2 * Definitions for Wine GDI drivers
4 * Copyright 2011 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_WINE_GDI_DRIVER_H
22 #define __WINE_WINE_GDI_DRIVER_H
26 typedef struct gdi_physdev
28 const struct gdi_dc_funcs *funcs;
29 struct gdi_physdev *next;
35 int log_x; /* original position and size, in logical coords */
39 int x; /* mapped position and size, in device coords */
43 RECT visrect; /* rectangle clipped to the visible part, in device coords */
44 DWORD layout; /* DC layout */
49 void *ptr; /* pointer to the bits */
50 BOOL is_copy; /* whether this is a copy of the bits that can be modified */
51 void (*free)(struct gdi_image_bits *); /* callback for freeing the bits */
52 void *param; /* extra parameter for callback private use */
57 INT (*pAbortDoc)(PHYSDEV);
58 BOOL (*pAbortPath)(PHYSDEV);
59 BOOL (*pAlphaBlend)(PHYSDEV,struct bitblt_coords*,PHYSDEV,struct bitblt_coords*,BLENDFUNCTION);
60 BOOL (*pAngleArc)(PHYSDEV,INT,INT,DWORD,FLOAT,FLOAT);
61 BOOL (*pArc)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
62 BOOL (*pArcTo)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
63 BOOL (*pBeginPath)(PHYSDEV);
64 DWORD (*pBlendImage)(PHYSDEV,BITMAPINFO*,const struct gdi_image_bits*,struct bitblt_coords*,struct bitblt_coords*,BLENDFUNCTION);
65 INT (*pChoosePixelFormat)(PHYSDEV,const PIXELFORMATDESCRIPTOR *);
66 BOOL (*pChord)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
67 BOOL (*pCloseFigure)(PHYSDEV);
68 BOOL (*pCreateBitmap)(PHYSDEV,HBITMAP);
69 BOOL (*pCreateCompatibleDC)(PHYSDEV,PHYSDEV*);
70 BOOL (*pCreateDC)(PHYSDEV*,LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODEW*);
71 HBITMAP (*pCreateDIBSection)(PHYSDEV,HBITMAP,BITMAPINFO *,UINT);
72 BOOL (*pDeleteBitmap)(HBITMAP);
73 BOOL (*pDeleteDC)(PHYSDEV);
74 BOOL (*pDeleteObject)(PHYSDEV,HGDIOBJ);
75 INT (*pDescribePixelFormat)(PHYSDEV,INT,UINT,PIXELFORMATDESCRIPTOR *);
76 DWORD (*pDeviceCapabilities)(LPSTR,LPCSTR,LPCSTR,WORD,LPSTR,LPDEVMODEA);
77 BOOL (*pEllipse)(PHYSDEV,INT,INT,INT,INT);
78 INT (*pEndDoc)(PHYSDEV);
79 INT (*pEndPage)(PHYSDEV);
80 BOOL (*pEndPath)(PHYSDEV);
81 BOOL (*pEnumFonts)(PHYSDEV,LPLOGFONTW,FONTENUMPROCW,LPARAM);
82 INT (*pEnumICMProfiles)(PHYSDEV,ICMENUMPROCW,LPARAM);
83 INT (*pExcludeClipRect)(PHYSDEV,INT,INT,INT,INT);
84 INT (*pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD);
85 INT (*pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID);
86 BOOL (*pExtFloodFill)(PHYSDEV,INT,INT,COLORREF,UINT);
87 INT (*pExtSelectClipRgn)(PHYSDEV,HRGN,INT);
88 BOOL (*pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*);
89 BOOL (*pFillPath)(PHYSDEV);
90 BOOL (*pFillRgn)(PHYSDEV,HRGN,HBRUSH);
91 BOOL (*pFlattenPath)(PHYSDEV);
92 BOOL (*pFontIsLinked)(PHYSDEV);
93 BOOL (*pFrameRgn)(PHYSDEV,HRGN,HBRUSH,INT,INT);
94 BOOL (*pGdiComment)(PHYSDEV,UINT,CONST BYTE*);
95 BOOL (*pGdiRealizationInfo)(PHYSDEV,void*);
96 BOOL (*pGetCharABCWidths)(PHYSDEV,UINT,UINT,LPABC);
97 BOOL (*pGetCharABCWidthsI)(PHYSDEV,UINT,UINT,WORD*,LPABC);
98 BOOL (*pGetCharWidth)(PHYSDEV,UINT,UINT,LPINT);
99 INT (*pGetDeviceCaps)(PHYSDEV,INT);
100 BOOL (*pGetDeviceGammaRamp)(PHYSDEV,LPVOID);
101 DWORD (*pGetFontData)(PHYSDEV,DWORD,DWORD,LPVOID,DWORD);
102 DWORD (*pGetFontUnicodeRanges)(PHYSDEV,LPGLYPHSET);
103 DWORD (*pGetGlyphIndices)(PHYSDEV,LPCWSTR,INT,LPWORD,DWORD);
104 DWORD (*pGetGlyphOutline)(PHYSDEV,UINT,UINT,LPGLYPHMETRICS,DWORD,LPVOID,const MAT2*);
105 BOOL (*pGetICMProfile)(PHYSDEV,LPDWORD,LPWSTR);
106 DWORD (*pGetImage)(PHYSDEV,HBITMAP,BITMAPINFO*,struct gdi_image_bits*,struct bitblt_coords*);
107 DWORD (*pGetKerningPairs)(PHYSDEV,DWORD,LPKERNINGPAIR);
108 COLORREF (*pGetNearestColor)(PHYSDEV,COLORREF);
109 UINT (*pGetOutlineTextMetrics)(PHYSDEV,UINT,LPOUTLINETEXTMETRICW);
110 COLORREF (*pGetPixel)(PHYSDEV,INT,INT);
111 INT (*pGetPixelFormat)(PHYSDEV);
112 UINT (*pGetSystemPaletteEntries)(PHYSDEV,UINT,UINT,LPPALETTEENTRY);
113 UINT (*pGetTextCharsetInfo)(PHYSDEV,LPFONTSIGNATURE,DWORD);
114 BOOL (*pGetTextExtentExPoint)(PHYSDEV,LPCWSTR,INT,INT,LPINT,LPINT,LPSIZE);
115 BOOL (*pGetTextExtentExPointI)(PHYSDEV,const WORD*,INT,INT,LPINT,LPINT,LPSIZE);
116 INT (*pGetTextFace)(PHYSDEV,INT,LPWSTR);
117 BOOL (*pGetTextMetrics)(PHYSDEV,TEXTMETRICW*);
118 BOOL (*pGradientFill)(PHYSDEV,TRIVERTEX*,ULONG,void*,ULONG,ULONG);
119 INT (*pIntersectClipRect)(PHYSDEV,INT,INT,INT,INT);
120 BOOL (*pInvertRgn)(PHYSDEV,HRGN);
121 BOOL (*pLineTo)(PHYSDEV,INT,INT);
122 BOOL (*pModifyWorldTransform)(PHYSDEV,const XFORM*,DWORD);
123 BOOL (*pMoveTo)(PHYSDEV,INT,INT);
124 INT (*pOffsetClipRgn)(PHYSDEV,INT,INT);
125 BOOL (*pOffsetViewportOrgEx)(PHYSDEV,INT,INT,POINT*);
126 BOOL (*pOffsetWindowOrgEx)(PHYSDEV,INT,INT,POINT*);
127 BOOL (*pPaintRgn)(PHYSDEV,HRGN);
128 BOOL (*pPatBlt)(PHYSDEV,struct bitblt_coords*,DWORD);
129 BOOL (*pPie)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
130 BOOL (*pPolyBezier)(PHYSDEV,const POINT*,DWORD);
131 BOOL (*pPolyBezierTo)(PHYSDEV,const POINT*,DWORD);
132 BOOL (*pPolyDraw)(PHYSDEV,const POINT*,const BYTE *,DWORD);
133 BOOL (*pPolyPolygon)(PHYSDEV,const POINT*,const INT*,UINT);
134 BOOL (*pPolyPolyline)(PHYSDEV,const POINT*,const DWORD*,DWORD);
135 BOOL (*pPolygon)(PHYSDEV,const POINT*,INT);
136 BOOL (*pPolyline)(PHYSDEV,const POINT*,INT);
137 BOOL (*pPolylineTo)(PHYSDEV,const POINT*,INT);
138 DWORD (*pPutImage)(PHYSDEV,HBITMAP,HRGN,BITMAPINFO*,const struct gdi_image_bits*,struct bitblt_coords*,struct bitblt_coords*,DWORD);
139 UINT (*pRealizeDefaultPalette)(PHYSDEV);
140 UINT (*pRealizePalette)(PHYSDEV,HPALETTE,BOOL);
141 BOOL (*pRectangle)(PHYSDEV,INT,INT,INT,INT);
142 HDC (*pResetDC)(PHYSDEV,const DEVMODEW*);
143 BOOL (*pRestoreDC)(PHYSDEV,INT);
144 BOOL (*pRoundRect)(PHYSDEV,INT,INT,INT,INT,INT,INT);
145 INT (*pSaveDC)(PHYSDEV);
146 BOOL (*pScaleViewportExtEx)(PHYSDEV,INT,INT,INT,INT,SIZE*);
147 BOOL (*pScaleWindowExtEx)(PHYSDEV,INT,INT,INT,INT,SIZE*);
148 HBITMAP (*pSelectBitmap)(PHYSDEV,HBITMAP);
149 HBRUSH (*pSelectBrush)(PHYSDEV,HBRUSH);
150 BOOL (*pSelectClipPath)(PHYSDEV,INT);
151 HFONT (*pSelectFont)(PHYSDEV,HFONT);
152 HPALETTE (*pSelectPalette)(PHYSDEV,HPALETTE,BOOL);
153 HPEN (*pSelectPen)(PHYSDEV,HPEN);
154 INT (*pSetArcDirection)(PHYSDEV,INT);
155 COLORREF (*pSetBkColor)(PHYSDEV,COLORREF);
156 INT (*pSetBkMode)(PHYSDEV,INT);
157 COLORREF (*pSetDCBrushColor)(PHYSDEV, COLORREF);
158 COLORREF (*pSetDCPenColor)(PHYSDEV, COLORREF);
159 UINT (*pSetDIBColorTable)(PHYSDEV,UINT,UINT,const RGBQUAD*);
160 INT (*pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID,BITMAPINFO*,UINT);
161 VOID (*pSetDeviceClipping)(PHYSDEV,HRGN,HRGN);
162 BOOL (*pSetDeviceGammaRamp)(PHYSDEV,LPVOID);
163 DWORD (*pSetLayout)(PHYSDEV,DWORD);
164 INT (*pSetMapMode)(PHYSDEV,INT);
165 DWORD (*pSetMapperFlags)(PHYSDEV,DWORD);
166 COLORREF (*pSetPixel)(PHYSDEV,INT,INT,COLORREF);
167 BOOL (*pSetPixelFormat)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR *);
168 INT (*pSetPolyFillMode)(PHYSDEV,INT);
169 INT (*pSetROP2)(PHYSDEV,INT);
170 INT (*pSetRelAbs)(PHYSDEV,INT);
171 INT (*pSetStretchBltMode)(PHYSDEV,INT);
172 UINT (*pSetTextAlign)(PHYSDEV,UINT);
173 INT (*pSetTextCharacterExtra)(PHYSDEV,INT);
174 COLORREF (*pSetTextColor)(PHYSDEV,COLORREF);
175 BOOL (*pSetTextJustification)(PHYSDEV,INT,INT);
176 BOOL (*pSetViewportExtEx)(PHYSDEV,INT,INT,SIZE*);
177 BOOL (*pSetViewportOrgEx)(PHYSDEV,INT,INT,POINT*);
178 BOOL (*pSetWindowExtEx)(PHYSDEV,INT,INT,SIZE*);
179 BOOL (*pSetWindowOrgEx)(PHYSDEV,INT,INT,POINT*);
180 BOOL (*pSetWorldTransform)(PHYSDEV,const XFORM*);
181 INT (*pStartDoc)(PHYSDEV,const DOCINFOW*);
182 INT (*pStartPage)(PHYSDEV);
183 BOOL (*pStretchBlt)(PHYSDEV,struct bitblt_coords*,PHYSDEV,struct bitblt_coords*,DWORD);
184 INT (*pStretchDIBits)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT,const void*,BITMAPINFO*,UINT,DWORD);
185 BOOL (*pStrokeAndFillPath)(PHYSDEV);
186 BOOL (*pStrokePath)(PHYSDEV);
187 BOOL (*pSwapBuffers)(PHYSDEV);
188 BOOL (*pUnrealizePalette)(HPALETTE);
189 BOOL (*pWidenPath)(PHYSDEV);
192 BOOL (*pwglCopyContext)(HGLRC,HGLRC,UINT);
193 HGLRC (*pwglCreateContext)(PHYSDEV);
194 HGLRC (*pwglCreateContextAttribsARB)(PHYSDEV,HGLRC,const int*);
195 BOOL (*pwglDeleteContext)(HGLRC);
196 HDC (*pwglGetPbufferDCARB)(PHYSDEV,void*);
197 PROC (*pwglGetProcAddress)(LPCSTR);
198 BOOL (*pwglMakeContextCurrentARB)(PHYSDEV,PHYSDEV,HGLRC);
199 BOOL (*pwglMakeCurrent)(PHYSDEV,HGLRC);
200 BOOL (*pwglSetPixelFormatWINE)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR*);
201 BOOL (*pwglShareLists)(HGLRC,HGLRC);
202 BOOL (*pwglUseFontBitmapsA)(PHYSDEV,DWORD,DWORD,DWORD);
203 BOOL (*pwglUseFontBitmapsW)(PHYSDEV,DWORD,DWORD,DWORD);
206 /* increment this when you change the DC function table */
207 #define WINE_GDI_DRIVER_VERSION 17
209 static inline PHYSDEV get_physdev_entry_point( PHYSDEV dev, size_t offset )
211 while (!((void **)dev->funcs)[offset / sizeof(void *)]) dev = dev->next;
215 #define GET_NEXT_PHYSDEV(dev,func) \
216 get_physdev_entry_point( (dev)->next, FIELD_OFFSET(struct gdi_dc_funcs,func))
218 static inline void push_dc_driver( PHYSDEV *dev, PHYSDEV physdev, const struct gdi_dc_funcs *funcs )
220 physdev->funcs = funcs;
221 physdev->next = *dev;
222 physdev->hdc = (*dev)->hdc;
226 static inline PHYSDEV pop_dc_driver( PHYSDEV *dev )
233 #endif /* __WINE_WINE_GDI_DRIVER_H */