gdi32: Add a SetBoundsRect driver entry point.
[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 (!is_bitmapobj_dib( bmp ))
164     {
165         BITMAPINFO info;
166
167         get_ddb_bitmapinfo( bmp, &info );
168         if (!bmp->dib.dsBm.bmBits)
169         {
170             int width_bytes = get_dib_stride( bmp->dib.dsBm.bmWidth, bmp->dib.dsBm.bmBitsPixel );
171             bmp->dib.dsBm.bmBits = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
172                                               bmp->dib.dsBm.bmHeight * width_bytes );
173             if (!bmp->dib.dsBm.bmBits) return FALSE;
174         }
175         init_dib_info_from_bitmapinfo( dib, &info, bmp->dib.dsBm.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 int get_clipped_rects( const dib_info *dib, const RECT *rc, HRGN clip, struct clipped_rects *clip_rects )
261 {
262     const WINEREGION *region;
263     RECT rect, *out = clip_rects->buffer;
264     int i;
265
266     init_clipped_rects( clip_rects );
267
268     rect.left   = 0;
269     rect.top    = 0;
270     rect.right  = dib->width;
271     rect.bottom = dib->height;
272     if (rc && !intersect_rect( &rect, &rect, rc )) return 0;
273
274     if (!clip)
275     {
276         *out = rect;
277         clip_rects->count = 1;
278         return 1;
279     }
280
281     if (!(region = get_wine_region( clip ))) return 0;
282
283     for (i = 0; i < region->numRects; i++)
284     {
285         if (region->rects[i].top >= rect.bottom) break;
286         if (!intersect_rect( out, &rect, &region->rects[i] )) continue;
287         out++;
288         if (out == &clip_rects->buffer[sizeof(clip_rects->buffer) / sizeof(RECT)])
289         {
290             clip_rects->rects = HeapAlloc( GetProcessHeap(), 0, region->numRects * sizeof(RECT) );
291             if (!clip_rects->rects) return 0;
292             memcpy( clip_rects->rects, clip_rects->buffer, (out - clip_rects->buffer) * sizeof(RECT) );
293             out = clip_rects->rects + (out - clip_rects->buffer);
294         }
295     }
296     release_wine_region( clip );
297     clip_rects->count = out - clip_rects->rects;
298     return clip_rects->count;
299 }
300
301 void add_clipped_bounds( RECT *bounds, const RECT *rect, HRGN clip )
302 {
303     const WINEREGION *region;
304     RECT rc;
305
306     if (clip)
307     {
308         if (!(region = get_wine_region( clip ))) return;
309         if (!rect) add_bounds_rect( bounds, &region->extents );
310         else if (intersect_rect( &rc, rect, &region->extents )) add_bounds_rect( bounds, &rc );
311         release_wine_region( clip );
312     }
313     else if (rect) add_bounds_rect( bounds, rect );
314 }
315
316 /**********************************************************************
317  *           dibdrv_CreateDC
318  */
319 static BOOL dibdrv_CreateDC( PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
320                              LPCWSTR output, const DEVMODEW *data )
321 {
322     dibdrv_physdev *pdev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pdev) );
323
324     if (!pdev) return FALSE;
325     clear_dib_info(&pdev->dib);
326     clear_dib_info(&pdev->brush.dib);
327     clear_dib_info(&pdev->pen_brush.dib);
328     reset_bounds( &pdev->bounds );
329     push_dc_driver( dev, &pdev->dev, &dib_driver );
330     return TRUE;
331 }
332
333 /***********************************************************************
334  *           dibdrv_DeleteDC
335  */
336 static BOOL dibdrv_DeleteDC( PHYSDEV dev )
337 {
338     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
339     TRACE("(%p)\n", dev);
340     free_pattern_brush( &pdev->brush );
341     free_pattern_brush( &pdev->pen_brush );
342     HeapFree( GetProcessHeap(), 0, pdev );
343     return TRUE;
344 }
345
346 /***********************************************************************
347  *           dibdrv_CopyBitmap
348  */
349 static BOOL dibdrv_CopyBitmap( HBITMAP src, HBITMAP dst )
350 {
351     return nulldrv_CopyBitmap( src, dst );
352 }
353
354 /***********************************************************************
355  *           dibdrv_DeleteBitmap
356  */
357 static BOOL dibdrv_DeleteBitmap( HBITMAP bitmap )
358 {
359     return TRUE;
360 }
361
362 /***********************************************************************
363  *           dibdrv_SelectBitmap
364  */
365 static HBITMAP dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
366 {
367     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
368     BITMAPOBJ *bmp = GDI_GetObjPtr( bitmap, OBJ_BITMAP );
369     dib_info dib;
370
371     TRACE("(%p, %p)\n", dev, bitmap);
372
373     if (!bmp) return 0;
374
375     if(!init_dib_info_from_bitmapobj(&dib, bmp, default_color_table))
376     {
377         GDI_ReleaseObj( bitmap );
378         return 0;
379     }
380     pdev->dib = dib;
381     GDI_ReleaseObj( bitmap );
382
383     return bitmap;
384 }
385
386 /***********************************************************************
387  *           dibdrv_SetDeviceClipping
388  */
389 static void dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn )
390 {
391     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
392     TRACE("(%p, %p)\n", dev, rgn);
393
394     pdev->clip = rgn;
395 }
396
397 /***********************************************************************
398  *           dibdrv_GetBoundsRect
399  */
400 static UINT dibdrv_GetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
401 {
402     dibdrv_physdev *pdev = get_dibdrv_pdev( dev );
403
404     if (is_rect_empty( &pdev->bounds )) return DCB_RESET;
405     if (rect) *rect = pdev->bounds;
406     if (flags & DCB_RESET) reset_bounds( &pdev->bounds );
407     return DCB_SET;
408 }
409
410 /***********************************************************************
411  *           dibdrv_SetBoundsRect
412  */
413 static UINT dibdrv_SetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
414 {
415     dibdrv_physdev *pdev = get_dibdrv_pdev( dev );
416
417     if (is_rect_empty( &pdev->bounds )) return DCB_RESET;
418     if (flags & DCB_RESET) reset_bounds( &pdev->bounds );
419     return DCB_SET;
420 }
421
422 /***********************************************************************
423  *           dibdrv_ChoosePixelFormat
424  */
425 static INT dibdrv_ChoosePixelFormat( PHYSDEV dev, const PIXELFORMATDESCRIPTOR *pfd )
426 {
427     FIXME( "Not supported on DIB section\n" );
428     return 0;
429 }
430
431 /***********************************************************************
432  *           dibdrv_DescribePixelFormat
433  */
434 static INT dibdrv_DescribePixelFormat( PHYSDEV dev, INT fmt, UINT size, PIXELFORMATDESCRIPTOR *pfd )
435 {
436     FIXME( "Not supported on DIB section\n" );
437     return 0;
438 }
439
440 /***********************************************************************
441  *           dibdrv_ExtEscape
442  */
443 static INT dibdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_size, const void *in_data,
444                              INT out_size, void *out_data )
445 {
446     return 0;
447 }
448
449 /***********************************************************************
450  *           dibdrv_GetDeviceGammaRamp
451  */
452 static BOOL dibdrv_GetDeviceGammaRamp( PHYSDEV dev, void *ramp )
453 {
454     SetLastError( ERROR_INVALID_PARAMETER );
455     return FALSE;
456 }
457
458 /***********************************************************************
459  *           dibdrv_GetPixelFormat
460  */
461 static INT dibdrv_GetPixelFormat( PHYSDEV dev )
462 {
463     FIXME( "Not supported on DIB section\n" );
464     return 0;
465 }
466
467 /***********************************************************************
468  *           dibdrv_SetDeviceGammaRamp
469  */
470 static BOOL dibdrv_SetDeviceGammaRamp( PHYSDEV dev, void *ramp )
471 {
472     SetLastError( ERROR_INVALID_PARAMETER );
473     return FALSE;
474 }
475
476 /***********************************************************************
477  *           dibdrv_SetPixelFormat
478  */
479 static BOOL dibdrv_SetPixelFormat( PHYSDEV dev, INT fmt, const PIXELFORMATDESCRIPTOR *pfd )
480 {
481     FIXME( "Not supported on DIB section\n" );
482     return FALSE;
483 }
484
485 /***********************************************************************
486  *           dibdrv_SwapBuffers
487  */
488 static BOOL dibdrv_SwapBuffers( PHYSDEV dev )
489 {
490     FIXME( "Not supported on DIB section\n" );
491     return FALSE;
492 }
493
494 /***********************************************************************
495  *           dibdrv_wglCopyContext
496  */
497 static BOOL dibdrv_wglCopyContext( HGLRC src, HGLRC dst, UINT mask )
498 {
499     FIXME( "Not supported on DIB section\n" );
500     return FALSE;
501 }
502
503 /***********************************************************************
504  *           dibdrv_wglCreateContext
505  */
506 static HGLRC dibdrv_wglCreateContext( PHYSDEV dev )
507 {
508     FIXME( "Not supported on DIB section\n" );
509     return 0;
510 }
511
512 /***********************************************************************
513  *           dibdrv_wglCreateContextAttribsARB
514  */
515 static HGLRC dibdrv_wglCreateContextAttribsARB( PHYSDEV dev, HGLRC ctx, const int *attribs )
516 {
517     FIXME( "Not supported on DIB section\n" );
518     return 0;
519 }
520
521 /***********************************************************************
522  *           dibdrv_wglDeleteContext
523  */
524 static BOOL dibdrv_wglDeleteContext( HGLRC ctx )
525 {
526     FIXME( "Not supported on DIB section\n" );
527     return FALSE;
528 }
529
530 /***********************************************************************
531  *           dibdrv_wglGetPbufferDCARB
532  */
533 static HDC dibdrv_wglGetPbufferDCARB( PHYSDEV dev, void *buffer )
534 {
535     FIXME( "Not supported on DIB section\n" );
536     return 0;
537 }
538
539 /***********************************************************************
540  *           dibdrv_wglGetProcAddress
541  */
542 static PROC dibdrv_wglGetProcAddress( LPCSTR name )
543 {
544     FIXME( "Not supported on DIB section\n" );
545     return NULL;
546 }
547
548 /***********************************************************************
549  *           dibdrv_wglMakeContextCurrentARB
550  */
551 static BOOL dibdrv_wglMakeContextCurrentARB( PHYSDEV draw_dev, PHYSDEV read_dev, HGLRC ctx )
552 {
553     FIXME( "Not supported on DIB section\n" );
554     return FALSE;
555 }
556
557 /***********************************************************************
558  *           dibdrv_wglMakeCurrent
559  */
560 static BOOL dibdrv_wglMakeCurrent( PHYSDEV dev, HGLRC ctx )
561 {
562     FIXME( "Not supported on DIB section\n" );
563     return FALSE;
564 }
565
566 /***********************************************************************
567  *           dibdrv_wglSetPixelFormatWINE
568  */
569 static BOOL dibdrv_wglSetPixelFormatWINE( PHYSDEV dev, INT fmt, const PIXELFORMATDESCRIPTOR *pfd )
570 {
571     FIXME( "Not supported on DIB section\n" );
572     return FALSE;
573 }
574
575 /***********************************************************************
576  *           dibdrv_wglShareLists
577  */
578 static BOOL dibdrv_wglShareLists( HGLRC ctx1, HGLRC ctx2 )
579 {
580     FIXME( "Not supported on DIB section\n" );
581     return FALSE;
582 }
583
584 /***********************************************************************
585  *           dibdrv_wglUseFontBitmapsA
586  */
587 static BOOL dibdrv_wglUseFontBitmapsA( PHYSDEV dev, DWORD first, DWORD count, DWORD base )
588 {
589     FIXME( "Not supported on DIB section\n" );
590     return FALSE;
591 }
592
593 /***********************************************************************
594  *           dibdrv_wglUseFontBitmapsW
595  */
596 static BOOL dibdrv_wglUseFontBitmapsW( PHYSDEV dev, DWORD first, DWORD count, DWORD base )
597 {
598     FIXME( "Not supported on DIB section\n" );
599     return FALSE;
600 }
601
602 const struct gdi_dc_funcs dib_driver =
603 {
604     NULL,                               /* pAbortDoc */
605     NULL,                               /* pAbortPath */
606     dibdrv_AlphaBlend,                  /* pAlphaBlend */
607     NULL,                               /* pAngleArc */
608     dibdrv_Arc,                         /* pArc */
609     dibdrv_ArcTo,                       /* pArcTo */
610     NULL,                               /* pBeginPath */
611     dibdrv_BlendImage,                  /* pBlendImage */
612     dibdrv_ChoosePixelFormat,           /* pChoosePixelFormat */
613     dibdrv_Chord,                       /* pChord */
614     NULL,                               /* pCloseFigure */
615     dibdrv_CopyBitmap,                  /* pCopyBitmap */
616     NULL,                               /* pCreateBitmap */
617     NULL,                               /* pCreateCompatibleDC */
618     dibdrv_CreateDC,                    /* pCreateDC */
619     dibdrv_DeleteBitmap,                /* pDeleteBitmap */
620     dibdrv_DeleteDC,                    /* pDeleteDC */
621     NULL,                               /* pDeleteObject */
622     dibdrv_DescribePixelFormat,         /* pDescribePixelFormat */
623     NULL,                               /* pDeviceCapabilities */
624     dibdrv_Ellipse,                     /* pEllipse */
625     NULL,                               /* pEndDoc */
626     NULL,                               /* pEndPage */
627     NULL,                               /* pEndPath */
628     NULL,                               /* pEnumFonts */
629     NULL,                               /* pEnumICMProfiles */
630     NULL,                               /* pExcludeClipRect */
631     NULL,                               /* pExtDeviceMode */
632     dibdrv_ExtEscape,                   /* pExtEscape */
633     dibdrv_ExtFloodFill,                /* pExtFloodFill */
634     NULL,                               /* pExtSelectClipRgn */
635     dibdrv_ExtTextOut,                  /* pExtTextOut */
636     NULL,                               /* pFillPath */
637     NULL,                               /* pFillRgn */
638     NULL,                               /* pFlattenPath */
639     NULL,                               /* pFontIsLinked */
640     NULL,                               /* pFrameRgn */
641     NULL,                               /* pGdiComment */
642     NULL,                               /* pGdiRealizationInfo */
643     dibdrv_GetBoundsRect,               /* pGetBoundsRect */
644     NULL,                               /* pGetCharABCWidths */
645     NULL,                               /* pGetCharABCWidthsI */
646     NULL,                               /* pGetCharWidth */
647     NULL,                               /* pGetDeviceCaps */
648     dibdrv_GetDeviceGammaRamp,          /* pGetDeviceGammaRamp */
649     NULL,                               /* pGetFontData */
650     NULL,                               /* pGetFontUnicodeRanges */
651     NULL,                               /* pGetGlyphIndices */
652     NULL,                               /* pGetGlyphOutline */
653     NULL,                               /* pGetICMProfile */
654     dibdrv_GetImage,                    /* pGetImage */
655     NULL,                               /* pGetKerningPairs */
656     dibdrv_GetNearestColor,             /* pGetNearestColor */
657     NULL,                               /* pGetOutlineTextMetrics */
658     dibdrv_GetPixel,                    /* pGetPixel */
659     dibdrv_GetPixelFormat,              /* pGetPixelFormat */
660     NULL,                               /* pGetSystemPaletteEntries */
661     NULL,                               /* pGetTextCharsetInfo */
662     NULL,                               /* pGetTextExtentExPoint */
663     NULL,                               /* pGetTextExtentExPointI */
664     NULL,                               /* pGetTextFace */
665     NULL,                               /* pGetTextMetrics */
666     dibdrv_GradientFill,                /* pGradientFill */
667     NULL,                               /* pIntersectClipRect */
668     NULL,                               /* pInvertRgn */
669     dibdrv_LineTo,                      /* pLineTo */
670     NULL,                               /* pModifyWorldTransform */
671     NULL,                               /* pMoveTo */
672     NULL,                               /* pOffsetClipRgn */
673     NULL,                               /* pOffsetViewportOrg */
674     NULL,                               /* pOffsetWindowOrg */
675     dibdrv_PaintRgn,                    /* pPaintRgn */
676     dibdrv_PatBlt,                      /* pPatBlt */
677     dibdrv_Pie,                         /* pPie */
678     NULL,                               /* pPolyBezier */
679     NULL,                               /* pPolyBezierTo */
680     NULL,                               /* pPolyDraw */
681     dibdrv_PolyPolygon,                 /* pPolyPolygon */
682     dibdrv_PolyPolyline,                /* pPolyPolyline */
683     dibdrv_Polygon,                     /* pPolygon */
684     dibdrv_Polyline,                    /* pPolyline */
685     NULL,                               /* pPolylineTo */
686     dibdrv_PutImage,                    /* pPutImage */
687     NULL,                               /* pRealizeDefaultPalette */
688     NULL,                               /* pRealizePalette */
689     dibdrv_Rectangle,                   /* pRectangle */
690     NULL,                               /* pResetDC */
691     NULL,                               /* pRestoreDC */
692     dibdrv_RoundRect,                   /* pRoundRect */
693     NULL,                               /* pSaveDC */
694     NULL,                               /* pScaleViewportExt */
695     NULL,                               /* pScaleWindowExt */
696     dibdrv_SelectBitmap,                /* pSelectBitmap */
697     dibdrv_SelectBrush,                 /* pSelectBrush */
698     NULL,                               /* pSelectClipPath */
699     NULL,                               /* pSelectFont */
700     NULL,                               /* pSelectPalette */
701     dibdrv_SelectPen,                   /* pSelectPen */
702     NULL,                               /* pSetArcDirection */
703     NULL,                               /* pSetBkColor */
704     NULL,                               /* pSetBkMode */
705     dibdrv_SetBoundsRect,               /* pSetBoundsRect */
706     dibdrv_SetDCBrushColor,             /* pSetDCBrushColor */
707     dibdrv_SetDCPenColor,               /* pSetDCPenColor */
708     NULL,                               /* pSetDIBitsToDevice */
709     dibdrv_SetDeviceClipping,           /* pSetDeviceClipping */
710     dibdrv_SetDeviceGammaRamp,          /* pSetDeviceGammaRamp */
711     NULL,                               /* pSetLayout */
712     NULL,                               /* pSetMapMode */
713     NULL,                               /* pSetMapperFlags */
714     dibdrv_SetPixel,                    /* pSetPixel */
715     dibdrv_SetPixelFormat,              /* pSetPixelFormat */
716     NULL,                               /* pSetPolyFillMode */
717     NULL,                               /* pSetROP2 */
718     NULL,                               /* pSetRelAbs */
719     NULL,                               /* pSetStretchBltMode */
720     NULL,                               /* pSetTextAlign */
721     NULL,                               /* pSetTextCharacterExtra */
722     NULL,                               /* pSetTextColor */
723     NULL,                               /* pSetTextJustification */
724     NULL,                               /* pSetViewportExt */
725     NULL,                               /* pSetViewportOrg */
726     NULL,                               /* pSetWindowExt */
727     NULL,                               /* pSetWindowOrg */
728     NULL,                               /* pSetWorldTransform */
729     NULL,                               /* pStartDoc */
730     NULL,                               /* pStartPage */
731     dibdrv_StretchBlt,                  /* pStretchBlt */
732     NULL,                               /* pStretchDIBits */
733     NULL,                               /* pStrokeAndFillPath */
734     NULL,                               /* pStrokePath */
735     dibdrv_SwapBuffers,                 /* pSwapBuffers */
736     NULL,                               /* pUnrealizePalette */
737     NULL,                               /* pWidenPath */
738     dibdrv_wglCopyContext,              /* pwglCopyContext */
739     dibdrv_wglCreateContext,            /* pwglCreateContext */
740     dibdrv_wglCreateContextAttribsARB,  /* pwglCreateContextAttribsARB */
741     dibdrv_wglDeleteContext,            /* pwglDeleteContext */
742     dibdrv_wglGetPbufferDCARB,          /* pwglGetPbufferDCARB */
743     dibdrv_wglGetProcAddress,           /* pwglGetProcAddress */
744     dibdrv_wglMakeContextCurrentARB,    /* pwglMakeContextCurrentARB */
745     dibdrv_wglMakeCurrent,              /* pwglMakeCurrent */
746     dibdrv_wglSetPixelFormatWINE,       /* pwglSetPixelFormatWINE */
747     dibdrv_wglShareLists,               /* pwglShareLists */
748     dibdrv_wglUseFontBitmapsA,          /* pwglUseFontBitmapsA */
749     dibdrv_wglUseFontBitmapsW,          /* pwglUseFontBitmapsW */
750 };