2 * Mac graphics driver initialisation functions
4 * Copyright 1996 Alexandre Julliard
5 * Copyright 2011, 2012 Ken Thomases for CodeWeavers, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include "wine/debug.h"
30 #include "wine/gdi_driver.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(macdrv);
38 struct gdi_physdev dev;
41 static inline MACDRV_PDEVICE *get_macdrv_dev(PHYSDEV dev)
43 return (MACDRV_PDEVICE*)dev;
47 static const struct gdi_dc_funcs macdrv_funcs;
50 static MACDRV_PDEVICE *create_mac_physdev(void)
52 MACDRV_PDEVICE *physDev;
54 if (!(physDev = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*physDev)))) return NULL;
60 /**********************************************************************
63 static BOOL macdrv_CreateDC(PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device,
64 LPCWSTR output, const DEVMODEW* initData)
66 MACDRV_PDEVICE *physDev = create_mac_physdev();
68 TRACE("pdev %p hdc %p driver %s device %s output %s initData %p\n", pdev,
69 (*pdev)->hdc, debugstr_w(driver),debugstr_w(device), debugstr_w(output),
72 if (!physDev) return FALSE;
74 push_dc_driver(pdev, &physDev->dev, &macdrv_funcs);
79 /**********************************************************************
80 * CreateCompatibleDC (MACDRV.@)
82 static BOOL macdrv_CreateCompatibleDC(PHYSDEV orig, PHYSDEV *pdev)
84 MACDRV_PDEVICE *physDev = create_mac_physdev();
86 TRACE("orig %p orig->hdc %p pdev %p pdev->hdc %p\n", orig, (orig ? orig->hdc : NULL), pdev,
87 ((pdev && *pdev) ? (*pdev)->hdc : NULL));
89 if (!physDev) return FALSE;
91 push_dc_driver(pdev, &physDev->dev, &macdrv_funcs);
96 /**********************************************************************
99 static BOOL macdrv_DeleteDC(PHYSDEV dev)
101 MACDRV_PDEVICE *physDev = get_macdrv_dev(dev);
103 TRACE("hdc %p\n", dev->hdc);
105 HeapFree(GetProcessHeap(), 0, physDev);
110 static const struct gdi_dc_funcs macdrv_funcs =
112 NULL, /* pAbortDoc */
113 NULL, /* pAbortPath */
114 NULL, /* pAlphaBlend */
115 NULL, /* pAngleArc */
118 NULL, /* pBeginPath */
119 NULL, /* pBlendImage */
121 NULL, /* pCloseFigure */
122 macdrv_CreateCompatibleDC, /* pCreateCompatibleDC */
123 macdrv_CreateDC, /* pCreateDC */
124 macdrv_DeleteDC, /* pDeleteDC */
125 NULL, /* pDeleteObject */
126 NULL, /* pDeviceCapabilities */
131 NULL, /* pEnumFonts */
132 NULL, /* pEnumICMProfiles */
133 NULL, /* pExcludeClipRect */
134 NULL, /* pExtDeviceMode */
135 NULL, /* pExtEscape */
136 NULL, /* pExtFloodFill */
137 NULL, /* pExtSelectClipRgn */
138 NULL, /* pExtTextOut */
139 NULL, /* pFillPath */
141 NULL, /* pFlattenPath */
142 NULL, /* pFontIsLinked */
143 NULL, /* pFrameRgn */
144 NULL, /* pGdiComment */
145 NULL, /* pGdiRealizationInfo */
146 NULL, /* pGetBoundsRect */
147 NULL, /* pGetCharABCWidths */
148 NULL, /* pGetCharABCWidthsI */
149 NULL, /* pGetCharWidth */
150 NULL, /* pGetDeviceCaps */
151 NULL, /* pGetDeviceGammaRamp */
152 NULL, /* pGetFontData */
153 NULL, /* pGetFontUnicodeRanges */
154 NULL, /* pGetGlyphIndices */
155 NULL, /* pGetGlyphOutline */
156 NULL, /* pGetICMProfile */
157 NULL, /* pGetImage */
158 NULL, /* pGetKerningPairs */
159 NULL, /* pGetNearestColor */
160 NULL, /* pGetOutlineTextMetrics */
161 NULL, /* pGetPixel */
162 NULL, /* pGetSystemPaletteEntries */
163 NULL, /* pGetTextCharsetInfo */
164 NULL, /* pGetTextExtentExPoint */
165 NULL, /* pGetTextExtentExPointI */
166 NULL, /* pGetTextFace */
167 NULL, /* pGetTextMetrics */
168 NULL, /* pGradientFill */
169 NULL, /* pIntersectClipRect */
170 NULL, /* pInvertRgn */
172 NULL, /* pModifyWorldTransform */
174 NULL, /* pOffsetClipRgn */
175 NULL, /* pOffsetViewportOrg */
176 NULL, /* pOffsetWindowOrg */
177 NULL, /* pPaintRgn */
180 NULL, /* pPolyBezier */
181 NULL, /* pPolyBezierTo */
182 NULL, /* pPolyDraw */
183 NULL, /* pPolyPolygon */
184 NULL, /* pPolyPolyline */
186 NULL, /* pPolyline */
187 NULL, /* pPolylineTo */
188 NULL, /* pPutImage */
189 NULL, /* pRealizeDefaultPalette */
190 NULL, /* pRealizePalette */
191 NULL, /* pRectangle */
193 NULL, /* pRestoreDC */
194 NULL, /* pRoundRect */
196 NULL, /* pScaleViewportExt */
197 NULL, /* pScaleWindowExt */
198 NULL, /* pSelectBitmap */
199 NULL, /* pSelectBrush */
200 NULL, /* pSelectClipPath */
201 NULL, /* pSelectFont */
202 NULL, /* pSelectPalette */
203 NULL, /* pSelectPen */
204 NULL, /* pSetArcDirection */
205 NULL, /* pSetBkColor */
206 NULL, /* pSetBkMode */
207 NULL, /* pSetBoundsRect */
208 NULL, /* pSetDCBrushColor */
209 NULL, /* pSetDCPenColor */
210 NULL, /* pSetDIBitsToDevice */
211 NULL, /* pSetDeviceClipping */
212 NULL, /* pSetDeviceGammaRamp */
213 NULL, /* pSetLayout */
214 NULL, /* pSetMapMode */
215 NULL, /* pSetMapperFlags */
216 NULL, /* pSetPixel */
217 NULL, /* pSetPolyFillMode */
219 NULL, /* pSetRelAbs */
220 NULL, /* pSetStretchBltMode */
221 NULL, /* pSetTextAlign */
222 NULL, /* pSetTextCharacterExtra */
223 NULL, /* pSetTextColor */
224 NULL, /* pSetTextJustification */
225 NULL, /* pSetViewportExt */
226 NULL, /* pSetViewportOrg */
227 NULL, /* pSetWindowExt */
228 NULL, /* pSetWindowOrg */
229 NULL, /* pSetWorldTransform */
230 NULL, /* pStartDoc */
231 NULL, /* pStartPage */
232 NULL, /* pStretchBlt */
233 NULL, /* pStretchDIBits */
234 NULL, /* pStrokeAndFillPath */
235 NULL, /* pStrokePath */
236 NULL, /* pUnrealizePalette */
237 NULL, /* pWidenPath */
238 NULL, /* wine_get_wgl_driver */
239 GDI_PRIORITY_GRAPHICS_DRV /* priority */
243 /******************************************************************************
244 * macdrv_get_gdi_driver
246 const struct gdi_dc_funcs * CDECL macdrv_get_gdi_driver(unsigned int version)
248 if (version != WINE_GDI_DRIVER_VERSION)
250 ERR("version mismatch, gdi32 wants %u but winemac has %u\n", version, WINE_GDI_DRIVER_VERSION);
253 return &macdrv_funcs;