gdi32: Allow a driver to implement SelectBitmap but not CreateBitmap.
[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->rect.left    = 0;
77     dib->rect.top     = 0;
78     dib->rect.right   = bi->biWidth;
79     dib->rect.bottom  = abs( bi->biHeight );
80     dib->compression  = bi->biCompression;
81     dib->stride       = get_dib_stride( dib->width, dib->bit_count );
82     dib->bits.ptr     = bits;
83     dib->bits.is_copy = FALSE;
84     dib->bits.free    = NULL;
85     dib->bits.param   = NULL;
86
87     if(dib->height < 0) /* top-down */
88     {
89         dib->height = -dib->height;
90     }
91     else /* bottom-up */
92     {
93         /* bits always points to the top-left corner and the stride is -ve */
94         dib->bits.ptr = (BYTE*)dib->bits.ptr + (dib->height - 1) * dib->stride;
95         dib->stride  = -dib->stride;
96     }
97
98     dib->funcs = &funcs_null;
99
100     switch(dib->bit_count)
101     {
102     case 32:
103         if(bi->biCompression == BI_RGB)
104             bit_fields = bit_fields_888;
105
106         init_bit_fields(dib, bit_fields);
107
108         if(dib->red_mask == 0xff0000 && dib->green_mask == 0x00ff00 && dib->blue_mask == 0x0000ff)
109             dib->funcs = &funcs_8888;
110         else
111             dib->funcs = &funcs_32;
112         break;
113
114     case 24:
115         dib->funcs = &funcs_24;
116         break;
117
118     case 16:
119         if(bi->biCompression == BI_RGB)
120             bit_fields = bit_fields_555;
121
122         init_bit_fields(dib, bit_fields);
123
124         if(dib->red_mask == 0x7c00 && dib->green_mask == 0x03e0 && dib->blue_mask == 0x001f)
125             dib->funcs = &funcs_555;
126         else
127             dib->funcs = &funcs_16;
128         break;
129
130     case 8:
131         dib->funcs = &funcs_8;
132         break;
133
134     case 4:
135         dib->funcs = &funcs_4;
136         break;
137
138     case 1:
139         dib->funcs = &funcs_1;
140         break;
141     }
142
143     if (color_table && bi->biClrUsed)
144     {
145         dib->color_table = color_table;
146         dib->color_table_size = bi->biClrUsed;
147     }
148     else if (flags & default_color_table)
149     {
150         dib->color_table = get_default_color_table( dib->bit_count );
151         dib->color_table_size = dib->color_table ? (1 << dib->bit_count) : 0;
152     }
153     else
154     {
155         dib->color_table = NULL;
156         dib->color_table_size = 0;
157     }
158 }
159
160 void init_dib_info_from_bitmapinfo(dib_info *dib, const BITMAPINFO *info, void *bits, enum dib_info_flags flags)
161 {
162     init_dib_info( dib, &info->bmiHeader, (const DWORD *)info->bmiColors, info->bmiColors, bits, flags );
163 }
164
165 BOOL init_dib_info_from_bitmapobj(dib_info *dib, BITMAPOBJ *bmp, enum dib_info_flags flags)
166 {
167     if (!is_bitmapobj_dib( bmp ))
168     {
169         BITMAPINFO info;
170
171         get_ddb_bitmapinfo( bmp, &info );
172         if (!bmp->dib.dsBm.bmBits)
173         {
174             int width_bytes = get_dib_stride( bmp->dib.dsBm.bmWidth, bmp->dib.dsBm.bmBitsPixel );
175             bmp->dib.dsBm.bmBits = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
176                                               bmp->dib.dsBm.bmHeight * width_bytes );
177             if (!bmp->dib.dsBm.bmBits) return FALSE;
178         }
179         init_dib_info_from_bitmapinfo( dib, &info, bmp->dib.dsBm.bmBits, flags );
180     }
181     else init_dib_info( dib, &bmp->dib.dsBmih, bmp->dib.dsBitfields,
182                         bmp->color_table, bmp->dib.dsBm.bmBits, flags );
183     return TRUE;
184 }
185
186 static void clear_dib_info(dib_info *dib)
187 {
188     dib->color_table = NULL;
189     dib->bits.ptr    = NULL;
190     dib->bits.free   = NULL;
191     dib->bits.param  = NULL;
192 }
193
194 /**********************************************************************
195  *      free_dib_info
196  *
197  * Free the resources associated with a dib and optionally the bits
198  */
199 void free_dib_info(dib_info *dib)
200 {
201     if (dib->bits.free) dib->bits.free( &dib->bits );
202     clear_dib_info( dib );
203 }
204
205 void copy_dib_color_info(dib_info *dst, const dib_info *src)
206 {
207     dst->bit_count        = src->bit_count;
208     dst->red_mask         = src->red_mask;
209     dst->green_mask       = src->green_mask;
210     dst->blue_mask        = src->blue_mask;
211     dst->red_len          = src->red_len;
212     dst->green_len        = src->green_len;
213     dst->blue_len         = src->blue_len;
214     dst->red_shift        = src->red_shift;
215     dst->green_shift      = src->green_shift;
216     dst->blue_shift       = src->blue_shift;
217     dst->funcs            = src->funcs;
218     dst->color_table_size = src->color_table_size;
219     dst->color_table      = src->color_table;
220 }
221
222 DWORD convert_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bitblt_coords *src,
223                           const BITMAPINFO *dst_info, void *dst_bits, BOOL add_alpha )
224 {
225     dib_info src_dib, dst_dib;
226     DWORD ret;
227
228     init_dib_info_from_bitmapinfo( &src_dib, src_info, src_bits, default_color_table );
229     init_dib_info_from_bitmapinfo( &dst_dib, dst_info, dst_bits, default_color_table );
230
231     __TRY
232     {
233         dst_dib.funcs->convert_to( &dst_dib, &src_dib, &src->visrect );
234         ret = TRUE;
235     }
236     __EXCEPT_PAGE_FAULT
237     {
238         WARN( "invalid bits pointer %p\n", src_bits );
239         ret = FALSE;
240     }
241     __ENDTRY
242
243     /* We shared the color tables, so there's no need to free the dib_infos here */
244     if(!ret) return ERROR_BAD_FORMAT;
245
246     /* update coordinates, the destination rectangle is always stored at 0,0 */
247     src->x -= src->visrect.left;
248     src->y -= src->visrect.top;
249     offset_rect( &src->visrect, -src->visrect.left, -src->visrect.top );
250
251     if (add_alpha && dst_dib.funcs == &funcs_8888 && src_dib.funcs != &funcs_8888)
252     {
253         DWORD *pixel = dst_dib.bits.ptr;
254         int x, y;
255
256         for (y = src->visrect.top; y < src->visrect.bottom; y++, pixel += dst_dib.stride / 4)
257             for (x = src->visrect.left; x < src->visrect.right; x++)
258                 pixel[x] |= 0xff000000;
259     }
260
261     return ERROR_SUCCESS;
262 }
263
264 int get_clipped_rects( const dib_info *dib, const RECT *rc, HRGN clip, struct clipped_rects *clip_rects )
265 {
266     const WINEREGION *region;
267     RECT rect, *out = clip_rects->buffer;
268     int i;
269
270     init_clipped_rects( clip_rects );
271
272     rect.left   = 0;
273     rect.top    = 0;
274     rect.right  = dib->rect.right - dib->rect.left;
275     rect.bottom = dib->rect.bottom - dib->rect.top;
276     if (rc && !intersect_rect( &rect, &rect, rc )) return 0;
277
278     if (!clip)
279     {
280         *out = rect;
281         clip_rects->count = 1;
282         return 1;
283     }
284
285     if (!(region = get_wine_region( clip ))) return 0;
286
287     for (i = 0; i < region->numRects; i++)
288     {
289         if (region->rects[i].top >= rect.bottom) break;
290         if (!intersect_rect( out, &rect, &region->rects[i] )) continue;
291         out++;
292         if (out == &clip_rects->buffer[sizeof(clip_rects->buffer) / sizeof(RECT)])
293         {
294             clip_rects->rects = HeapAlloc( GetProcessHeap(), 0, region->numRects * sizeof(RECT) );
295             if (!clip_rects->rects) return 0;
296             memcpy( clip_rects->rects, clip_rects->buffer, (out - clip_rects->buffer) * sizeof(RECT) );
297             out = clip_rects->rects + (out - clip_rects->buffer);
298         }
299     }
300     release_wine_region( clip );
301     clip_rects->count = out - clip_rects->rects;
302     return clip_rects->count;
303 }
304
305 void add_clipped_bounds( dibdrv_physdev *dev, const RECT *rect, HRGN clip )
306 {
307     const WINEREGION *region;
308     RECT rc;
309
310     if (!dev->bounds) return;
311     if (clip)
312     {
313         if (!(region = get_wine_region( clip ))) return;
314         if (!rect) rc = region->extents;
315         else intersect_rect( &rc, rect, &region->extents );
316         release_wine_region( clip );
317     }
318     else rc = *rect;
319
320     if (is_rect_empty( &rc )) return;
321     offset_rect( &rc, dev->dib.rect.left, dev->dib.rect.top );
322     add_bounds_rect( dev->bounds, &rc );
323 }
324
325 /**********************************************************************
326  *           dibdrv_CreateDC
327  */
328 static BOOL dibdrv_CreateDC( PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
329                              LPCWSTR output, const DEVMODEW *data )
330 {
331     dibdrv_physdev *pdev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pdev) );
332
333     if (!pdev) return FALSE;
334     clear_dib_info(&pdev->dib);
335     clear_dib_info(&pdev->brush.dib);
336     clear_dib_info(&pdev->pen_brush.dib);
337     push_dc_driver( dev, &pdev->dev, &dib_driver );
338     return TRUE;
339 }
340
341 /***********************************************************************
342  *           dibdrv_DeleteDC
343  */
344 static BOOL dibdrv_DeleteDC( PHYSDEV dev )
345 {
346     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
347     TRACE("(%p)\n", dev);
348     free_pattern_brush( &pdev->brush );
349     free_pattern_brush( &pdev->pen_brush );
350     HeapFree( GetProcessHeap(), 0, pdev );
351     return TRUE;
352 }
353
354 /***********************************************************************
355  *           dibdrv_CopyBitmap
356  */
357 static BOOL dibdrv_CopyBitmap( HBITMAP src, HBITMAP dst )
358 {
359     return nulldrv_CopyBitmap( src, dst );
360 }
361
362 /***********************************************************************
363  *           dibdrv_DeleteBitmap
364  */
365 static BOOL dibdrv_DeleteBitmap( HBITMAP bitmap )
366 {
367     return TRUE;
368 }
369
370 /***********************************************************************
371  *           dibdrv_SelectBitmap
372  */
373 static HBITMAP dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
374 {
375     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
376     BITMAPOBJ *bmp = GDI_GetObjPtr( bitmap, OBJ_BITMAP );
377     dib_info dib;
378
379     TRACE("(%p, %p)\n", dev, bitmap);
380
381     if (!bmp) return 0;
382
383     if(!init_dib_info_from_bitmapobj(&dib, bmp, default_color_table))
384     {
385         GDI_ReleaseObj( bitmap );
386         return 0;
387     }
388     pdev->dib = dib;
389     GDI_ReleaseObj( bitmap );
390
391     return bitmap;
392 }
393
394 /***********************************************************************
395  *           dibdrv_SetDeviceClipping
396  */
397 static void dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn )
398 {
399     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
400     TRACE("(%p, %p)\n", dev, rgn);
401
402     pdev->clip = rgn;
403 }
404
405 /***********************************************************************
406  *           dibdrv_SetBoundsRect
407  */
408 static UINT dibdrv_SetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
409 {
410     dibdrv_physdev *pdev = get_dibdrv_pdev( dev );
411
412     if (flags & DCB_DISABLE) pdev->bounds = NULL;
413     else if (flags & DCB_ENABLE) pdev->bounds = rect;
414     return DCB_RESET;  /* we don't have device-specific bounds */
415 }
416
417 /***********************************************************************
418  *           dibdrv_ChoosePixelFormat
419  */
420 static INT dibdrv_ChoosePixelFormat( PHYSDEV dev, const PIXELFORMATDESCRIPTOR *pfd )
421 {
422     FIXME( "Not supported on DIB section\n" );
423     return 0;
424 }
425
426 /***********************************************************************
427  *           dibdrv_DescribePixelFormat
428  */
429 static INT dibdrv_DescribePixelFormat( PHYSDEV dev, INT fmt, UINT size, PIXELFORMATDESCRIPTOR *pfd )
430 {
431     FIXME( "Not supported on DIB section\n" );
432     return 0;
433 }
434
435 /***********************************************************************
436  *           dibdrv_ExtEscape
437  */
438 static INT dibdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_size, const void *in_data,
439                              INT out_size, void *out_data )
440 {
441     return 0;
442 }
443
444 /***********************************************************************
445  *           dibdrv_GetDeviceGammaRamp
446  */
447 static BOOL dibdrv_GetDeviceGammaRamp( PHYSDEV dev, void *ramp )
448 {
449     SetLastError( ERROR_INVALID_PARAMETER );
450     return FALSE;
451 }
452
453 /***********************************************************************
454  *           dibdrv_GetPixelFormat
455  */
456 static INT dibdrv_GetPixelFormat( PHYSDEV dev )
457 {
458     FIXME( "Not supported on DIB section\n" );
459     return 0;
460 }
461
462 /***********************************************************************
463  *           dibdrv_SetDeviceGammaRamp
464  */
465 static BOOL dibdrv_SetDeviceGammaRamp( PHYSDEV dev, void *ramp )
466 {
467     SetLastError( ERROR_INVALID_PARAMETER );
468     return FALSE;
469 }
470
471 /***********************************************************************
472  *           dibdrv_SetPixelFormat
473  */
474 static BOOL dibdrv_SetPixelFormat( PHYSDEV dev, INT fmt, const PIXELFORMATDESCRIPTOR *pfd )
475 {
476     FIXME( "Not supported on DIB section\n" );
477     return FALSE;
478 }
479
480 /***********************************************************************
481  *           dibdrv_SwapBuffers
482  */
483 static BOOL dibdrv_SwapBuffers( PHYSDEV dev )
484 {
485     FIXME( "Not supported on DIB section\n" );
486     return FALSE;
487 }
488
489 /***********************************************************************
490  *           dibdrv_wglCopyContext
491  */
492 static BOOL dibdrv_wglCopyContext( HGLRC src, HGLRC dst, UINT mask )
493 {
494     FIXME( "Not supported on DIB section\n" );
495     return FALSE;
496 }
497
498 /***********************************************************************
499  *           dibdrv_wglCreateContext
500  */
501 static HGLRC dibdrv_wglCreateContext( PHYSDEV dev )
502 {
503     FIXME( "Not supported on DIB section\n" );
504     return 0;
505 }
506
507 /***********************************************************************
508  *           dibdrv_wglCreateContextAttribsARB
509  */
510 static HGLRC dibdrv_wglCreateContextAttribsARB( PHYSDEV dev, HGLRC ctx, const int *attribs )
511 {
512     FIXME( "Not supported on DIB section\n" );
513     return 0;
514 }
515
516 /***********************************************************************
517  *           dibdrv_wglDeleteContext
518  */
519 static BOOL dibdrv_wglDeleteContext( HGLRC ctx )
520 {
521     FIXME( "Not supported on DIB section\n" );
522     return FALSE;
523 }
524
525 /***********************************************************************
526  *           dibdrv_wglGetPbufferDCARB
527  */
528 static HDC dibdrv_wglGetPbufferDCARB( PHYSDEV dev, void *buffer )
529 {
530     FIXME( "Not supported on DIB section\n" );
531     return 0;
532 }
533
534 /***********************************************************************
535  *           dibdrv_wglGetProcAddress
536  */
537 static PROC dibdrv_wglGetProcAddress( LPCSTR name )
538 {
539     FIXME( "Not supported on DIB section\n" );
540     return NULL;
541 }
542
543 /***********************************************************************
544  *           dibdrv_wglMakeContextCurrentARB
545  */
546 static BOOL dibdrv_wglMakeContextCurrentARB( PHYSDEV draw_dev, PHYSDEV read_dev, HGLRC ctx )
547 {
548     FIXME( "Not supported on DIB section\n" );
549     return FALSE;
550 }
551
552 /***********************************************************************
553  *           dibdrv_wglMakeCurrent
554  */
555 static BOOL dibdrv_wglMakeCurrent( PHYSDEV dev, HGLRC ctx )
556 {
557     FIXME( "Not supported on DIB section\n" );
558     return FALSE;
559 }
560
561 /***********************************************************************
562  *           dibdrv_wglSetPixelFormatWINE
563  */
564 static BOOL dibdrv_wglSetPixelFormatWINE( PHYSDEV dev, INT fmt, const PIXELFORMATDESCRIPTOR *pfd )
565 {
566     FIXME( "Not supported on DIB section\n" );
567     return FALSE;
568 }
569
570 /***********************************************************************
571  *           dibdrv_wglShareLists
572  */
573 static BOOL dibdrv_wglShareLists( HGLRC ctx1, HGLRC ctx2 )
574 {
575     FIXME( "Not supported on DIB section\n" );
576     return FALSE;
577 }
578
579 /***********************************************************************
580  *           dibdrv_wglUseFontBitmapsA
581  */
582 static BOOL dibdrv_wglUseFontBitmapsA( PHYSDEV dev, DWORD first, DWORD count, DWORD base )
583 {
584     FIXME( "Not supported on DIB section\n" );
585     return FALSE;
586 }
587
588 /***********************************************************************
589  *           dibdrv_wglUseFontBitmapsW
590  */
591 static BOOL dibdrv_wglUseFontBitmapsW( PHYSDEV dev, DWORD first, DWORD count, DWORD base )
592 {
593     FIXME( "Not supported on DIB section\n" );
594     return FALSE;
595 }
596
597 const struct gdi_dc_funcs dib_driver =
598 {
599     NULL,                               /* pAbortDoc */
600     NULL,                               /* pAbortPath */
601     dibdrv_AlphaBlend,                  /* pAlphaBlend */
602     NULL,                               /* pAngleArc */
603     dibdrv_Arc,                         /* pArc */
604     dibdrv_ArcTo,                       /* pArcTo */
605     NULL,                               /* pBeginPath */
606     dibdrv_BlendImage,                  /* pBlendImage */
607     dibdrv_ChoosePixelFormat,           /* pChoosePixelFormat */
608     dibdrv_Chord,                       /* pChord */
609     NULL,                               /* pCloseFigure */
610     dibdrv_CopyBitmap,                  /* pCopyBitmap */
611     NULL,                               /* pCreateBitmap */
612     NULL,                               /* pCreateCompatibleDC */
613     dibdrv_CreateDC,                    /* pCreateDC */
614     dibdrv_DeleteBitmap,                /* pDeleteBitmap */
615     dibdrv_DeleteDC,                    /* pDeleteDC */
616     NULL,                               /* pDeleteObject */
617     dibdrv_DescribePixelFormat,         /* pDescribePixelFormat */
618     NULL,                               /* pDeviceCapabilities */
619     dibdrv_Ellipse,                     /* pEllipse */
620     NULL,                               /* pEndDoc */
621     NULL,                               /* pEndPage */
622     NULL,                               /* pEndPath */
623     NULL,                               /* pEnumFonts */
624     NULL,                               /* pEnumICMProfiles */
625     NULL,                               /* pExcludeClipRect */
626     NULL,                               /* pExtDeviceMode */
627     dibdrv_ExtEscape,                   /* pExtEscape */
628     dibdrv_ExtFloodFill,                /* pExtFloodFill */
629     NULL,                               /* pExtSelectClipRgn */
630     dibdrv_ExtTextOut,                  /* pExtTextOut */
631     NULL,                               /* pFillPath */
632     NULL,                               /* pFillRgn */
633     NULL,                               /* pFlattenPath */
634     NULL,                               /* pFontIsLinked */
635     NULL,                               /* pFrameRgn */
636     NULL,                               /* pGdiComment */
637     NULL,                               /* pGdiRealizationInfo */
638     NULL,                               /* pGetBoundsRect */
639     NULL,                               /* pGetCharABCWidths */
640     NULL,                               /* pGetCharABCWidthsI */
641     NULL,                               /* pGetCharWidth */
642     NULL,                               /* pGetDeviceCaps */
643     dibdrv_GetDeviceGammaRamp,          /* pGetDeviceGammaRamp */
644     NULL,                               /* pGetFontData */
645     NULL,                               /* pGetFontUnicodeRanges */
646     NULL,                               /* pGetGlyphIndices */
647     NULL,                               /* pGetGlyphOutline */
648     NULL,                               /* pGetICMProfile */
649     dibdrv_GetImage,                    /* pGetImage */
650     NULL,                               /* pGetKerningPairs */
651     dibdrv_GetNearestColor,             /* pGetNearestColor */
652     NULL,                               /* pGetOutlineTextMetrics */
653     dibdrv_GetPixel,                    /* pGetPixel */
654     dibdrv_GetPixelFormat,              /* pGetPixelFormat */
655     NULL,                               /* pGetSystemPaletteEntries */
656     NULL,                               /* pGetTextCharsetInfo */
657     NULL,                               /* pGetTextExtentExPoint */
658     NULL,                               /* pGetTextExtentExPointI */
659     NULL,                               /* pGetTextFace */
660     NULL,                               /* pGetTextMetrics */
661     dibdrv_GradientFill,                /* pGradientFill */
662     NULL,                               /* pIntersectClipRect */
663     NULL,                               /* pInvertRgn */
664     dibdrv_LineTo,                      /* pLineTo */
665     NULL,                               /* pModifyWorldTransform */
666     NULL,                               /* pMoveTo */
667     NULL,                               /* pOffsetClipRgn */
668     NULL,                               /* pOffsetViewportOrg */
669     NULL,                               /* pOffsetWindowOrg */
670     dibdrv_PaintRgn,                    /* pPaintRgn */
671     dibdrv_PatBlt,                      /* pPatBlt */
672     dibdrv_Pie,                         /* pPie */
673     NULL,                               /* pPolyBezier */
674     NULL,                               /* pPolyBezierTo */
675     NULL,                               /* pPolyDraw */
676     dibdrv_PolyPolygon,                 /* pPolyPolygon */
677     dibdrv_PolyPolyline,                /* pPolyPolyline */
678     dibdrv_Polygon,                     /* pPolygon */
679     dibdrv_Polyline,                    /* pPolyline */
680     NULL,                               /* pPolylineTo */
681     dibdrv_PutImage,                    /* pPutImage */
682     NULL,                               /* pRealizeDefaultPalette */
683     NULL,                               /* pRealizePalette */
684     dibdrv_Rectangle,                   /* pRectangle */
685     NULL,                               /* pResetDC */
686     NULL,                               /* pRestoreDC */
687     dibdrv_RoundRect,                   /* pRoundRect */
688     NULL,                               /* pSaveDC */
689     NULL,                               /* pScaleViewportExt */
690     NULL,                               /* pScaleWindowExt */
691     dibdrv_SelectBitmap,                /* pSelectBitmap */
692     dibdrv_SelectBrush,                 /* pSelectBrush */
693     NULL,                               /* pSelectClipPath */
694     NULL,                               /* pSelectFont */
695     NULL,                               /* pSelectPalette */
696     dibdrv_SelectPen,                   /* pSelectPen */
697     NULL,                               /* pSetArcDirection */
698     NULL,                               /* pSetBkColor */
699     NULL,                               /* pSetBkMode */
700     dibdrv_SetBoundsRect,               /* pSetBoundsRect */
701     dibdrv_SetDCBrushColor,             /* pSetDCBrushColor */
702     dibdrv_SetDCPenColor,               /* pSetDCPenColor */
703     NULL,                               /* pSetDIBitsToDevice */
704     dibdrv_SetDeviceClipping,           /* pSetDeviceClipping */
705     dibdrv_SetDeviceGammaRamp,          /* pSetDeviceGammaRamp */
706     NULL,                               /* pSetLayout */
707     NULL,                               /* pSetMapMode */
708     NULL,                               /* pSetMapperFlags */
709     dibdrv_SetPixel,                    /* pSetPixel */
710     dibdrv_SetPixelFormat,              /* pSetPixelFormat */
711     NULL,                               /* pSetPolyFillMode */
712     NULL,                               /* pSetROP2 */
713     NULL,                               /* pSetRelAbs */
714     NULL,                               /* pSetStretchBltMode */
715     NULL,                               /* pSetTextAlign */
716     NULL,                               /* pSetTextCharacterExtra */
717     NULL,                               /* pSetTextColor */
718     NULL,                               /* pSetTextJustification */
719     NULL,                               /* pSetViewportExt */
720     NULL,                               /* pSetViewportOrg */
721     NULL,                               /* pSetWindowExt */
722     NULL,                               /* pSetWindowOrg */
723     NULL,                               /* pSetWorldTransform */
724     NULL,                               /* pStartDoc */
725     NULL,                               /* pStartPage */
726     dibdrv_StretchBlt,                  /* pStretchBlt */
727     NULL,                               /* pStretchDIBits */
728     NULL,                               /* pStrokeAndFillPath */
729     NULL,                               /* pStrokePath */
730     dibdrv_SwapBuffers,                 /* pSwapBuffers */
731     NULL,                               /* pUnrealizePalette */
732     NULL,                               /* pWidenPath */
733     dibdrv_wglCopyContext,              /* pwglCopyContext */
734     dibdrv_wglCreateContext,            /* pwglCreateContext */
735     dibdrv_wglCreateContextAttribsARB,  /* pwglCreateContextAttribsARB */
736     dibdrv_wglDeleteContext,            /* pwglDeleteContext */
737     dibdrv_wglGetPbufferDCARB,          /* pwglGetPbufferDCARB */
738     dibdrv_wglGetProcAddress,           /* pwglGetProcAddress */
739     dibdrv_wglMakeContextCurrentARB,    /* pwglMakeContextCurrentARB */
740     dibdrv_wglMakeCurrent,              /* pwglMakeCurrent */
741     dibdrv_wglSetPixelFormatWINE,       /* pwglSetPixelFormatWINE */
742     dibdrv_wglShareLists,               /* pwglShareLists */
743     dibdrv_wglUseFontBitmapsA,          /* pwglUseFontBitmapsA */
744     dibdrv_wglUseFontBitmapsW,          /* pwglUseFontBitmapsW */
745
746     GDI_PRIORITY_DIB_DRV                /* priority */
747 };