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"
19 DEFAULT_DEBUG_CHANNEL(wing
);
22 typedef enum WING_DITHER_TYPE
24 WING_DISPERSED_4x4
, WING_DISPERSED_8x8
, WING_CLUSTERED_4x4
28 * WinG DIB bitmaps can be selected into DC and then scribbled upon
29 * by GDI functions. They can also be changed directly. This gives us
31 * - use original WinG 16-bit DLL
32 * requires working 16-bit driver interface
33 * - implement DIB graphics driver from scratch
35 * - use shared pixmaps
36 * won't work with some videocards and/or videomodes
40 /***********************************************************************
41 * WinGCreateDC16 (WING.1001)
43 HDC16 WINAPI
WinGCreateDC16(void)
46 return CreateCompatibleDC16(0);
49 /***********************************************************************
50 * WinGRecommendDIBFormat16 (WING.1002)
52 BOOL16 WINAPI
WinGRecommendDIBFormat16(BITMAPINFO
*bmpi
)
55 TRACE("(%p)\n", bmpi
);
59 hdc
= CreateDCA( "DISPLAY", NULL
, NULL
, NULL
);
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
= 8;
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
);
95 TRACE("(%d,%p)\n", hWinGBitmap
, bmpi
);
96 if (!bmp
) return (SEGPTR
)NULL
;
99 FIXME(": Todo - implement setting BITMAPINFO\n");
101 #ifndef X_DISPLAY_MISSING
102 res
= MAKESEGPTR(((X11DRV_DIBSECTION
*) bmp
->dib
)->selector
, 0);
103 #endif /* !defined(X_DISPLAY_MISSING) */
105 GDI_ReleaseObj( hWinGBitmap
);
109 /***********************************************************************
110 * WinGSetDIBColorTable (WING.1004)
112 UINT16 WINAPI
WinGSetDIBColorTable16(HDC16 hdc
, UINT16 start
, UINT16 num
,
115 TRACE("(%d,%d,%d,%p)\n", hdc
, start
, num
, colors
);
116 return SetDIBColorTable16(hdc
, start
, num
, colors
);
119 /***********************************************************************
120 * WinGGetDIBColorTable16 (WING.1005)
122 UINT16 WINAPI
WinGGetDIBColorTable16(HDC16 hdc
, UINT16 start
, UINT16 num
,
125 TRACE("(%d,%d,%d,%p)\n", hdc
, start
, num
, colors
);
126 return GetDIBColorTable16(hdc
, start
, num
, colors
);
129 /***********************************************************************
130 * WinGCreateHalfTonePalette16 (WING.1007)
132 HPALETTE16 WINAPI
WinGCreateHalfTonePalette16(void)
134 HDC hdc
= CreateCompatibleDC(0);
135 HPALETTE16 ret
= CreateHalftonePalette16(hdc
);
141 /***********************************************************************
142 * WinGCreateHalfToneBrush16 (WING.1008)
144 HBRUSH16 WINAPI
WinGCreateHalfToneBrush16(HDC16 winDC
, COLORREF col
,
145 WING_DITHER_TYPE type
)
147 TRACE("(%d,%ld,%d)\n", winDC
, col
, type
);
148 return CreateSolidBrush16(col
);
151 /***********************************************************************
152 * WinGStretchBlt16 (WING.1009)
154 BOOL16 WINAPI
WinGStretchBlt16(HDC16 destDC
, INT16 xDest
, INT16 yDest
,
155 INT16 widDest
, INT16 heiDest
,
156 HDC16 srcDC
, INT16 xSrc
, INT16 ySrc
,
157 INT16 widSrc
, INT16 heiSrc
)
160 TRACE("(%d,%d,...)\n", destDC
, srcDC
);
161 SetStretchBltMode16 ( destDC
, COLORONCOLOR
);
162 retval
=StretchBlt16(destDC
, xDest
, yDest
, widDest
, heiDest
, srcDC
,
163 xSrc
, ySrc
, widSrc
, heiSrc
, SRCCOPY
);
164 SetStretchBltMode16 ( destDC
, BLACKONWHITE
);
168 /***********************************************************************
169 * WinGBitBlt16 (WING.1010)
171 BOOL16 WINAPI
WinGBitBlt16(HDC16 destDC
, INT16 xDest
, INT16 yDest
,
172 INT16 widDest
, INT16 heiDest
, HDC16 srcDC
,
173 INT16 xSrc
, INT16 ySrc
)
175 TRACE("(%d,%d,...)\n", destDC
, srcDC
);
176 return BitBlt16(destDC
, xDest
, yDest
, widDest
, heiDest
, srcDC
,
177 xSrc
, ySrc
, SRCCOPY
);