4 * Started by Robert Pouliot <krynos@clic.net>
9 #include "wine/winuser16.h"
11 #include "debugtools.h"
15 DEFAULT_DEBUG_CHANNEL(wing);
18 typedef enum WING_DITHER_TYPE
20 WING_DISPERSED_4x4, WING_DISPERSED_8x8, WING_CLUSTERED_4x4
24 * WinG DIB bitmaps can be selected into DC and then scribbled upon
25 * by GDI functions. They can also be changed directly. This gives us
27 * - use original WinG 16-bit DLL
28 * requires working 16-bit driver interface
29 * - implement DIB graphics driver from scratch
31 * - use shared pixmaps
32 * won't work with some videocards and/or videomodes
36 /***********************************************************************
37 * WinGCreateDC (WING.1001)
39 HDC16 WINAPI WinGCreateDC16(void)
42 return CreateCompatibleDC16(0);
45 /***********************************************************************
46 * WinGRecommendDIBFormat (WING.1002)
48 BOOL16 WINAPI WinGRecommendDIBFormat16(BITMAPINFO *bmpi)
51 TRACE("(%p)\n", bmpi);
55 hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
56 bmpi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
57 bmpi->bmiHeader.biWidth = 320;
58 bmpi->bmiHeader.biHeight = -1;
59 bmpi->bmiHeader.biPlanes = 1;
60 bmpi->bmiHeader.biBitCount = 8;
61 bmpi->bmiHeader.biCompression = BI_RGB;
62 bmpi->bmiHeader.biSizeImage = 0;
63 bmpi->bmiHeader.biXPelsPerMeter = 0;
64 bmpi->bmiHeader.biYPelsPerMeter = 0;
65 bmpi->bmiHeader.biClrUsed = 0;
66 bmpi->bmiHeader.biClrImportant = 0;
71 /***********************************************************************
72 * WinGCreateBitmap (WING.1003)
74 HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 hdc, BITMAPINFO *bmpi,
77 TRACE("(%d,%p,%p)\n", hdc, bmpi, bits);
78 TRACE(": create %ldx%ldx%d bitmap\n", bmpi->bmiHeader.biWidth,
79 bmpi->bmiHeader.biHeight, bmpi->bmiHeader.biPlanes);
80 return CreateDIBSection16(hdc, bmpi, 0, bits, 0, 0);
83 /***********************************************************************
84 * WinGGetDIBPointer (WING.1004)
86 SEGPTR WINAPI WinGGetDIBPointer16(HBITMAP16 hWinGBitmap, BITMAPINFO* bmpi)
88 BITMAPOBJ* bmp = (BITMAPOBJ *) GDI_GetObjPtr( hWinGBitmap, BITMAP_MAGIC );
91 TRACE("(%d,%p)\n", hWinGBitmap, bmpi);
94 if (bmpi) FIXME(": Todo - implement setting BITMAPINFO\n");
96 res = bmp->segptr_bits;
97 GDI_ReleaseObj( hWinGBitmap );
101 /***********************************************************************
102 * WinGSetDIBColorTable (WING.1006)
104 UINT16 WINAPI WinGSetDIBColorTable16(HDC16 hdc, UINT16 start, UINT16 num,
107 TRACE("(%d,%d,%d,%p)\n", hdc, start, num, colors);
108 return SetDIBColorTable16(hdc, start, num, colors);
111 /***********************************************************************
112 * WinGGetDIBColorTable (WING.1005)
114 UINT16 WINAPI WinGGetDIBColorTable16(HDC16 hdc, UINT16 start, UINT16 num,
117 TRACE("(%d,%d,%d,%p)\n", hdc, start, num, colors);
118 return GetDIBColorTable16(hdc, start, num, colors);
121 /***********************************************************************
122 * WinGCreateHalfTonePalette (WING.1007)
124 HPALETTE16 WINAPI WinGCreateHalfTonePalette16(void)
126 HDC hdc = CreateCompatibleDC(0);
127 HPALETTE16 ret = CreateHalftonePalette16(hdc);
133 /***********************************************************************
134 * WinGCreateHalfToneBrush (WING.1008)
136 HBRUSH16 WINAPI WinGCreateHalfToneBrush16(HDC16 winDC, COLORREF col,
137 WING_DITHER_TYPE type)
139 TRACE("(%d,%ld,%d)\n", winDC, col, type);
140 return CreateSolidBrush16(col);
143 /***********************************************************************
144 * WinGStretchBlt (WING.1009)
146 BOOL16 WINAPI WinGStretchBlt16(HDC16 destDC, INT16 xDest, INT16 yDest,
147 INT16 widDest, INT16 heiDest,
148 HDC16 srcDC, INT16 xSrc, INT16 ySrc,
149 INT16 widSrc, INT16 heiSrc)
152 TRACE("(%d,%d,...)\n", destDC, srcDC);
153 SetStretchBltMode16 ( destDC, COLORONCOLOR );
154 retval=StretchBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC,
155 xSrc, ySrc, widSrc, heiSrc, SRCCOPY);
156 SetStretchBltMode16 ( destDC, BLACKONWHITE );
160 /***********************************************************************
161 * WinGBitBlt (WING.1010)
163 BOOL16 WINAPI WinGBitBlt16(HDC16 destDC, INT16 xDest, INT16 yDest,
164 INT16 widDest, INT16 heiDest, HDC16 srcDC,
165 INT16 xSrc, INT16 ySrc)
167 TRACE("(%d,%d,...)\n", destDC, srcDC);
168 return BitBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC,
169 xSrc, ySrc, SRCCOPY);