4 * Started by Robert Pouliot <krynos@clic.net>
11 #include <sys/types.h>
15 #endif /* !defined(__EMX__) */
17 #endif /* defined(HAVE_LIBXXSHM) */
26 #include "selectors.h"
31 typedef enum WING_DITHER_TYPE
33 WING_DISPERSED_4x4
, WING_DISPERSED_8x8
, WING_CLUSTERED_4x4
37 * WinG DIB bitmaps can be selected into DC and then scribbled upon
38 * by GDI functions. They can also be changed directly. This gives us
40 * - use original WinG 16-bit DLL
41 * requires working 16-bit driver interface
42 * - implement DIB graphics driver from scratch
44 * - use shared pixmaps
45 * won't work with some videocards and/or videomodes
49 /***********************************************************************
50 * WinGCreateDC16 (WING.1001)
52 HDC16 WINAPI
WinGCreateDC16(void)
54 TRACE(wing
, "(void)\n");
55 return CreateCompatibleDC16(0);
58 /***********************************************************************
59 * WinGRecommendDIBFormat16 (WING.1002)
61 BOOL16 WINAPI
WinGRecommendDIBFormat16(BITMAPINFO
*bmpi
)
63 TRACE(wing
, "(%p)\n", bmpi
);
67 bmpi
->bmiHeader
.biSize
= sizeof(BITMAPINFOHEADER
);
68 bmpi
->bmiHeader
.biWidth
= 320;
69 bmpi
->bmiHeader
.biHeight
= -1;
70 bmpi
->bmiHeader
.biPlanes
= 1;
71 bmpi
->bmiHeader
.biBitCount
= MONITOR_GetDepth(&MONITOR_PrimaryMonitor
);
72 bmpi
->bmiHeader
.biCompression
= BI_RGB
;
73 bmpi
->bmiHeader
.biSizeImage
= 0;
74 bmpi
->bmiHeader
.biXPelsPerMeter
= 0;
75 bmpi
->bmiHeader
.biYPelsPerMeter
= 0;
76 bmpi
->bmiHeader
.biClrUsed
= 0;
77 bmpi
->bmiHeader
.biClrImportant
= 0;
82 /***********************************************************************
83 * WinGCreateBitmap16 (WING.1003)
85 HBITMAP16 WINAPI
WinGCreateBitmap16(HDC16 hdc
, BITMAPINFO
*bmpi
,
88 TRACE(wing
, "(%d,%p,%p)\n", hdc
, bmpi
, bits
);
89 TRACE(wing
, ": create %ldx%ldx%d bitmap\n", bmpi
->bmiHeader
.biWidth
,
90 bmpi
->bmiHeader
.biHeight
, bmpi
->bmiHeader
.biPlanes
);
91 return CreateDIBSection16(hdc
, bmpi
, 0, bits
, 0, 0);
94 /***********************************************************************
95 * WinGGetDIBPointer (WING.1004)
97 SEGPTR WINAPI
WinGGetDIBPointer16(HBITMAP16 hWinGBitmap
, BITMAPINFO
* bmpi
)
99 BITMAPOBJ
* bmp
= (BITMAPOBJ
*) GDI_GetObjPtr( hWinGBitmap
, BITMAP_MAGIC
);
101 TRACE(wing
, "(%d,%p)\n", hWinGBitmap
, bmpi
);
102 if (!bmp
) return (SEGPTR
)NULL
;
105 FIXME(wing
, ": Todo - implement setting BITMAPINFO\n");
107 return PTR_SEG_OFF_TO_SEGPTR(bmp
->dib
->selector
, 0);
110 /***********************************************************************
111 * WinGSetDIBColorTable (WING.1004)
113 UINT16 WINAPI
WinGSetDIBColorTable16(HDC16 hdc
, UINT16 start
, UINT16 num
,
116 TRACE(wing
, "(%d,%d,%d,%p)\n", hdc
, start
, num
, colors
);
117 return SetDIBColorTable16(hdc
, start
, num
, colors
);
120 /***********************************************************************
121 * WinGGetDIBColorTable16 (WING.1005)
123 UINT16 WINAPI
WinGGetDIBColorTable16(HDC16 hdc
, UINT16 start
, UINT16 num
,
126 TRACE(wing
, "(%d,%d,%d,%p)\n", hdc
, start
, num
, colors
);
127 return GetDIBColorTable16(hdc
, start
, num
, colors
);
130 /***********************************************************************
131 * WinGCreateHalfTonePalette16 (WING.1007)
133 HPALETTE16 WINAPI
WinGCreateHalfTonePalette16(void)
135 TRACE(wing
, "(void)\n");
136 return CreateHalftonePalette16(GetDC16(0));
139 /***********************************************************************
140 * WinGCreateHalfToneBrush16 (WING.1008)
142 HBRUSH16 WINAPI
WinGCreateHalfToneBrush16(HDC16 winDC
, COLORREF col
,
143 WING_DITHER_TYPE type
)
145 TRACE(wing
, "(%d,%ld,%d)\n", winDC
, col
, type
);
146 return CreateSolidBrush16(col
);
149 /***********************************************************************
150 * WinGStretchBlt16 (WING.1009)
152 BOOL16 WINAPI
WinGStretchBlt16(HDC16 destDC
, INT16 xDest
, INT16 yDest
,
153 INT16 widDest
, INT16 heiDest
,
154 HDC16 srcDC
, INT16 xSrc
, INT16 ySrc
,
155 INT16 widSrc
, INT16 heiSrc
)
157 TRACE(wing
, "(%d,%d,...)\n", destDC
, srcDC
);
158 return StretchBlt16(destDC
, xDest
, yDest
, widDest
, heiDest
, srcDC
,
159 xSrc
, ySrc
, widSrc
, heiSrc
, SRCCOPY
);
162 /***********************************************************************
163 * WinGBitBlt16 (WING.1010)
165 BOOL16 WINAPI
WinGBitBlt16(HDC16 destDC
, INT16 xDest
, INT16 yDest
,
166 INT16 widDest
, INT16 heiDest
, HDC16 srcDC
,
167 INT16 xSrc
, INT16 ySrc
)
169 TRACE(wing
, "(%d,%d,...)\n", destDC
, srcDC
);
170 return BitBlt16(destDC
, xDest
, yDest
, widDest
, heiDest
, srcDC
,
171 xSrc
, ySrc
, SRCCOPY
);