winex11: Remove obsolete escapes.
[wine] / dlls / winex11.drv / init.c
1 /*
2  * X11 graphics driver initialisation functions
3  *
4  * Copyright 1996 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 #include "config.h"
22
23 #include <stdarg.h>
24 #include <string.h>
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winreg.h"
29 #include "x11drv.h"
30 #include "ddrawi.h"
31 #include "wine/debug.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
34
35 Display *gdi_display;  /* display to use for all GDI functions */
36
37 /* a few dynamic device caps */
38 static int log_pixels_x;  /* pixels per logical inch in x direction */
39 static int log_pixels_y;  /* pixels per logical inch in y direction */
40 static int horz_size;     /* horz. size of screen in millimeters */
41 static int vert_size;     /* vert. size of screen in millimeters */
42 static int palette_size;
43 static int device_init_done;
44
45
46 static const WCHAR dpi_key_name[] = {'S','o','f','t','w','a','r','e','\\','F','o','n','t','s','\0'};
47 static const WCHAR dpi_value_name[] = {'L','o','g','P','i','x','e','l','s','\0'};
48
49 static const struct gdi_dc_funcs x11drv_funcs;
50 static const struct gdi_dc_funcs *xrender_funcs;
51
52 /******************************************************************************
53  *      get_dpi
54  *
55  * get the dpi from the registry
56  */
57 static DWORD get_dpi( void )
58 {
59     DWORD dpi = 96;
60     HKEY hkey;
61
62     if (RegOpenKeyW(HKEY_CURRENT_CONFIG, dpi_key_name, &hkey) == ERROR_SUCCESS)
63     {
64         DWORD type, size, new_dpi;
65
66         size = sizeof(new_dpi);
67         if(RegQueryValueExW(hkey, dpi_value_name, NULL, &type, (void *)&new_dpi, &size) == ERROR_SUCCESS)
68         {
69             if(type == REG_DWORD && new_dpi != 0)
70                 dpi = new_dpi;
71         }
72         RegCloseKey(hkey);
73     }
74     return dpi;
75 }
76
77 /**********************************************************************
78  *           device_init
79  *
80  * Perform initializations needed upon creation of the first device.
81  */
82 static void device_init(void)
83 {
84     device_init_done = TRUE;
85
86     /* Initialize XRender */
87     xrender_funcs = X11DRV_XRender_Init();
88
89     /* Init Xcursor */
90     X11DRV_Xcursor_Init();
91
92     palette_size = X11DRV_PALETTE_Init();
93
94     X11DRV_BITMAP_Init();
95
96     /* Initialize device caps */
97     log_pixels_x = log_pixels_y = get_dpi();
98     horz_size = MulDiv( screen_width, 254, log_pixels_x * 10 );
99     vert_size = MulDiv( screen_height, 254, log_pixels_y * 10 );
100 }
101
102 /**********************************************************************
103  *           X11DRV_GDI_Finalize
104  */
105 void X11DRV_GDI_Finalize(void)
106 {
107     X11DRV_PALETTE_Cleanup();
108     /* don't bother to close the display, it often triggers X bugs */
109     /* XCloseDisplay( gdi_display ); */
110 }
111
112
113 static X11DRV_PDEVICE *create_x11_physdev( Drawable drawable )
114 {
115     X11DRV_PDEVICE *physDev;
116
117     if (!device_init_done) device_init();
118
119     if (!(physDev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*physDev) ))) return NULL;
120
121     wine_tsx11_lock();
122     physDev->drawable = drawable;
123     physDev->gc = XCreateGC( gdi_display, drawable, 0, NULL );
124     XSetGraphicsExposures( gdi_display, physDev->gc, False );
125     XSetSubwindowMode( gdi_display, physDev->gc, IncludeInferiors );
126     XFlush( gdi_display );
127     wine_tsx11_unlock();
128     return physDev;
129 }
130
131 /**********************************************************************
132  *           X11DRV_CreateDC
133  */
134 static BOOL X11DRV_CreateDC( PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device,
135                              LPCWSTR output, const DEVMODEW* initData )
136 {
137     X11DRV_PDEVICE *physDev = create_x11_physdev( root_window );
138
139     if (!physDev) return FALSE;
140
141     physDev->depth         = screen_depth;
142     physDev->color_shifts  = &X11DRV_PALETTE_default_shifts;
143     physDev->drawable_rect = virtual_screen_rect;
144     SetRect( &physDev->dc_rect, 0, 0, virtual_screen_rect.right - virtual_screen_rect.left,
145              virtual_screen_rect.bottom - virtual_screen_rect.top );
146     push_dc_driver( pdev, &physDev->dev, &x11drv_funcs );
147     if (!xrender_funcs) return TRUE;
148     return xrender_funcs->pCreateDC( pdev, driver, device, output, initData );
149 }
150
151
152 /**********************************************************************
153  *           X11DRV_CreateCompatibleDC
154  */
155 static BOOL X11DRV_CreateCompatibleDC( PHYSDEV orig, PHYSDEV *pdev )
156 {
157     X11DRV_PDEVICE *physDev = create_x11_physdev( BITMAP_stock_phys_bitmap.pixmap );
158
159     if (!physDev) return FALSE;
160
161     if (!BITMAP_stock_phys_bitmap.hbitmap)
162         BITMAP_stock_phys_bitmap.hbitmap = GetCurrentObject( (*pdev)->hdc, OBJ_BITMAP );
163
164     physDev->bitmap = &BITMAP_stock_phys_bitmap;
165     physDev->depth  = 1;
166     SetRect( &physDev->drawable_rect, 0, 0, 1, 1 );
167     physDev->dc_rect = physDev->drawable_rect;
168     push_dc_driver( pdev, &physDev->dev, &x11drv_funcs );
169     if (orig) return TRUE;  /* we already went through Xrender if we have an orig device */
170     if (!xrender_funcs) return TRUE;
171     return xrender_funcs->pCreateCompatibleDC( NULL, pdev );
172 }
173
174
175 /**********************************************************************
176  *           X11DRV_DeleteDC
177  */
178 static BOOL X11DRV_DeleteDC( PHYSDEV dev )
179 {
180     X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
181
182     wine_tsx11_lock();
183     XFreeGC( gdi_display, physDev->gc );
184     wine_tsx11_unlock();
185     HeapFree( GetProcessHeap(), 0, physDev );
186     return TRUE;
187 }
188
189
190 void add_device_bounds( X11DRV_PDEVICE *dev, const RECT *rect )
191 {
192     RECT rc;
193
194     if (!dev->bounds) return;
195     if (dev->region && GetRgnBox( dev->region, &rc ))
196     {
197         if (IntersectRect( &rc, &rc, rect )) add_bounds_rect( dev->bounds, &rc );
198     }
199     else add_bounds_rect( dev->bounds, rect );
200 }
201
202 /***********************************************************************
203  *           X11DRV_SetBoundsRect
204  */
205 static UINT X11DRV_SetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
206 {
207     X11DRV_PDEVICE *pdev = get_x11drv_dev( dev );
208
209     if (flags & DCB_DISABLE) pdev->bounds = NULL;
210     else if (flags & DCB_ENABLE) pdev->bounds = rect;
211     return DCB_RESET;  /* we don't have device-specific bounds */
212 }
213
214
215 /***********************************************************************
216  *           GetDeviceCaps    (X11DRV.@)
217  */
218 static INT X11DRV_GetDeviceCaps( PHYSDEV dev, INT cap )
219 {
220     switch(cap)
221     {
222     case DRIVERVERSION:
223         return 0x300;
224     case TECHNOLOGY:
225         return DT_RASDISPLAY;
226     case HORZSIZE:
227         return horz_size;
228     case VERTSIZE:
229         return vert_size;
230     case HORZRES:
231         return screen_width;
232     case VERTRES:
233         return screen_height;
234     case DESKTOPHORZRES:
235         return virtual_screen_rect.right - virtual_screen_rect.left;
236     case DESKTOPVERTRES:
237         return virtual_screen_rect.bottom - virtual_screen_rect.top;
238     case BITSPIXEL:
239         return screen_bpp;
240     case PLANES:
241         return 1;
242     case NUMBRUSHES:
243         return -1;
244     case NUMPENS:
245         return -1;
246     case NUMMARKERS:
247         return 0;
248     case NUMFONTS:
249         return 0;
250     case NUMCOLORS:
251         /* MSDN: Number of entries in the device's color table, if the device has
252          * a color depth of no more than 8 bits per pixel.For devices with greater
253          * color depths, -1 is returned. */
254         return (screen_depth > 8) ? -1 : (1 << screen_depth);
255     case PDEVICESIZE:
256         return sizeof(X11DRV_PDEVICE);
257     case CURVECAPS:
258         return (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE |
259                 CC_STYLED | CC_WIDESTYLED | CC_INTERIORS | CC_ROUNDRECT);
260     case LINECAPS:
261         return (LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE |
262                 LC_STYLED | LC_WIDESTYLED | LC_INTERIORS);
263     case POLYGONALCAPS:
264         return (PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON | PC_SCANLINE |
265                 PC_WIDE | PC_STYLED | PC_WIDESTYLED | PC_INTERIORS);
266     case TEXTCAPS:
267         return (TC_OP_CHARACTER | TC_OP_STROKE | TC_CP_STROKE |
268                 TC_CR_ANY | TC_SF_X_YINDEP | TC_SA_DOUBLE | TC_SA_INTEGER |
269                 TC_SA_CONTIN | TC_UA_ABLE | TC_SO_ABLE | TC_RA_ABLE | TC_VA_ABLE);
270     case CLIPCAPS:
271         return CP_REGION;
272     case COLORRES:
273         /* The observed correspondence between BITSPIXEL and COLORRES is:
274          * BITSPIXEL: 8  -> COLORRES: 18
275          * BITSPIXEL: 16 -> COLORRES: 16
276          * BITSPIXEL: 24 -> COLORRES: 24
277          * BITSPIXEL: 32 -> COLORRES: 24 */
278         return (screen_bpp <= 8) ? 18 : min( 24, screen_bpp );
279     case RASTERCAPS:
280         return (RC_BITBLT | RC_BANDING | RC_SCALING | RC_BITMAP64 | RC_DI_BITMAP |
281                 RC_DIBTODEV | RC_BIGFONT | RC_STRETCHBLT | RC_STRETCHDIB | RC_DEVBITS |
282                 (palette_size ? RC_PALETTE : 0));
283     case SHADEBLENDCAPS:
284         return (SB_GRAD_RECT | SB_GRAD_TRI | SB_CONST_ALPHA | SB_PIXEL_ALPHA);
285     case ASPECTX:
286     case ASPECTY:
287         return 36;
288     case ASPECTXY:
289         return 51;
290     case LOGPIXELSX:
291         return log_pixels_x;
292     case LOGPIXELSY:
293         return log_pixels_y;
294     case CAPS1:
295         FIXME("(%p): CAPS1 is unimplemented, will return 0\n", dev->hdc );
296         /* please see wingdi.h for the possible bit-flag values that need
297            to be returned. */
298         return 0;
299     case SIZEPALETTE:
300         return palette_size;
301     case NUMRESERVED:
302     case PHYSICALWIDTH:
303     case PHYSICALHEIGHT:
304     case PHYSICALOFFSETX:
305     case PHYSICALOFFSETY:
306     case SCALINGFACTORX:
307     case SCALINGFACTORY:
308     case VREFRESH:
309     case BLTALIGNMENT:
310         return 0;
311     default:
312         FIXME("(%p): unsupported capability %d, will return 0\n", dev->hdc, cap );
313         return 0;
314     }
315 }
316
317
318 /**********************************************************************
319  *           ExtEscape  (X11DRV.@)
320  */
321 static INT X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_data,
322                       INT out_count, LPVOID out_data )
323 {
324     X11DRV_PDEVICE *physDev = get_x11drv_dev( dev );
325
326     switch(escape)
327     {
328     case QUERYESCSUPPORT:
329         if (in_data)
330         {
331             switch (*(const INT *)in_data)
332             {
333             case DCICOMMAND:
334                 return DD_HAL_VERSION;
335             case X11DRV_ESCAPE:
336                 return TRUE;
337             }
338         }
339         break;
340
341     case X11DRV_ESCAPE:
342         if (in_data && in_count >= sizeof(enum x11drv_escape_codes))
343         {
344             switch(*(const enum x11drv_escape_codes *)in_data)
345             {
346             case X11DRV_SET_DRAWABLE:
347                 if (in_count >= sizeof(struct x11drv_escape_set_drawable))
348                 {
349                     const struct x11drv_escape_set_drawable *data = in_data;
350                     physDev->dc_rect = data->dc_rect;
351                     physDev->drawable = data->drawable;
352                     physDev->drawable_rect = data->drawable_rect;
353                     physDev->current_pf = pixelformat_from_fbconfig_id( data->fbconfig_id );
354                     physDev->gl_drawable = data->gl_drawable;
355                     physDev->pixmap = data->pixmap;
356                     physDev->gl_copy = data->gl_copy;
357                     wine_tsx11_lock();
358                     XSetSubwindowMode( gdi_display, physDev->gc, data->mode );
359                     wine_tsx11_unlock();
360                     TRACE( "SET_DRAWABLE hdc %p drawable %lx gl_drawable %lx pf %u dc_rect %s drawable_rect %s\n",
361                            dev->hdc, physDev->drawable, physDev->gl_drawable, physDev->current_pf,
362                            wine_dbgstr_rect(&physDev->dc_rect), wine_dbgstr_rect(&physDev->drawable_rect) );
363                     return TRUE;
364                 }
365                 break;
366             case X11DRV_START_EXPOSURES:
367                 wine_tsx11_lock();
368                 XSetGraphicsExposures( gdi_display, physDev->gc, True );
369                 wine_tsx11_unlock();
370                 physDev->exposures = 0;
371                 return TRUE;
372             case X11DRV_END_EXPOSURES:
373                 if (out_count >= sizeof(HRGN))
374                 {
375                     HRGN hrgn = 0, tmp = 0;
376
377                     wine_tsx11_lock();
378                     XSetGraphicsExposures( gdi_display, physDev->gc, False );
379                     wine_tsx11_unlock();
380                     if (physDev->exposures)
381                     {
382                         for (;;)
383                         {
384                             XEvent event;
385
386                             wine_tsx11_lock();
387                             XWindowEvent( gdi_display, physDev->drawable, ~0, &event );
388                             wine_tsx11_unlock();
389                             if (event.type == NoExpose) break;
390                             if (event.type == GraphicsExpose)
391                             {
392                                 RECT rect;
393
394                                 rect.left   = event.xgraphicsexpose.x - physDev->dc_rect.left;
395                                 rect.top    = event.xgraphicsexpose.y - physDev->dc_rect.top;
396                                 rect.right  = rect.left + event.xgraphicsexpose.width;
397                                 rect.bottom = rect.top + event.xgraphicsexpose.height;
398                                 if (GetLayout( dev->hdc ) & LAYOUT_RTL)
399                                     mirror_rect( &physDev->dc_rect, &rect );
400
401                                 TRACE( "got %s count %d\n", wine_dbgstr_rect(&rect),
402                                        event.xgraphicsexpose.count );
403
404                                 if (!tmp) tmp = CreateRectRgnIndirect( &rect );
405                                 else SetRectRgn( tmp, rect.left, rect.top, rect.right, rect.bottom );
406                                 if (hrgn) CombineRgn( hrgn, hrgn, tmp, RGN_OR );
407                                 else
408                                 {
409                                     hrgn = tmp;
410                                     tmp = 0;
411                                 }
412                                 if (!event.xgraphicsexpose.count) break;
413                             }
414                             else
415                             {
416                                 ERR( "got unexpected event %d\n", event.type );
417                                 break;
418                             }
419                         }
420                         if (tmp) DeleteObject( tmp );
421                     }
422                     *(HRGN *)out_data = hrgn;
423                     return TRUE;
424                 }
425                 break;
426             case X11DRV_FLUSH_GL_DRAWABLE:
427                 flush_gl_drawable(physDev);
428                 return TRUE;
429             }
430         }
431         break;
432     }
433     return 0;
434 }
435
436
437 static const struct gdi_dc_funcs x11drv_funcs =
438 {
439     NULL,                               /* pAbortDoc */
440     NULL,                               /* pAbortPath */
441     NULL,                               /* pAlphaBlend */
442     NULL,                               /* pAngleArc */
443     X11DRV_Arc,                         /* pArc */
444     NULL,                               /* pArcTo */
445     NULL,                               /* pBeginPath */
446     NULL,                               /* pBlendImage */
447     X11DRV_ChoosePixelFormat,           /* pChoosePixelFormat */
448     X11DRV_Chord,                       /* pChord */
449     NULL,                               /* pCloseFigure */
450     X11DRV_CopyBitmap,                  /* pCopyBitmap */
451     X11DRV_CreateBitmap,                /* pCreateBitmap */
452     X11DRV_CreateCompatibleDC,          /* pCreateCompatibleDC */
453     X11DRV_CreateDC,                    /* pCreateDC */
454     X11DRV_DeleteBitmap,                /* pDeleteBitmap */
455     X11DRV_DeleteDC,                    /* pDeleteDC */
456     NULL,                               /* pDeleteObject */
457     X11DRV_DescribePixelFormat,         /* pDescribePixelFormat */
458     NULL,                               /* pDeviceCapabilities */
459     X11DRV_Ellipse,                     /* pEllipse */
460     NULL,                               /* pEndDoc */
461     NULL,                               /* pEndPage */
462     NULL,                               /* pEndPath */
463     NULL,                               /* pEnumFonts */
464     X11DRV_EnumICMProfiles,             /* pEnumICMProfiles */
465     NULL,                               /* pExcludeClipRect */
466     NULL,                               /* pExtDeviceMode */
467     X11DRV_ExtEscape,                   /* pExtEscape */
468     X11DRV_ExtFloodFill,                /* pExtFloodFill */
469     NULL,                               /* pExtSelectClipRgn */
470     NULL,                               /* pExtTextOut */
471     NULL,                               /* pFillPath */
472     NULL,                               /* pFillRgn */
473     NULL,                               /* pFlattenPath */
474     NULL,                               /* pFontIsLinked */
475     NULL,                               /* pFrameRgn */
476     NULL,                               /* pGdiComment */
477     NULL,                               /* pGdiRealizationInfo */
478     NULL,                               /* pGetBoundsRect */
479     NULL,                               /* pGetCharABCWidths */
480     NULL,                               /* pGetCharABCWidthsI */
481     NULL,                               /* pGetCharWidth */
482     X11DRV_GetDeviceCaps,               /* pGetDeviceCaps */
483     X11DRV_GetDeviceGammaRamp,          /* pGetDeviceGammaRamp */
484     NULL,                               /* pGetFontData */
485     NULL,                               /* pGetFontUnicodeRanges */
486     NULL,                               /* pGetGlyphIndices */
487     NULL,                               /* pGetGlyphOutline */
488     X11DRV_GetICMProfile,               /* pGetICMProfile */
489     X11DRV_GetImage,                    /* pGetImage */
490     NULL,                               /* pGetKerningPairs */
491     X11DRV_GetNearestColor,             /* pGetNearestColor */
492     NULL,                               /* pGetOutlineTextMetrics */
493     NULL,                               /* pGetPixel */
494     X11DRV_GetPixelFormat,              /* pGetPixelFormat */
495     X11DRV_GetSystemPaletteEntries,     /* pGetSystemPaletteEntries */
496     NULL,                               /* pGetTextCharsetInfo */
497     NULL,                               /* pGetTextExtentExPoint */
498     NULL,                               /* pGetTextExtentExPointI */
499     NULL,                               /* pGetTextFace */
500     NULL,                               /* pGetTextMetrics */
501     X11DRV_GradientFill,                /* pGradientFill */
502     NULL,                               /* pIntersectClipRect */
503     NULL,                               /* pInvertRgn */
504     X11DRV_LineTo,                      /* pLineTo */
505     NULL,                               /* pModifyWorldTransform */
506     NULL,                               /* pMoveTo */
507     NULL,                               /* pOffsetClipRgn */
508     NULL,                               /* pOffsetViewportOrg */
509     NULL,                               /* pOffsetWindowOrg */
510     X11DRV_PaintRgn,                    /* pPaintRgn */
511     X11DRV_PatBlt,                      /* pPatBlt */
512     X11DRV_Pie,                         /* pPie */
513     NULL,                               /* pPolyBezier */
514     NULL,                               /* pPolyBezierTo */
515     NULL,                               /* pPolyDraw */
516     X11DRV_PolyPolygon,                 /* pPolyPolygon */
517     X11DRV_PolyPolyline,                /* pPolyPolyline */
518     X11DRV_Polygon,                     /* pPolygon */
519     NULL,                               /* pPolyline */
520     NULL,                               /* pPolylineTo */
521     X11DRV_PutImage,                    /* pPutImage */
522     X11DRV_RealizeDefaultPalette,       /* pRealizeDefaultPalette */
523     X11DRV_RealizePalette,              /* pRealizePalette */
524     X11DRV_Rectangle,                   /* pRectangle */
525     NULL,                               /* pResetDC */
526     NULL,                               /* pRestoreDC */
527     X11DRV_RoundRect,                   /* pRoundRect */
528     NULL,                               /* pSaveDC */
529     NULL,                               /* pScaleViewportExt */
530     NULL,                               /* pScaleWindowExt */
531     X11DRV_SelectBitmap,                /* pSelectBitmap */
532     X11DRV_SelectBrush,                 /* pSelectBrush */
533     NULL,                               /* pSelectClipPath */
534     NULL,                               /* pSelectFont */
535     NULL,                               /* pSelectPalette */
536     X11DRV_SelectPen,                   /* pSelectPen */
537     NULL,                               /* pSetArcDirection */
538     NULL,                               /* pSetBkColor */
539     NULL,                               /* pSetBkMode */
540     X11DRV_SetBoundsRect,               /* pSetBoundsRect */
541     X11DRV_SetDCBrushColor,             /* pSetDCBrushColor */
542     X11DRV_SetDCPenColor,               /* pSetDCPenColor */
543     NULL,                               /* pSetDIBitsToDevice */
544     X11DRV_SetDeviceClipping,           /* pSetDeviceClipping */
545     X11DRV_SetDeviceGammaRamp,          /* pSetDeviceGammaRamp */
546     NULL,                               /* pSetLayout */
547     NULL,                               /* pSetMapMode */
548     NULL,                               /* pSetMapperFlags */
549     X11DRV_SetPixel,                    /* pSetPixel */
550     X11DRV_SetPixelFormat,              /* pSetPixelFormat */
551     NULL,                               /* pSetPolyFillMode */
552     NULL,                               /* pSetROP2 */
553     NULL,                               /* pSetRelAbs */
554     NULL,                               /* pSetStretchBltMode */
555     NULL,                               /* pSetTextAlign */
556     NULL,                               /* pSetTextCharacterExtra */
557     NULL,                               /* pSetTextColor */
558     NULL,                               /* pSetTextJustification */
559     NULL,                               /* pSetViewportExt */
560     NULL,                               /* pSetViewportOrg */
561     NULL,                               /* pSetWindowExt */
562     NULL,                               /* pSetWindowOrg */
563     NULL,                               /* pSetWorldTransform */
564     NULL,                               /* pStartDoc */
565     NULL,                               /* pStartPage */
566     X11DRV_StretchBlt,                  /* pStretchBlt */
567     NULL,                               /* pStretchDIBits */
568     NULL,                               /* pStrokeAndFillPath */
569     NULL,                               /* pStrokePath */
570     X11DRV_SwapBuffers,                 /* pSwapBuffers */
571     X11DRV_UnrealizePalette,            /* pUnrealizePalette */
572     NULL,                               /* pWidenPath */
573     X11DRV_wglCopyContext,              /* pwglCopyContext */
574     X11DRV_wglCreateContext,            /* pwglCreateContext */
575     X11DRV_wglCreateContextAttribsARB,  /* pwglCreateContextAttribsARB */
576     X11DRV_wglDeleteContext,            /* pwglDeleteContext */
577     X11DRV_wglGetPbufferDCARB,          /* pwglGetPbufferDCARB */
578     X11DRV_wglGetProcAddress,           /* pwglGetProcAddress */
579     X11DRV_wglMakeContextCurrentARB,    /* pwglMakeContextCurrentARB */
580     X11DRV_wglMakeCurrent,              /* pwglMakeCurrent */
581     X11DRV_wglSetPixelFormatWINE,       /* pwglSetPixelFormatWINE */
582     X11DRV_wglShareLists,               /* pwglShareLists */
583     X11DRV_wglUseFontBitmapsA,          /* pwglUseFontBitmapsA */
584     X11DRV_wglUseFontBitmapsW,          /* pwglUseFontBitmapsW */
585 };
586
587
588 /******************************************************************************
589  *      X11DRV_get_gdi_driver
590  */
591 const struct gdi_dc_funcs * CDECL X11DRV_get_gdi_driver( unsigned int version )
592 {
593     if (version != WINE_GDI_DRIVER_VERSION)
594     {
595         ERR( "version mismatch, gdi32 wants %u but winex11 has %u\n", version, WINE_GDI_DRIVER_VERSION );
596         return NULL;
597     }
598     return &x11drv_funcs;
599 }