blob: 3bae4894c953c19d225b0f7a344abc42946125ad [file] [log] [blame]
Alexandre Julliardda0cfb31996-12-01 17:17:47 +00001/*
2 * WingG support
3 *
4 * Started by Robert Pouliot <krynos@clic.net>
5 */
6
7#include "gdi.h"
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +00008#include "windows.h"
Alexandre Julliardda0cfb31996-12-01 17:17:47 +00009#include "stddebug.h"
10#include "debug.h"
11
Alexandre Julliardda0cfb31996-12-01 17:17:47 +000012/***********************************************************************
13 * WingCreateDC16 (WING.1001)
14 */
15HDC16 WinGCreateDC16(void)
16{
17 /* FIXME: Probably wrong... */
18 return CreateDC("DISPLAY", NULL, NULL, NULL);
19}
20
21
22/***********************************************************************
23 * WinGRecommendDIBFormat16 (WING.1002)
24 */
25BOOL16 WinGRecommendDIBFormat16(BITMAPINFO *fmt)
26{
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +000027 HDC16 i=GetDC16(0);
28
29 fmt->bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
30 fmt->bmiHeader.biWidth=0;
31 fmt->bmiHeader.biHeight=1; /* The important part */
32 fmt->bmiHeader.biPlanes=GetDeviceCaps(i, PLANES);
33 fmt->bmiHeader.biBitCount=GetDeviceCaps(i, BITSPIXEL);
34 fmt->bmiHeader.biCompression=BI_RGB;
35 fmt->bmiHeader.biSizeImage=0;
36 fmt->bmiHeader.biXPelsPerMeter=1000/25.4*GetDeviceCaps(i,LOGPIXELSX);
37 fmt->bmiHeader.biYPelsPerMeter=1000/25.4*GetDeviceCaps(i,LOGPIXELSY);
38 fmt->bmiHeader.biClrUsed=0;
39 fmt->bmiHeader.biClrImportant=0;
40 ReleaseDC16(0, i);
41 return 1;
Alexandre Julliardda0cfb31996-12-01 17:17:47 +000042}
43
44/***********************************************************************
45 * WinGCreateBitmap16 (WING.1003)
46 */
47HBITMAP16 WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header, void **bits)
48{
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +000049 fprintf(stdnimp,"WinGCreateBitmap: almost empty stub! (expect failure)\n");
50 /* Assume RGB color */
51 if(bits==NULL)
52 return CreateDIBitmap(winDC, header, 0, bits, header, 0);
53 else
54 return CreateDIBitmap(winDC, header, 1, bits, header, 0);
Alexandre Julliardda0cfb31996-12-01 17:17:47 +000055 return 0;
56}
57
58/***********************************************************************
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +000059 * WinGGetDIBPointer16 (WING.1004)
60 */
61void* WinGGetDIBPointer16(HBITMAP16 bmap, BITMAPINFO *header)
62{
63 fprintf(stdnimp,"WinGGetDIBPointer16: empty stub!\n");
64 return NULL;
65}
66
67/***********************************************************************
68 * WinGGetDIBColorTable16 (WING.1005)
69 */
70UINT16 WinGGetDIBColorTable16(HDC16 winDC, UINT16 start, UINT16 numentry,
71 RGBQUAD* colors)
72{
73 return GetPaletteEntries(winDC, start, numentry, colors);
74}
75
76/***********************************************************************
77 * WinGSetDIBColorTable16 (WING.1006)
78 */
79UINT16 WinGSetDIBColorTable16(HDC16 winDC, UINT16 start, UINT16 numentry,
80 RGBQUAD* colors)
81{
82 return SetPaletteEntries(winDC, start, numentry, colors);
83}
84
85
86/***********************************************************************
Alexandre Julliardda0cfb31996-12-01 17:17:47 +000087 * WinGCreateHalfTonePalette16 (WING.1007)
88 */
89HPALETTE16 WinGCreateHalfTonePalette16(void)
90{
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +000091 fprintf(stdnimp,"WinGCreateHalfTonePalette16: empty stub!\n");
Alexandre Julliardda0cfb31996-12-01 17:17:47 +000092 return 0;
93}
94
95/***********************************************************************
96 * WinGCreateHalfToneBrush16 (WING.1008)
97 */
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +000098HPALETTE16 WinGCreateHalfToneBrush16(HDC16 winDC, COLORREF col, INT16 dithertype)
Alexandre Julliardda0cfb31996-12-01 17:17:47 +000099{
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000100 fprintf(stdnimp,"WinGCreateHalfToneBrush16: empty stub!\n");
Alexandre Julliardda0cfb31996-12-01 17:17:47 +0000101 return 0;
102}
103
Alexandre Julliard7e6ae4b1996-12-08 19:25:27 +0000104/***********************************************************************
105 * WinGStretchBlt16 (WING.1009)
106 */
107BOOL16 WinGStretchBlt16(HDC16 destDC, INT16 xDest, INT16 yDest, INT16 widDest,
108 INT16 heiDest, HDC16 srcDC, INT16 xSrc, INT16 ySrc,
109 INT16 widSrc, INT16 heiSrc)
110{
111
112 return StretchBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC, xSrc, ySrc, widSrc, heiSrc, SRCCOPY);
113/* fprintf(stdnimp,"WinGStretchBlt16: empty stub!\n");*/
114/* return 0; */
115}
116
117/***********************************************************************
118 * WinGBitBlt16 (WING.1010)
119 */
120BOOL16 WinGBitBlt16(HDC16 destDC, INT16 xDest, INT16 yDest, INT16 widDest,
121 INT16 heiDest, HDC16 srcDC, INT16 xSrc, INT16 ySrc)
122{
123 return BitBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC, xSrc, ySrc, SRCCOPY);
124/* fprintf(stdnimp,"WinGBitBlt16: empty stub!\n");*/
125/* return 0;*/
126}
127