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