Added SHDoDragDrop() stub.
[wine/multimedia.git] / graphics / wing.c
blob21d468ed40817c3f4ed50b016f0b0e4b1347a573
1 /*
2 * WinG support
4 * Started by Robert Pouliot <krynos@clic.net>
5 */
7 #include "config.h"
9 #ifndef X_DISPLAY_MISSING
10 #include "x11drv.h"
11 #endif /* !defined(X_DISPLAY_MISSING) */
13 #include "wine/winuser16.h"
14 #include "bitmap.h"
15 #include "debug.h"
16 #include "ldt.h"
17 #include "monitor.h"
18 #include "palette.h"
19 #include "windef.h"
20 #include "wine/winuser16.h"
22 DEFAULT_DEBUG_CHANNEL(wing)
25 typedef enum WING_DITHER_TYPE
27 WING_DISPERSED_4x4, WING_DISPERSED_8x8, WING_CLUSTERED_4x4
28 } WING_DITHER_TYPE;
30 /*
31 * WinG DIB bitmaps can be selected into DC and then scribbled upon
32 * by GDI functions. They can also be changed directly. This gives us
33 * three choices
34 * - use original WinG 16-bit DLL
35 * requires working 16-bit driver interface
36 * - implement DIB graphics driver from scratch
37 * see wing.zip size
38 * - use shared pixmaps
39 * won't work with some videocards and/or videomodes
40 * 961208 - AK
43 /***********************************************************************
44 * WinGCreateDC16 (WING.1001)
46 HDC16 WINAPI WinGCreateDC16(void)
48 TRACE(wing, "(void)\n");
49 return CreateCompatibleDC16(0);
52 /***********************************************************************
53 * WinGRecommendDIBFormat16 (WING.1002)
55 BOOL16 WINAPI WinGRecommendDIBFormat16(BITMAPINFO *bmpi)
57 TRACE(wing, "(%p)\n", bmpi);
58 if (!bmpi)
59 return FALSE;
61 bmpi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
62 bmpi->bmiHeader.biWidth = 320;
63 bmpi->bmiHeader.biHeight = -1;
64 bmpi->bmiHeader.biPlanes = 1;
65 bmpi->bmiHeader.biBitCount = MONITOR_GetDepth(&MONITOR_PrimaryMonitor);
66 bmpi->bmiHeader.biCompression = BI_RGB;
67 bmpi->bmiHeader.biSizeImage = 0;
68 bmpi->bmiHeader.biXPelsPerMeter = 0;
69 bmpi->bmiHeader.biYPelsPerMeter = 0;
70 bmpi->bmiHeader.biClrUsed = 0;
71 bmpi->bmiHeader.biClrImportant = 0;
73 return TRUE;
76 /***********************************************************************
77 * WinGCreateBitmap16 (WING.1003)
79 HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 hdc, BITMAPINFO *bmpi,
80 SEGPTR *bits)
82 TRACE(wing, "(%d,%p,%p)\n", hdc, bmpi, bits);
83 TRACE(wing, ": create %ldx%ldx%d bitmap\n", bmpi->bmiHeader.biWidth,
84 bmpi->bmiHeader.biHeight, bmpi->bmiHeader.biPlanes);
85 return CreateDIBSection16(hdc, bmpi, 0, bits, 0, 0);
88 /***********************************************************************
89 * WinGGetDIBPointer (WING.1004)
91 SEGPTR WINAPI WinGGetDIBPointer16(HBITMAP16 hWinGBitmap, BITMAPINFO* bmpi)
93 BITMAPOBJ* bmp = (BITMAPOBJ *) GDI_GetObjPtr( hWinGBitmap, BITMAP_MAGIC );
95 TRACE(wing, "(%d,%p)\n", hWinGBitmap, bmpi);
96 if (!bmp) return (SEGPTR)NULL;
98 if (bmpi)
99 FIXME(wing, ": Todo - implement setting BITMAPINFO\n");
101 #ifndef X_DISPLAY_MISSING
102 return PTR_SEG_OFF_TO_SEGPTR(((X11DRV_DIBSECTION *) bmp->dib)->selector, 0);
103 #else /* !defined(X_DISPLAY_MISSING) */
104 return NULL;
105 #endif /* !defined(X_DISPLAY_MISSING) */
108 /***********************************************************************
109 * WinGSetDIBColorTable (WING.1004)
111 UINT16 WINAPI WinGSetDIBColorTable16(HDC16 hdc, UINT16 start, UINT16 num,
112 RGBQUAD *colors)
114 TRACE(wing, "(%d,%d,%d,%p)\n", hdc, start, num, colors);
115 return SetDIBColorTable16(hdc, start, num, colors);
118 /***********************************************************************
119 * WinGGetDIBColorTable16 (WING.1005)
121 UINT16 WINAPI WinGGetDIBColorTable16(HDC16 hdc, UINT16 start, UINT16 num,
122 RGBQUAD *colors)
124 TRACE(wing, "(%d,%d,%d,%p)\n", hdc, start, num, colors);
125 return GetDIBColorTable16(hdc, start, num, colors);
128 /***********************************************************************
129 * WinGCreateHalfTonePalette16 (WING.1007)
131 HPALETTE16 WINAPI WinGCreateHalfTonePalette16(void)
133 TRACE(wing, "(void)\n");
134 return CreateHalftonePalette16(GetDC16(0));
137 /***********************************************************************
138 * WinGCreateHalfToneBrush16 (WING.1008)
140 HBRUSH16 WINAPI WinGCreateHalfToneBrush16(HDC16 winDC, COLORREF col,
141 WING_DITHER_TYPE type)
143 TRACE(wing, "(%d,%ld,%d)\n", winDC, col, type);
144 return CreateSolidBrush16(col);
147 /***********************************************************************
148 * WinGStretchBlt16 (WING.1009)
150 BOOL16 WINAPI WinGStretchBlt16(HDC16 destDC, INT16 xDest, INT16 yDest,
151 INT16 widDest, INT16 heiDest,
152 HDC16 srcDC, INT16 xSrc, INT16 ySrc,
153 INT16 widSrc, INT16 heiSrc)
155 TRACE(wing, "(%d,%d,...)\n", destDC, srcDC);
156 return StretchBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC,
157 xSrc, ySrc, widSrc, heiSrc, SRCCOPY);
160 /***********************************************************************
161 * WinGBitBlt16 (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(wing, "(%d,%d,...)\n", destDC, srcDC);
168 return BitBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC,
169 xSrc, ySrc, SRCCOPY);