msvcp90: Use macro to define RTTI data.
[wine] / dlls / gdi32 / dibdrv / dc.c
1 /*
2  * DIB driver initialization and DC functions.
3  *
4  * Copyright 2011 Huw Davies
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 <assert.h>
22
23 #include "gdi_private.h"
24 #include "dibdrv.h"
25
26 #include "wine/exception.h"
27 #include "wine/debug.h"
28
29 WINE_DEFAULT_DEBUG_CHANNEL(dib);
30
31 static const DWORD bit_fields_888[3] = {0xff0000, 0x00ff00, 0x0000ff};
32 static const DWORD bit_fields_555[3] = {0x7c00, 0x03e0, 0x001f};
33
34 static void calc_shift_and_len(DWORD mask, int *shift, int *len)
35 {
36     int s, l;
37
38     if(!mask)
39     {
40         *shift = *len = 0;
41         return;
42     }
43
44     s = 0;
45     while ((mask & 1) == 0)
46     {
47         mask >>= 1;
48         s++;
49     }
50     l = 0;
51     while ((mask & 1) == 1)
52     {
53         mask >>= 1;
54         l++;
55     }
56     *shift = s;
57     *len = l;
58 }
59
60 static void init_bit_fields(dib_info *dib, const DWORD *bit_fields)
61 {
62     dib->red_mask    = bit_fields[0];
63     dib->green_mask  = bit_fields[1];
64     dib->blue_mask   = bit_fields[2];
65     calc_shift_and_len(dib->red_mask,   &dib->red_shift,   &dib->red_len);
66     calc_shift_and_len(dib->green_mask, &dib->green_shift, &dib->green_len);
67     calc_shift_and_len(dib->blue_mask,  &dib->blue_shift,  &dib->blue_len);
68 }
69
70 static void init_dib_info(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD *bit_fields,
71                           const RGBQUAD *color_table, void *bits, enum dib_info_flags flags)
72 {
73     dib->bit_count    = bi->biBitCount;
74     dib->width        = bi->biWidth;
75     dib->height       = bi->biHeight;
76     dib->compression  = bi->biCompression;
77     dib->stride       = get_dib_stride( dib->width, dib->bit_count );
78     dib->bits.ptr     = bits;
79     dib->bits.is_copy = FALSE;
80     dib->bits.free    = NULL;
81     dib->bits.param   = NULL;
82
83     if(dib->height < 0) /* top-down */
84     {
85         dib->height = -dib->height;
86     }
87     else /* bottom-up */
88     {
89         /* bits always points to the top-left corner and the stride is -ve */
90         dib->bits.ptr = (BYTE*)dib->bits.ptr + (dib->height - 1) * dib->stride;
91         dib->stride  = -dib->stride;
92     }
93
94     dib->funcs = &funcs_null;
95
96     switch(dib->bit_count)
97     {
98     case 32:
99         if(bi->biCompression == BI_RGB)
100             bit_fields = bit_fields_888;
101
102         init_bit_fields(dib, bit_fields);
103
104         if(dib->red_mask == 0xff0000 && dib->green_mask == 0x00ff00 && dib->blue_mask == 0x0000ff)
105             dib->funcs = &funcs_8888;
106         else
107             dib->funcs = &funcs_32;
108         break;
109
110     case 24:
111         dib->funcs = &funcs_24;
112         break;
113
114     case 16:
115         if(bi->biCompression == BI_RGB)
116             bit_fields = bit_fields_555;
117
118         init_bit_fields(dib, bit_fields);
119
120         if(dib->red_mask == 0x7c00 && dib->green_mask == 0x03e0 && dib->blue_mask == 0x001f)
121             dib->funcs = &funcs_555;
122         else
123             dib->funcs = &funcs_16;
124         break;
125
126     case 8:
127         dib->funcs = &funcs_8;
128         break;
129
130     case 4:
131         dib->funcs = &funcs_4;
132         break;
133
134     case 1:
135         dib->funcs = &funcs_1;
136         break;
137     }
138
139     if (color_table && bi->biClrUsed)
140     {
141         dib->color_table = color_table;
142         dib->color_table_size = bi->biClrUsed;
143     }
144     else if (flags & default_color_table)
145     {
146         dib->color_table = get_default_color_table( dib->bit_count );
147         dib->color_table_size = dib->color_table ? (1 << dib->bit_count) : 0;
148     }
149     else
150     {
151         dib->color_table = NULL;
152         dib->color_table_size = 0;
153     }
154 }
155
156 void init_dib_info_from_bitmapinfo(dib_info *dib, const BITMAPINFO *info, void *bits, enum dib_info_flags flags)
157 {
158     init_dib_info( dib, &info->bmiHeader, (const DWORD *)info->bmiColors, info->bmiColors, bits, flags );
159 }
160
161 BOOL init_dib_info_from_bitmapobj(dib_info *dib, BITMAPOBJ *bmp, enum dib_info_flags flags)
162 {
163     if (!bmp->dib)
164     {
165         BITMAPINFO info;
166
167         get_ddb_bitmapinfo( bmp, &info );
168         if (!bmp->bitmap.bmBits)
169         {
170             int width_bytes = get_dib_stride( bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel );
171             bmp->bitmap.bmBits = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
172                                             bmp->bitmap.bmHeight * width_bytes );
173             if (!bmp->bitmap.bmBits) return FALSE;
174         }
175         init_dib_info_from_bitmapinfo( dib, &info, bmp->bitmap.bmBits, flags );
176     }
177     else init_dib_info( dib, &bmp->dib->dsBmih, bmp->dib->dsBitfields,
178                         bmp->color_table, bmp->dib->dsBm.bmBits, flags );
179     return TRUE;
180 }
181
182 static void clear_dib_info(dib_info *dib)
183 {
184     dib->color_table = NULL;
185     dib->bits.ptr    = NULL;
186     dib->bits.free   = NULL;
187     dib->bits.param  = NULL;
188 }
189
190 /**********************************************************************
191  *      free_dib_info
192  *
193  * Free the resources associated with a dib and optionally the bits
194  */
195 void free_dib_info(dib_info *dib)
196 {
197     if (dib->bits.free) dib->bits.free( &dib->bits );
198     clear_dib_info( dib );
199 }
200
201 void copy_dib_color_info(dib_info *dst, const dib_info *src)
202 {
203     dst->bit_count        = src->bit_count;
204     dst->red_mask         = src->red_mask;
205     dst->green_mask       = src->green_mask;
206     dst->blue_mask        = src->blue_mask;
207     dst->red_len          = src->red_len;
208     dst->green_len        = src->green_len;
209     dst->blue_len         = src->blue_len;
210     dst->red_shift        = src->red_shift;
211     dst->green_shift      = src->green_shift;
212     dst->blue_shift       = src->blue_shift;
213     dst->funcs            = src->funcs;
214     dst->color_table_size = src->color_table_size;
215     dst->color_table      = src->color_table;
216 }
217
218 DWORD convert_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bitblt_coords *src,
219                           const BITMAPINFO *dst_info, void *dst_bits, BOOL add_alpha )
220 {
221     dib_info src_dib, dst_dib;
222     DWORD ret;
223
224     init_dib_info_from_bitmapinfo( &src_dib, src_info, src_bits, default_color_table );
225     init_dib_info_from_bitmapinfo( &dst_dib, dst_info, dst_bits, default_color_table );
226
227     __TRY
228     {
229         dst_dib.funcs->convert_to( &dst_dib, &src_dib, &src->visrect );
230         ret = TRUE;
231     }
232     __EXCEPT_PAGE_FAULT
233     {
234         WARN( "invalid bits pointer %p\n", src_bits );
235         ret = FALSE;
236     }
237     __ENDTRY
238
239     /* We shared the color tables, so there's no need to free the dib_infos here */
240     if(!ret) return ERROR_BAD_FORMAT;
241
242     /* update coordinates, the destination rectangle is always stored at 0,0 */
243     src->x -= src->visrect.left;
244     src->y -= src->visrect.top;
245     offset_rect( &src->visrect, -src->visrect.left, -src->visrect.top );
246
247     if (add_alpha && dst_dib.funcs == &funcs_8888 && src_dib.funcs != &funcs_8888)
248     {
249         DWORD *pixel = dst_dib.bits.ptr;
250         int x, y;
251
252         for (y = src->visrect.top; y < src->visrect.bottom; y++, pixel += dst_dib.stride / 4)
253             for (x = src->visrect.left; x < src->visrect.right; x++)
254                 pixel[x] |= 0xff000000;
255     }
256
257     return ERROR_SUCCESS;
258 }
259
260 static void update_fg_colors( dibdrv_physdev *pdev )
261 {
262     pdev->pen_color   = get_pixel_color( pdev, pdev->pen_colorref,   TRUE );
263     pdev->brush_color = get_pixel_color( pdev, pdev->brush_colorref, TRUE );
264     pdev->text_color  = get_pixel_color( pdev, GetTextColor( pdev->dev.hdc ), TRUE );
265 }
266
267 static void update_masks( dibdrv_physdev *pdev, INT rop )
268 {
269     calc_and_xor_masks( rop, pdev->pen_color, &pdev->pen_and, &pdev->pen_xor );
270     update_brush_rop( pdev, rop );
271     if( GetBkMode( pdev->dev.hdc ) == OPAQUE )
272         calc_and_xor_masks( rop, pdev->bkgnd_color, &pdev->bkgnd_and, &pdev->bkgnd_xor );
273 }
274
275  /***********************************************************************
276  *           add_extra_clipping_region
277  *
278  * Temporarily add a region to the current clipping region.
279  * The returned region must be restored with restore_clipping_region.
280  */
281 HRGN add_extra_clipping_region( dibdrv_physdev *pdev, HRGN rgn )
282 {
283     HRGN ret, clip;
284
285     if (!(clip = CreateRectRgn( 0, 0, 0, 0 ))) return 0;
286     CombineRgn( clip, pdev->clip, rgn, RGN_AND );
287     ret = pdev->clip;
288     pdev->clip = clip;
289     return ret;
290 }
291
292 /***********************************************************************
293  *           restore_clipping_region
294  */
295 void restore_clipping_region( dibdrv_physdev *pdev, HRGN rgn )
296 {
297     if (!rgn) return;
298     DeleteObject( pdev->clip );
299     pdev->clip = rgn;
300 }
301
302 /**********************************************************************
303  *           dibdrv_CreateDC
304  */
305 static BOOL dibdrv_CreateDC( PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
306                              LPCWSTR output, const DEVMODEW *data )
307 {
308     dibdrv_physdev *pdev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pdev) );
309
310     if (!pdev) return FALSE;
311     if (!(pdev->clip = CreateRectRgn(0, 0, 0, 0)))
312     {
313         HeapFree( GetProcessHeap(), 0, pdev );
314         return FALSE;
315     }
316     clear_dib_info(&pdev->dib);
317     clear_dib_info(&pdev->brush_dib);
318     push_dc_driver( dev, &pdev->dev, &dib_driver );
319     return TRUE;
320 }
321
322 /***********************************************************************
323  *           dibdrv_DeleteDC
324  */
325 static BOOL dibdrv_DeleteDC( PHYSDEV dev )
326 {
327     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
328     TRACE("(%p)\n", dev);
329     DeleteObject(pdev->clip);
330     free_pattern_brush(pdev);
331     HeapFree( GetProcessHeap(), 0, pdev );
332     return TRUE;
333 }
334
335 /***********************************************************************
336  *           dibdrv_CopyBitmap
337  */
338 static BOOL dibdrv_CopyBitmap( HBITMAP src, HBITMAP dst )
339 {
340     return nulldrv_CopyBitmap( src, dst );
341 }
342
343 /***********************************************************************
344  *           dibdrv_DeleteBitmap
345  */
346 static BOOL dibdrv_DeleteBitmap( HBITMAP bitmap )
347 {
348     return TRUE;
349 }
350
351 /***********************************************************************
352  *           dibdrv_SelectBitmap
353  */
354 static HBITMAP dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
355 {
356     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSelectBitmap );
357     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
358     BITMAPOBJ *bmp = GDI_GetObjPtr( bitmap, OBJ_BITMAP );
359     dib_info dib;
360
361     TRACE("(%p, %p)\n", dev, bitmap);
362
363     if (!bmp) return 0;
364
365     if(!init_dib_info_from_bitmapobj(&dib, bmp, default_color_table))
366     {
367         GDI_ReleaseObj( bitmap );
368         return 0;
369     }
370     pdev->dib = dib;
371     pdev->defer = 0;
372     GDI_ReleaseObj( bitmap );
373
374     return next->funcs->pSelectBitmap( next, bitmap );
375 }
376
377 /***********************************************************************
378  *           dibdrv_SetBkColor
379  */
380 static COLORREF dibdrv_SetBkColor( PHYSDEV dev, COLORREF color )
381 {
382     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetBkColor );
383     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
384
385     pdev->bkgnd_color = get_pixel_color( pdev, color, FALSE );
386
387     if( GetBkMode(dev->hdc) == OPAQUE )
388         calc_and_xor_masks( GetROP2(dev->hdc), pdev->bkgnd_color, &pdev->bkgnd_and, &pdev->bkgnd_xor );
389     else
390     {
391         pdev->bkgnd_and = ~0u;
392         pdev->bkgnd_xor = 0;
393     }
394
395     update_fg_colors( pdev ); /* Only needed in the 1 bpp case */
396
397     return next->funcs->pSetBkColor( next, color );
398 }
399
400 /***********************************************************************
401  *           dibdrv_SetBkMode
402  */
403 static INT dibdrv_SetBkMode( PHYSDEV dev, INT mode )
404 {
405     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetBkMode );
406     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
407
408     if( mode == OPAQUE )
409         calc_and_xor_masks( GetROP2(dev->hdc), pdev->bkgnd_color, &pdev->bkgnd_and, &pdev->bkgnd_xor );
410     else
411     {
412         pdev->bkgnd_and = ~0u;
413         pdev->bkgnd_xor = 0;
414     }
415
416     return next->funcs->pSetBkMode( next, mode );
417 }
418
419 /***********************************************************************
420  *           dibdrv_SetDeviceClipping
421  */
422 static void dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn )
423 {
424     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetDeviceClipping );
425     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
426     TRACE("(%p, %p)\n", dev, rgn);
427
428     SetRectRgn( pdev->clip, 0, 0, pdev->dib.width, pdev->dib.height );
429     if (rgn) CombineRgn( pdev->clip, pdev->clip, rgn, RGN_AND );
430     return next->funcs->pSetDeviceClipping( next, rgn );
431 }
432
433 /***********************************************************************
434  *           dibdrv_SetDIBColorTable
435  */
436 static UINT dibdrv_SetDIBColorTable( PHYSDEV dev, UINT pos, UINT count, const RGBQUAD *colors )
437 {
438     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetDIBColorTable );
439     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
440     TRACE("(%p, %d, %d, %p)\n", dev, pos, count, colors);
441
442     if (pdev->dib.color_table)
443     {
444         pdev->bkgnd_color = get_pixel_color( pdev, GetBkColor( dev->hdc ), FALSE );
445         update_fg_colors( pdev );
446
447         update_masks( pdev, GetROP2( dev->hdc ) );
448     }
449     return next->funcs->pSetDIBColorTable( next, pos, count, colors );
450 }
451
452 /***********************************************************************
453  *           dibdrv_SetROP2
454  */
455 static INT dibdrv_SetROP2( PHYSDEV dev, INT rop )
456 {
457     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetROP2 );
458     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
459
460     update_masks( pdev, rop );
461
462     return next->funcs->pSetROP2( next, rop );
463 }
464
465 /***********************************************************************
466  *           dibdrv_SetTextColor
467  */
468 static COLORREF dibdrv_SetTextColor( PHYSDEV dev, COLORREF color )
469 {
470     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetTextColor );
471     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
472
473     pdev->text_color = get_pixel_color( pdev, color, TRUE );
474     update_aa_ranges( pdev );
475
476     return next->funcs->pSetTextColor( next, color );
477 }
478
479 const struct gdi_dc_funcs dib_driver =
480 {
481     NULL,                               /* pAbortDoc */
482     NULL,                               /* pAbortPath */
483     dibdrv_AlphaBlend,                  /* pAlphaBlend */
484     NULL,                               /* pAngleArc */
485     NULL,                               /* pArc */
486     NULL,                               /* pArcTo */
487     NULL,                               /* pBeginPath */
488     dibdrv_BlendImage,                  /* pBlendImage */
489     NULL,                               /* pChoosePixelFormat */
490     NULL,                               /* pChord */
491     NULL,                               /* pCloseFigure */
492     dibdrv_CopyBitmap,                  /* pCopyBitmap */
493     NULL,                               /* pCreateBitmap */
494     NULL,                               /* pCreateCompatibleDC */
495     dibdrv_CreateDC,                    /* pCreateDC */
496     NULL,                               /* pCreateDIBSection */
497     dibdrv_DeleteBitmap,                /* pDeleteBitmap */
498     dibdrv_DeleteDC,                    /* pDeleteDC */
499     NULL,                               /* pDeleteObject */
500     NULL,                               /* pDescribePixelFormat */
501     NULL,                               /* pDeviceCapabilities */
502     NULL,                               /* pEllipse */
503     NULL,                               /* pEndDoc */
504     NULL,                               /* pEndPage */
505     NULL,                               /* pEndPath */
506     NULL,                               /* pEnumFonts */
507     NULL,                               /* pEnumICMProfiles */
508     NULL,                               /* pExcludeClipRect */
509     NULL,                               /* pExtDeviceMode */
510     NULL,                               /* pExtEscape */
511     NULL,                               /* pExtFloodFill */
512     NULL,                               /* pExtSelectClipRgn */
513     dibdrv_ExtTextOut,                  /* pExtTextOut */
514     NULL,                               /* pFillPath */
515     NULL,                               /* pFillRgn */
516     NULL,                               /* pFlattenPath */
517     NULL,                               /* pFontIsLinked */
518     NULL,                               /* pFrameRgn */
519     NULL,                               /* pGdiComment */
520     NULL,                               /* pGdiRealizationInfo */
521     NULL,                               /* pGetCharABCWidths */
522     NULL,                               /* pGetCharABCWidthsI */
523     NULL,                               /* pGetCharWidth */
524     NULL,                               /* pGetDeviceCaps */
525     NULL,                               /* pGetDeviceGammaRamp */
526     NULL,                               /* pGetFontData */
527     NULL,                               /* pGetFontUnicodeRanges */
528     NULL,                               /* pGetGlyphIndices */
529     NULL,                               /* pGetGlyphOutline */
530     NULL,                               /* pGetICMProfile */
531     dibdrv_GetImage,                    /* pGetImage */
532     NULL,                               /* pGetKerningPairs */
533     dibdrv_GetNearestColor,             /* pGetNearestColor */
534     NULL,                               /* pGetOutlineTextMetrics */
535     dibdrv_GetPixel,                    /* pGetPixel */
536     NULL,                               /* pGetPixelFormat */
537     NULL,                               /* pGetSystemPaletteEntries */
538     NULL,                               /* pGetTextCharsetInfo */
539     NULL,                               /* pGetTextExtentExPoint */
540     NULL,                               /* pGetTextExtentExPointI */
541     NULL,                               /* pGetTextFace */
542     NULL,                               /* pGetTextMetrics */
543     dibdrv_GradientFill,                /* pGradientFill */
544     NULL,                               /* pIntersectClipRect */
545     NULL,                               /* pInvertRgn */
546     dibdrv_LineTo,                      /* pLineTo */
547     NULL,                               /* pModifyWorldTransform */
548     NULL,                               /* pMoveTo */
549     NULL,                               /* pOffsetClipRgn */
550     NULL,                               /* pOffsetViewportOrg */
551     NULL,                               /* pOffsetWindowOrg */
552     dibdrv_PaintRgn,                    /* pPaintRgn */
553     dibdrv_PatBlt,                      /* pPatBlt */
554     NULL,                               /* pPie */
555     NULL,                               /* pPolyBezier */
556     NULL,                               /* pPolyBezierTo */
557     NULL,                               /* pPolyDraw */
558     NULL,                               /* pPolyPolygon */
559     dibdrv_PolyPolyline,                /* pPolyPolyline */
560     NULL,                               /* pPolygon */
561     dibdrv_Polyline,                    /* pPolyline */
562     NULL,                               /* pPolylineTo */
563     dibdrv_PutImage,                    /* pPutImage */
564     NULL,                               /* pRealizeDefaultPalette */
565     NULL,                               /* pRealizePalette */
566     dibdrv_Rectangle,                   /* pRectangle */
567     NULL,                               /* pResetDC */
568     NULL,                               /* pRestoreDC */
569     NULL,                               /* pRoundRect */
570     NULL,                               /* pSaveDC */
571     NULL,                               /* pScaleViewportExt */
572     NULL,                               /* pScaleWindowExt */
573     dibdrv_SelectBitmap,                /* pSelectBitmap */
574     dibdrv_SelectBrush,                 /* pSelectBrush */
575     NULL,                               /* pSelectClipPath */
576     NULL,                               /* pSelectFont */
577     NULL,                               /* pSelectPalette */
578     dibdrv_SelectPen,                   /* pSelectPen */
579     NULL,                               /* pSetArcDirection */
580     dibdrv_SetBkColor,                  /* pSetBkColor */
581     dibdrv_SetBkMode,                   /* pSetBkMode */
582     dibdrv_SetDCBrushColor,             /* pSetDCBrushColor */
583     dibdrv_SetDCPenColor,               /* pSetDCPenColor */
584     dibdrv_SetDIBColorTable,            /* pSetDIBColorTable */
585     NULL,                               /* pSetDIBitsToDevice */
586     dibdrv_SetDeviceClipping,           /* pSetDeviceClipping */
587     NULL,                               /* pSetDeviceGammaRamp */
588     NULL,                               /* pSetLayout */
589     NULL,                               /* pSetMapMode */
590     NULL,                               /* pSetMapperFlags */
591     dibdrv_SetPixel,                    /* pSetPixel */
592     NULL,                               /* pSetPixelFormat */
593     NULL,                               /* pSetPolyFillMode */
594     dibdrv_SetROP2,                     /* pSetROP2 */
595     NULL,                               /* pSetRelAbs */
596     NULL,                               /* pSetStretchBltMode */
597     NULL,                               /* pSetTextAlign */
598     NULL,                               /* pSetTextCharacterExtra */
599     dibdrv_SetTextColor,                /* pSetTextColor */
600     NULL,                               /* pSetTextJustification */
601     NULL,                               /* pSetViewportExt */
602     NULL,                               /* pSetViewportOrg */
603     NULL,                               /* pSetWindowExt */
604     NULL,                               /* pSetWindowOrg */
605     NULL,                               /* pSetWorldTransform */
606     NULL,                               /* pStartDoc */
607     NULL,                               /* pStartPage */
608     dibdrv_StretchBlt,                  /* pStretchBlt */
609     NULL,                               /* pStretchDIBits */
610     NULL,                               /* pStrokeAndFillPath */
611     NULL,                               /* pStrokePath */
612     NULL,                               /* pSwapBuffers */
613     NULL,                               /* pUnrealizePalette */
614     NULL,                               /* pWidenPath */
615     NULL,                               /* pwglCopyContext */
616     NULL,                               /* pwglCreateContext */
617     NULL,                               /* pwglCreateContextAttribsARB */
618     NULL,                               /* pwglDeleteContext */
619     NULL,                               /* pwglGetPbufferDCARB */
620     NULL,                               /* pwglGetProcAddress */
621     NULL,                               /* pwglMakeContextCurrentARB */
622     NULL,                               /* pwglMakeCurrent */
623     NULL,                               /* pwglSetPixelFormatWINE */
624     NULL,                               /* pwglShareLists */
625     NULL,                               /* pwglUseFontBitmapsA */
626     NULL                                /* pwglUseFontBitmapsW */
627 };