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
27 typedef struct gdi_physdev
29 const struct gdi_dc_funcs
*funcs
;
30 struct gdi_physdev
*next
;
36 int log_x
; /* original position and size, in logical coords */
40 int x
; /* mapped position and size, in device coords */
44 RECT visrect
; /* rectangle clipped to the visible part, in device coords */
45 DWORD layout
; /* DC layout */
50 void *ptr
; /* pointer to the bits */
51 BOOL is_copy
; /* whether this is a copy of the bits that can be modified */
52 void (*free
)(struct gdi_image_bits
*); /* callback for freeing the bits */
53 void *param
; /* extra parameter for callback private use */
58 BITMAPINFO
*info
; /* DIB info */
59 struct gdi_image_bits bits
; /* DIB bits */
60 UINT usage
; /* color usage for DIB info */
65 INT (*pAbortDoc
)(PHYSDEV
);
66 BOOL (*pAbortPath
)(PHYSDEV
);
67 BOOL (*pAlphaBlend
)(PHYSDEV
,struct bitblt_coords
*,PHYSDEV
,struct bitblt_coords
*,BLENDFUNCTION
);
68 BOOL (*pAngleArc
)(PHYSDEV
,INT
,INT
,DWORD
,FLOAT
,FLOAT
);
69 BOOL (*pArc
)(PHYSDEV
,INT
,INT
,INT
,INT
,INT
,INT
,INT
,INT
);
70 BOOL (*pArcTo
)(PHYSDEV
,INT
,INT
,INT
,INT
,INT
,INT
,INT
,INT
);
71 BOOL (*pBeginPath
)(PHYSDEV
);
72 DWORD (*pBlendImage
)(PHYSDEV
,BITMAPINFO
*,const struct gdi_image_bits
*,struct bitblt_coords
*,struct bitblt_coords
*,BLENDFUNCTION
);
73 BOOL (*pChord
)(PHYSDEV
,INT
,INT
,INT
,INT
,INT
,INT
,INT
,INT
);
74 BOOL (*pCloseFigure
)(PHYSDEV
);
75 BOOL (*pCreateCompatibleDC
)(PHYSDEV
,PHYSDEV
*);
76 BOOL (*pCreateDC
)(PHYSDEV
*,LPCWSTR
,LPCWSTR
,LPCWSTR
,const DEVMODEW
*);
77 BOOL (*pDeleteDC
)(PHYSDEV
);
78 BOOL (*pDeleteObject
)(PHYSDEV
,HGDIOBJ
);
79 DWORD (*pDeviceCapabilities
)(LPSTR
,LPCSTR
,LPCSTR
,WORD
,LPSTR
,LPDEVMODEA
);
80 BOOL (*pEllipse
)(PHYSDEV
,INT
,INT
,INT
,INT
);
81 INT (*pEndDoc
)(PHYSDEV
);
82 INT (*pEndPage
)(PHYSDEV
);
83 BOOL (*pEndPath
)(PHYSDEV
);
84 BOOL (*pEnumFonts
)(PHYSDEV
,LPLOGFONTW
,FONTENUMPROCW
,LPARAM
);
85 INT (*pEnumICMProfiles
)(PHYSDEV
,ICMENUMPROCW
,LPARAM
);
86 INT (*pExcludeClipRect
)(PHYSDEV
,INT
,INT
,INT
,INT
);
87 INT (*pExtDeviceMode
)(LPSTR
,HWND
,LPDEVMODEA
,LPSTR
,LPSTR
,LPDEVMODEA
,LPSTR
,DWORD
);
88 INT (*pExtEscape
)(PHYSDEV
,INT
,INT
,LPCVOID
,INT
,LPVOID
);
89 BOOL (*pExtFloodFill
)(PHYSDEV
,INT
,INT
,COLORREF
,UINT
);
90 INT (*pExtSelectClipRgn
)(PHYSDEV
,HRGN
,INT
);
91 BOOL (*pExtTextOut
)(PHYSDEV
,INT
,INT
,UINT
,const RECT
*,LPCWSTR
,UINT
,const INT
*);
92 BOOL (*pFillPath
)(PHYSDEV
);
93 BOOL (*pFillRgn
)(PHYSDEV
,HRGN
,HBRUSH
);
94 BOOL (*pFlattenPath
)(PHYSDEV
);
95 BOOL (*pFontIsLinked
)(PHYSDEV
);
96 BOOL (*pFrameRgn
)(PHYSDEV
,HRGN
,HBRUSH
,INT
,INT
);
97 BOOL (*pGdiComment
)(PHYSDEV
,UINT
,CONST BYTE
*);
98 BOOL (*pGdiRealizationInfo
)(PHYSDEV
,void*);
99 UINT (*pGetBoundsRect
)(PHYSDEV
,RECT
*,UINT
);
100 BOOL (*pGetCharABCWidths
)(PHYSDEV
,UINT
,UINT
,LPABC
);
101 BOOL (*pGetCharABCWidthsI
)(PHYSDEV
,UINT
,UINT
,WORD
*,LPABC
);
102 BOOL (*pGetCharWidth
)(PHYSDEV
,UINT
,UINT
,LPINT
);
103 INT (*pGetDeviceCaps
)(PHYSDEV
,INT
);
104 BOOL (*pGetDeviceGammaRamp
)(PHYSDEV
,LPVOID
);
105 DWORD (*pGetFontData
)(PHYSDEV
,DWORD
,DWORD
,LPVOID
,DWORD
);
106 DWORD (*pGetFontUnicodeRanges
)(PHYSDEV
,LPGLYPHSET
);
107 DWORD (*pGetGlyphIndices
)(PHYSDEV
,LPCWSTR
,INT
,LPWORD
,DWORD
);
108 DWORD (*pGetGlyphOutline
)(PHYSDEV
,UINT
,UINT
,LPGLYPHMETRICS
,DWORD
,LPVOID
,const MAT2
*);
109 BOOL (*pGetICMProfile
)(PHYSDEV
,LPDWORD
,LPWSTR
);
110 DWORD (*pGetImage
)(PHYSDEV
,BITMAPINFO
*,struct gdi_image_bits
*,struct bitblt_coords
*);
111 DWORD (*pGetKerningPairs
)(PHYSDEV
,DWORD
,LPKERNINGPAIR
);
112 COLORREF (*pGetNearestColor
)(PHYSDEV
,COLORREF
);
113 UINT (*pGetOutlineTextMetrics
)(PHYSDEV
,UINT
,LPOUTLINETEXTMETRICW
);
114 COLORREF (*pGetPixel
)(PHYSDEV
,INT
,INT
);
115 UINT (*pGetSystemPaletteEntries
)(PHYSDEV
,UINT
,UINT
,LPPALETTEENTRY
);
116 UINT (*pGetTextCharsetInfo
)(PHYSDEV
,LPFONTSIGNATURE
,DWORD
);
117 BOOL (*pGetTextExtentExPoint
)(PHYSDEV
,LPCWSTR
,INT
,INT
,LPINT
,LPINT
,LPSIZE
);
118 BOOL (*pGetTextExtentExPointI
)(PHYSDEV
,const WORD
*,INT
,INT
,LPINT
,LPINT
,LPSIZE
);
119 INT (*pGetTextFace
)(PHYSDEV
,INT
,LPWSTR
);
120 BOOL (*pGetTextMetrics
)(PHYSDEV
,TEXTMETRICW
*);
121 BOOL (*pGradientFill
)(PHYSDEV
,TRIVERTEX
*,ULONG
,void*,ULONG
,ULONG
);
122 INT (*pIntersectClipRect
)(PHYSDEV
,INT
,INT
,INT
,INT
);
123 BOOL (*pInvertRgn
)(PHYSDEV
,HRGN
);
124 BOOL (*pLineTo
)(PHYSDEV
,INT
,INT
);
125 BOOL (*pModifyWorldTransform
)(PHYSDEV
,const XFORM
*,DWORD
);
126 BOOL (*pMoveTo
)(PHYSDEV
,INT
,INT
);
127 INT (*pOffsetClipRgn
)(PHYSDEV
,INT
,INT
);
128 BOOL (*pOffsetViewportOrgEx
)(PHYSDEV
,INT
,INT
,POINT
*);
129 BOOL (*pOffsetWindowOrgEx
)(PHYSDEV
,INT
,INT
,POINT
*);
130 BOOL (*pPaintRgn
)(PHYSDEV
,HRGN
);
131 BOOL (*pPatBlt
)(PHYSDEV
,struct bitblt_coords
*,DWORD
);
132 BOOL (*pPie
)(PHYSDEV
,INT
,INT
,INT
,INT
,INT
,INT
,INT
,INT
);
133 BOOL (*pPolyBezier
)(PHYSDEV
,const POINT
*,DWORD
);
134 BOOL (*pPolyBezierTo
)(PHYSDEV
,const POINT
*,DWORD
);
135 BOOL (*pPolyDraw
)(PHYSDEV
,const POINT
*,const BYTE
*,DWORD
);
136 BOOL (*pPolyPolygon
)(PHYSDEV
,const POINT
*,const INT
*,UINT
);
137 BOOL (*pPolyPolyline
)(PHYSDEV
,const POINT
*,const DWORD
*,DWORD
);
138 BOOL (*pPolygon
)(PHYSDEV
,const POINT
*,INT
);
139 BOOL (*pPolyline
)(PHYSDEV
,const POINT
*,INT
);
140 BOOL (*pPolylineTo
)(PHYSDEV
,const POINT
*,INT
);
141 DWORD (*pPutImage
)(PHYSDEV
,HRGN
,BITMAPINFO
*,const struct gdi_image_bits
*,struct bitblt_coords
*,struct bitblt_coords
*,DWORD
);
142 UINT (*pRealizeDefaultPalette
)(PHYSDEV
);
143 UINT (*pRealizePalette
)(PHYSDEV
,HPALETTE
,BOOL
);
144 BOOL (*pRectangle
)(PHYSDEV
,INT
,INT
,INT
,INT
);
145 HDC (*pResetDC
)(PHYSDEV
,const DEVMODEW
*);
146 BOOL (*pRestoreDC
)(PHYSDEV
,INT
);
147 BOOL (*pRoundRect
)(PHYSDEV
,INT
,INT
,INT
,INT
,INT
,INT
);
148 INT (*pSaveDC
)(PHYSDEV
);
149 BOOL (*pScaleViewportExtEx
)(PHYSDEV
,INT
,INT
,INT
,INT
,SIZE
*);
150 BOOL (*pScaleWindowExtEx
)(PHYSDEV
,INT
,INT
,INT
,INT
,SIZE
*);
151 HBITMAP (*pSelectBitmap
)(PHYSDEV
,HBITMAP
);
152 HBRUSH (*pSelectBrush
)(PHYSDEV
,HBRUSH
,const struct brush_pattern
*);
153 BOOL (*pSelectClipPath
)(PHYSDEV
,INT
);
154 HFONT (*pSelectFont
)(PHYSDEV
,HFONT
);
155 HPALETTE (*pSelectPalette
)(PHYSDEV
,HPALETTE
,BOOL
);
156 HPEN (*pSelectPen
)(PHYSDEV
,HPEN
,const struct brush_pattern
*);
157 INT (*pSetArcDirection
)(PHYSDEV
,INT
);
158 COLORREF (*pSetBkColor
)(PHYSDEV
,COLORREF
);
159 INT (*pSetBkMode
)(PHYSDEV
,INT
);
160 UINT (*pSetBoundsRect
)(PHYSDEV
,RECT
*,UINT
);
161 COLORREF (*pSetDCBrushColor
)(PHYSDEV
, COLORREF
);
162 COLORREF (*pSetDCPenColor
)(PHYSDEV
, COLORREF
);
163 INT (*pSetDIBitsToDevice
)(PHYSDEV
,INT
,INT
,DWORD
,DWORD
,INT
,INT
,UINT
,UINT
,LPCVOID
,BITMAPINFO
*,UINT
);
164 VOID (*pSetDeviceClipping
)(PHYSDEV
,HRGN
);
165 BOOL (*pSetDeviceGammaRamp
)(PHYSDEV
,LPVOID
);
166 DWORD (*pSetLayout
)(PHYSDEV
,DWORD
);
167 INT (*pSetMapMode
)(PHYSDEV
,INT
);
168 DWORD (*pSetMapperFlags
)(PHYSDEV
,DWORD
);
169 COLORREF (*pSetPixel
)(PHYSDEV
,INT
,INT
,COLORREF
);
170 INT (*pSetPolyFillMode
)(PHYSDEV
,INT
);
171 INT (*pSetROP2
)(PHYSDEV
,INT
);
172 INT (*pSetRelAbs
)(PHYSDEV
,INT
);
173 INT (*pSetStretchBltMode
)(PHYSDEV
,INT
);
174 UINT (*pSetTextAlign
)(PHYSDEV
,UINT
);
175 INT (*pSetTextCharacterExtra
)(PHYSDEV
,INT
);
176 COLORREF (*pSetTextColor
)(PHYSDEV
,COLORREF
);
177 BOOL (*pSetTextJustification
)(PHYSDEV
,INT
,INT
);
178 BOOL (*pSetViewportExtEx
)(PHYSDEV
,INT
,INT
,SIZE
*);
179 BOOL (*pSetViewportOrgEx
)(PHYSDEV
,INT
,INT
,POINT
*);
180 BOOL (*pSetWindowExtEx
)(PHYSDEV
,INT
,INT
,SIZE
*);
181 BOOL (*pSetWindowOrgEx
)(PHYSDEV
,INT
,INT
,POINT
*);
182 BOOL (*pSetWorldTransform
)(PHYSDEV
,const XFORM
*);
183 INT (*pStartDoc
)(PHYSDEV
,const DOCINFOW
*);
184 INT (*pStartPage
)(PHYSDEV
);
185 BOOL (*pStretchBlt
)(PHYSDEV
,struct bitblt_coords
*,PHYSDEV
,struct bitblt_coords
*,DWORD
);
186 INT (*pStretchDIBits
)(PHYSDEV
,INT
,INT
,INT
,INT
,INT
,INT
,INT
,INT
,const void*,BITMAPINFO
*,UINT
,DWORD
);
187 BOOL (*pStrokeAndFillPath
)(PHYSDEV
);
188 BOOL (*pStrokePath
)(PHYSDEV
);
189 BOOL (*pSwapBuffers
)(PHYSDEV
);
190 BOOL (*pUnrealizePalette
)(HPALETTE
);
191 BOOL (*pWidenPath
)(PHYSDEV
);
192 struct opengl_funcs
* (*wine_get_wgl_driver
)(PHYSDEV
,UINT
);
194 /* priority order for the driver on the stack */
198 /* increment this when you change the DC function table */
199 #define WINE_GDI_DRIVER_VERSION 43
201 #define GDI_PRIORITY_NULL_DRV 0 /* null driver */
202 #define GDI_PRIORITY_FONT_DRV 100 /* any font driver */
203 #define GDI_PRIORITY_GRAPHICS_DRV 200 /* any graphics driver */
204 #define GDI_PRIORITY_DIB_DRV 300 /* the DIB driver */
205 #define GDI_PRIORITY_PATH_DRV 400 /* the path driver */
207 static inline PHYSDEV
get_physdev_entry_point( PHYSDEV dev
, size_t offset
)
209 while (!((void **)dev
->funcs
)[offset
/ sizeof(void *)]) dev
= dev
->next
;
213 #define GET_NEXT_PHYSDEV(dev,func) \
214 get_physdev_entry_point( (dev)->next, FIELD_OFFSET(struct gdi_dc_funcs,func))
216 static inline void push_dc_driver( PHYSDEV
*dev
, PHYSDEV physdev
, const struct gdi_dc_funcs
*funcs
)
218 while ((*dev
)->funcs
->priority
> funcs
->priority
) dev
= &(*dev
)->next
;
219 physdev
->funcs
= funcs
;
220 physdev
->next
= *dev
;
221 physdev
->hdc
= (*dev
)->hdc
;
225 /* the DC hook support is only exported on Win16, the 32-bit version is a Wine extension */
227 #define DCHC_INVALIDVISRGN 0x0001
228 #define DCHC_DELETEDC 0x0002
229 #define DCHF_INVALIDATEVISRGN 0x0001
230 #define DCHF_VALIDATEVISRGN 0x0002
232 typedef BOOL (CALLBACK
*DCHOOKPROC
)(HDC
,WORD
,DWORD_PTR
,LPARAM
);
234 WINGDIAPI DWORD_PTR WINAPI
GetDCHook(HDC
,DCHOOKPROC
*);
235 WINGDIAPI BOOL WINAPI
SetDCHook(HDC
,DCHOOKPROC
,DWORD_PTR
);
236 WINGDIAPI WORD WINAPI
SetHookFlags(HDC
,WORD
);
238 extern void CDECL
__wine_make_gdi_object_system( HGDIOBJ handle
, BOOL set
);
239 extern void CDECL
__wine_set_visible_region( HDC hdc
, HRGN hrgn
, const RECT
*vis_rect
);
240 extern struct opengl_funcs
* CDECL
__wine_get_wgl_driver( HDC hdc
, UINT version
);
242 #endif /* __WINE_WINE_GDI_DRIVER_H */