4 * Started by Robert Pouliot <krynos@clic.net>
9 #ifndef X_DISPLAY_MISSING
11 #endif /* !defined(X_DISPLAY_MISSING) */
13 #include "wine/winuser16.h"
15 #include "debugtools.h"
21 DEFAULT_DEBUG_CHANNEL(wing)
24 typedef enum WING_DITHER_TYPE
26 WING_DISPERSED_4x4, WING_DISPERSED_8x8, WING_CLUSTERED_4x4
30 * WinG DIB bitmaps can be selected into DC and then scribbled upon
31 * by GDI functions. They can also be changed directly. This gives us
33 * - use original WinG 16-bit DLL
34 * requires working 16-bit driver interface
35 * - implement DIB graphics driver from scratch
37 * - use shared pixmaps
38 * won't work with some videocards and/or videomodes
42 /***********************************************************************
43 * WinGCreateDC16 (WING.1001)
45 HDC16 WINAPI WinGCreateDC16(void)
48 return CreateCompatibleDC16(0);
51 /***********************************************************************
52 * WinGRecommendDIBFormat16 (WING.1002)
54 BOOL16 WINAPI WinGRecommendDIBFormat16(BITMAPINFO *bmpi)
56 TRACE("(%p)\n", bmpi);
60 bmpi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
61 bmpi->bmiHeader.biWidth = 320;
62 bmpi->bmiHeader.biHeight = -1;
63 bmpi->bmiHeader.biPlanes = 1;
64 bmpi->bmiHeader.biBitCount = MONITOR_GetDepth(&MONITOR_PrimaryMonitor);
65 bmpi->bmiHeader.biCompression = BI_RGB;
66 bmpi->bmiHeader.biSizeImage = 0;
67 bmpi->bmiHeader.biXPelsPerMeter = 0;
68 bmpi->bmiHeader.biYPelsPerMeter = 0;
69 bmpi->bmiHeader.biClrUsed = 0;
70 bmpi->bmiHeader.biClrImportant = 0;
75 /***********************************************************************
76 * WinGCreateBitmap16 (WING.1003)
78 HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 hdc, BITMAPINFO *bmpi,
81 TRACE("(%d,%p,%p)\n", hdc, bmpi, bits);
82 TRACE(": create %ldx%ldx%d bitmap\n", bmpi->bmiHeader.biWidth,
83 bmpi->bmiHeader.biHeight, bmpi->bmiHeader.biPlanes);
84 return CreateDIBSection16(hdc, bmpi, 0, bits, 0, 0);
87 /***********************************************************************
88 * WinGGetDIBPointer (WING.1004)
90 SEGPTR WINAPI WinGGetDIBPointer16(HBITMAP16 hWinGBitmap, BITMAPINFO* bmpi)
92 BITMAPOBJ* bmp = (BITMAPOBJ *) GDI_GetObjPtr( hWinGBitmap, BITMAP_MAGIC );
94 TRACE("(%d,%p)\n", hWinGBitmap, bmpi);
95 if (!bmp) return (SEGPTR)NULL;
98 FIXME(": Todo - implement setting BITMAPINFO\n");
100 #ifndef X_DISPLAY_MISSING
101 return PTR_SEG_OFF_TO_SEGPTR(((X11DRV_DIBSECTION *) bmp->dib)->selector, 0);
102 #else /* !defined(X_DISPLAY_MISSING) */
104 #endif /* !defined(X_DISPLAY_MISSING) */
107 /***********************************************************************
108 * WinGSetDIBColorTable (WING.1004)
110 UINT16 WINAPI WinGSetDIBColorTable16(HDC16 hdc, UINT16 start, UINT16 num,
113 TRACE("(%d,%d,%d,%p)\n", hdc, start, num, colors);
114 return SetDIBColorTable16(hdc, start, num, colors);
117 /***********************************************************************
118 * WinGGetDIBColorTable16 (WING.1005)
120 UINT16 WINAPI WinGGetDIBColorTable16(HDC16 hdc, UINT16 start, UINT16 num,
123 TRACE("(%d,%d,%d,%p)\n", hdc, start, num, colors);
124 return GetDIBColorTable16(hdc, start, num, colors);
127 /***********************************************************************
128 * WinGCreateHalfTonePalette16 (WING.1007)
130 HPALETTE16 WINAPI WinGCreateHalfTonePalette16(void)
133 return CreateHalftonePalette16(GetDC16(0));
136 /***********************************************************************
137 * WinGCreateHalfToneBrush16 (WING.1008)
139 HBRUSH16 WINAPI WinGCreateHalfToneBrush16(HDC16 winDC, COLORREF col,
140 WING_DITHER_TYPE type)
142 TRACE("(%d,%ld,%d)\n", winDC, col, type);
143 return CreateSolidBrush16(col);
146 /***********************************************************************
147 * WinGStretchBlt16 (WING.1009)
149 BOOL16 WINAPI WinGStretchBlt16(HDC16 destDC, INT16 xDest, INT16 yDest,
150 INT16 widDest, INT16 heiDest,
151 HDC16 srcDC, INT16 xSrc, INT16 ySrc,
152 INT16 widSrc, INT16 heiSrc)
155 TRACE("(%d,%d,...)\n", destDC, srcDC);
156 SetStretchBltMode16 ( destDC, COLORONCOLOR );
157 retval=StretchBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC,
158 xSrc, ySrc, widSrc, heiSrc, SRCCOPY);
159 SetStretchBltMode16 ( destDC, BLACKONWHITE );
163 /***********************************************************************
164 * WinGBitBlt16 (WING.1010)
166 BOOL16 WINAPI WinGBitBlt16(HDC16 destDC, INT16 xDest, INT16 yDest,
167 INT16 widDest, INT16 heiDest, HDC16 srcDC,
168 INT16 xSrc, INT16 ySrc)
170 TRACE("(%d,%d,...)\n", destDC, srcDC);
171 return BitBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC,
172 xSrc, ySrc, SRCCOPY);